Managed MyGUI

Altren

14-03-2009 13:34:37

Hello from MyGUI project! We have implemented generator wrappers for the library. Generator parsed data from doxygen, and with the help of templates, performs the generation of wrappers. At the moment there are templates for C# and Managed C++. It is also possible to setup generator for other languages if the need arises.

1. C# - MyGUI.Export.dll (exported functions) + MyGUI.Sharp.dll (wrapper using P/Invoke)
2. Managed C++ - MyGUI.Managed.dll (wrapper using CLR)

At this time, a wrapper does not support Mogre due to specifics of the latter, but we are working in this direction, and will be presented version that supports Mogre.
Generator, wrappers and a demo is now available in MyGUI svn ( https://my-gui.svn.sourceforge.net/svnroot/my-gui ).

Here's screenshot of TestApp (almost all wrapped classes and functions used in this demo).


Compilation:
1. Download MyGUI and compile it with same Ogre version and with same visual studio as Mogre was built with (also MYGUI_BUILD_WRAPPER option in CMake should be enabled). See also http://www.ogre3d.org/tikiwiki/MyGUI+Compiling
2. Compile MyGUI.OgrePlatform.Export(_d).dll
3. Generate Managed wrapper (to do this run WrapperGenerator that comes with MyGUI -> (in app select one by one)Generate Solution, Doxygen, Managed).
4. Compile MyGUI.Managed.dll in newly generated solution.
5. In Mogre add MyGUI.Managed.dll as referecnce
6. Use MyGUI initialisation from MyGUI.OgrePlatform.Export(_d).dll

Altren

16-03-2009 01:01:35

Now it also works with Mogre. We made binary packages for Mogre 1.4.8 SDK you can download it here http://downloads.sourceforge.net/my-gui ... _MyGUI.zip [3 Mb]

raygeee

16-03-2009 23:15:49

Thanks for sharing the wrappers, That's highly appreciated!

I've got 3 questions:
- Could you make the managed assembly CLS-Compliant? I'm getting a whole bunch of warnings because of that.
- Is any of the methods Gui::FindWidget--- going to be wrapped?
- Are the wrappers going to be maintained? Bugfixes etc.?

Altren

17-03-2009 00:29:40

- Could you make the managed assembly CLS-Compliant? I'm getting a whole bunch of warnings because of that.I need to ask my.name, I don't know :)
- Is any of the methods Gui::FindWidget--- going to be wrapped?Yes, we'll add it.
- Are the wrappers going to be maintained? Bugfixes etc.?Yes, all this wrapping stuff is automated, so it's easy to keep it up to date, so it will be maintained as long as MyGUI will.

boyamer

27-05-2009 13:15:37

Anyone ported out to Mogre 1.6.2?

Vectrex

20-02-2010 14:32:37

Bump. Would be great to include this in the MOgre package. Is the automated wrapper generator still working with the latest mygui?

my.name

24-02-2010 22:32:35

MyGUI 3.0.2 (2856) already for Mogre (SDK 1.6.5)

Vectrex

25-02-2010 03:25:59

MyGUI 3.0.2 (2856) already for Mogre (SDK 1.6.5)

Great! Thanks a lot for that

my.name

04-03-2010 21:13:50

MyGUI 3.0 for MogreSDK 1.6.5
https://sourceforge.net/projects/my-gui/files/Managed%20MyGUI%20for%20Mogre/MyGUI%20for%20Mogre%201.6.5/Managed_for_MogreSDK_1.6.zip/download - bin (8.6 Mb)
https://sourceforge.net/projects/my-gui/files/Managed%20MyGUI%20for%20Mogre/MyGUI%20for%20Mogre%201.6.5/MogreFramework_MyGUI_3.0.zip/download - source (25.6 Kb)

Vectrex

05-03-2010 00:39:43

Thanks, but I'm getting these errors when building it from source
I've included MOgre and MyGuiFramework (which builds fine) to the project

"
C:\Users\Cam\Desktop\KartSim\MogreFramework_MyGUI_3.0\MogreApp\InputHelper.cs(6,13): error CS0234: The type or namespace name 'Managed' does not exist in the namespace 'MyGUI' (are you missing an assembly reference?)
C:\Users\Cam\Desktop\KartSim\MogreFramework_MyGUI_3.0\MogreApp\Program.cs(8,13): error CS0234: The type or namespace name 'Managed' does not exist in the namespace 'MyGUI' (are you missing an assembly reference?)
C:\Users\Cam\Desktop\KartSim\MogreFramework_MyGUI_3.0\MogreApp\InputHelper.cs(14,24): error CS0246: The type or namespace name 'KeyCode' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Cam\Desktop\KartSim\MogreFramework_MyGUI_3.0\MogreApp\InputHelper.cs(190,23): error CS0246: The type or namespace name 'KeyCode' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Cam\Desktop\KartSim\MogreFramework_MyGUI_3.0\MogreApp\InputHelper.cs(201,23): error CS0246: The type or namespace name 'MouseButton' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Cam\Desktop\KartSim\MogreFramework_MyGUI_3.0\MogreApp\Program.cs(138,43): error CS0246: The type or namespace name 'Widget' could not be found (are you missing a using directive or an assembly reference?)
"

my.name

05-03-2010 09:57:28

add reference to MyGUI.Managed.dll or MyGUI.Managed_d.dll

andyhebear1

04-06-2010 17:19:22

MyGUI 3.0 for MogreSDK 1.6.5
https://sourceforge.net/projects/my-gui ... p/download - bin (8.6 Mb)
https://sourceforge.net/projects/my-gui ... p/download


dou you have Managed_for_MogreSDK_1.48.bin.zip?

Altren

06-06-2010 23:52:37

No.

DangerMouse

17-06-2010 22:08:58

With the binaries provided for 1.6.5 I'm getting the error "Unable to load DLL 'MyGUI.OgrePlatform.Export.dll': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)" when trying to use the export methods.

Can somebody provide a version that works with Mogre 1.7.1?

AliAkdurak

21-07-2010 07:56:15

I am also in need of MyGUI for Mogre 1.7.1 beta 72 VS2010.

If there is a way that can be easily ported I will try to help. But considering my experience level with C++/CLI I will need clear information about how to do that.

Thanks anyway.

mstoyke

24-07-2010 11:00:39

You can take a look at this post that I made some days ago: viewtopic.php?f=8&t=13111
There is an older version of MyGUI in the repository to work with Mogre 1.7.1 for VS2010 and .NET4. There are some changes in the managed wrapper code to make it easier to work with it and to use it with Mogre SDK beta 72 you need to recompile the sources for .NET2 and link them against the Mogre beta 72 libraries.

noferat

31-12-2010 08:36:33

Can somebody share compiled working - (MyGUI.Export.dll and MyGUI.Sharp.dll) or (MyGUI.OgrePlatform.Export.dll) for Mogre 1.7.1 VS2010 .NET2?
Thanks.

XainFaith

13-01-2011 19:03:33

Has there been any updates on this for Mogre 1.7.1. is there a way to build Managed MyGui for Mogre 1.7.1 currently.
if so is there any where with instructions to do so or has anyone got this working.

I stoped using the last graphics enegine i was using because there was lack of gui support for its underlying render type ( XNA ) and i personally reather like
Mogre but i need a good solid gui framework. Id hate to migrate back to C++ in the end just to get some decent Gui.

So anything at all would be very much apprecated.

Regards XainFaith.

Altren

13-01-2011 19:59:38

Managed MyGUI can be compiled with Mogre 1.7.1 too. You need to do next things:
1. Download MyGUI and compile it with same Ogre version and with same visual studio as Mogre was built with (also MYGUI_BUILD_WRAPPER should be enabled).
2. Compile MyGUI.OgrePlatform.Export(_d).dll
3. Generate Managed wrapper (to do this run WrapperGenerator that comes with MyGUI -> (in app select one by one)Generate Solution, Doxygen, Managed).
4. Compile MyGUI.Managed.dll in newly generated solution.
5. In Mogre add MyGUI.Managed.dll as referecnce
6. Use MyGUI initialisation from MyGUI.OgrePlatform.Export(_d).dll

XainFaith

13-01-2011 20:07:50

EDIT: Do i have to download the ogre SDK because i only have the Mogre sdk and what version of VS do i need.

Ok i will give that a try. Ill post back if i have problems.
and when i get it working ill attempt to post some specific instructions for the next guy or gal.

Altren

13-01-2011 20:23:25

Do i have to download the ogre SDK because i only have the Mogre sdk and what version of VS do i need.Yes, you need either Ogre SDK or Ogre built from sources for building MyGUI.OgrePlatform (non-managed) that is required for Managed version.

XainFaith

13-01-2011 20:31:57

would the libs from the Mogre release folder not work?

XainFaith

13-01-2011 22:32:39

Ok so i manage to get step 1 done .. that was an up hill battle.
I can not find step 2.) I managed make a MyGUI.OgrePlatform.dll not sure if thats usefull or not.

I also can not seem to find this wrapper generator. If you are possibly talking about CMake i have never been able to get the to work right.

Also i have soucre for MyGui from its SVN i do not know if that helps or not.

Altren

13-01-2011 23:59:14

Staps 2 and 3 require MYGUI_BUILD_WRAPPER CMake option to be enabled - if you won't do that CMake won't generate those projects.

XainFaith

14-01-2011 00:16:03

Ok i am gona list the instructions i have done so far below.

Converted projects to VC 2010 in the Solution Ogre because i do not have VC 2008.

Downloaded Boost and FreeType.
Add the include paths in both the projects MyGuiEngine and MyGui.OgrePlatform. Paths Added ( VC 2010 includes, FreeType, Boost )
Add the lib path for Ogre from the Mogre SDK's lib files, Add the lib path for Windows SDK V7.0 lib path, Add Lib path to the VC 2010 lib files ( Windows.h etc)

Now i am not sure what lib type should be built but i built the MuGUI.OgrePlatform as a Dynamic DLL

if thats all correct so far i am just confused on how i am suppost to do the MyGuiOgrePlatform.Export you refering to i assumed it was the one mentioned above.

Let me know if i got that correct so far.

If i should be using CMake to do the above please let me know as well.

XainFaith

14-01-2011 01:24:45

Well i was trying to use CMake at the top level of the source folder and all i keep getting is linking errors, Mostly stuff that you would find in the windows SDK and the VC compiles lib folder. I have no idea how to set it up to know where these files are and i hope i do not have to convert every project just to build the small part i want.

Also i can not find the option you were refering too, i have CMake 2.8.3 and i was using the CMake Gui.

If anyone knows if there is a way i can tell cmake where to find lib files id love to know.

Altren

14-01-2011 09:57:29

If you have problems with compiling read http://www.ogre3d.org/tikiwiki/MyGUI+Compiling , and about option - Also there is no way to get Wrapper with pre-generated solutions, so you should use CMake.

XainFaith

14-01-2011 22:05:20

I am following the instructions from the url you provided i have managed to abit done but when using cmake with the OgreSource or the OgreSource built i get this error

CMake Error at CMake/Utils/MacroLogFeature.cmake:91 (MESSAGE):



-----------------------------------------------------------------------------


-- The following REQUIRED packages could NOT be located on your system.

-- Please install them before continuing this software installation.

-- If you are in Windows, try passing -DMYGUI_DEPENDENCIES_DIR=<path to
dependencies>

-- Also check that you buildind with RenderSystem that you need or set
another with -DMYGUI_RENDERSYSTEM=<1 2 or 3 for Direct3D_9 OGRE or OpenGL>


-----------------------------------------------------------------------------


+ ogre: Support for the Ogre render system <>


-----------------------------------------------------------------------------
Call Stack (most recent call first):
CMake/Dependencies.cmake:102 (MACRO_DISPLAY_FEATURE_LOG)
CMakeLists.txt:161 (include)


Configuring incomplete, errors occurred!

I have the render system set too 2 and thats the error i recive.

scorpio

22-03-2011 18:34:27

Greetings,

I'm using MyGUI with Mogre 1.6 (sourceforge package Managed_for_MogreSDK_1.6.zip). Everything works fine, however the .NET wrapper for the Gui class lacks two critical methods:

FindWidget
InjectFrameEntered

I researched a bit and the first method is implemented in the .NET wrapper, however it uses std:string as an argument and that makes it impossible to use from other assembly, due to the implementation of C++/CLI compiler. Would it be possible to update the sourceforge binaries with the new wrapper version containing both methods (for VS2008) ? I tried other GUI systems and have grown to like MyGUI the most, however without the ability to find a Widget the .NET wrapper becomes almost unusable, which is a pity. I could update it myself, however compiling all of this is non-trivial and my time for fun with Mogre is unfortunately quite limited.

Thanks guys.

Altren

22-03-2011 19:52:06

I used managed MyGUI in my project and I never needed findWidget method. I used BaseLayout and attributes ans it makes MyGUI usage much more handy than finding and assigning each widget manually.
I attached my implementation.

And here's usage. Everything that you need is inherit from BaseLayout and add attribute for class
[LayoutName("LayoutFileName.layout")]
and each required widget:
[WidgetName("Widget_name_in_layout")]
using MyGUI.Managed;

namespace GUI
{
[LayoutName("MainMenu.layout")]
class MainMenu : BaseLayout
{
override public void Initialise()
{
base.Initialise();

mStartGameButton.EventMouseButtonClick += new WidgetEvent.HandleMouseButtonClick(mStartGameButton_EventMouseButtonClick);
mExitButton.EventMouseButtonClick += new WidgetEvent.HandleMouseButtonClick(mExitButton_EventMouseButtonClick);
}

private void mStartGameButton_EventMouseButtonClick(Widget _sender)
{
// some useful code here
}

private void mExitButton_EventMouseButtonClick(Widget _sender)
{
// some useful code here
}

#pragma warning disable 649
[WidgetName("StartGame")]
protected Button mStartGameButton;
[WidgetName("Exit")]
protected Button mExitButton;
#pragma warning restore 649
}
}


and somewhere in code:
mMainMenu = new GUI.MainMenu();
mMainMenu.Initialise();

...

mMainMenu.Dispose();

Layout
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Widget" skin="PanelSmall" position="300 216 200 168" align="Center" layer="Overlapped" name="_Main">
<Property key="Widget_Caption" value="Main Menu"/>
<Widget type="Button" skin="Button" position="16 16 168 40" align="HStretch Top" name="StartGame">
<Property key="Widget_Caption" value="Start game"/>
</Widget>
<Widget type="Button" skin="Button" position="16 110 168 40" align="HStretch Bottom" name="Exit">
<Property key="Widget_Caption" value="Exit #3333FF(Esc)"/>
</Widget>
</Widget>
</MyGUI>

scorpio

22-03-2011 20:35:48

Thanks for your response Altren, unfortunately, it won't help me.
I'm using MyGUI mainly from LUA (through LuaInterface, excellent .NET lua wrapper), and I'd like to attach events from the script, because it's not possible in the xml layout. That implies I have to find the Widget first.

Example (lua script):


function MainMenu_GUIReady()
gui:LoadLayout('MainMenu.xml')
gui:FindWidgetT('BtnNewGame').EventMouseButtonClick:Add(BtnNewGame_Click)
end

function BtnNewGame_Click(sender)
// some code
end


This allows me to write universal engine, where no widgets will be declared in managed code, only in layout or scripts.

dcboy

24-07-2011 17:30:18

i need help!!

i was download the last version mygui source code from svn,when i complite the wrapper soulition,there has many error!
ex:
there could't find button.Caption prototype in MOgreApp
why?
how to fix it !!

idcsteve

26-07-2011 17:08:09

Managed MyGUI can be compiled with Mogre 1.7.1 too. You need to do next things:
1. Download MyGUI and compile it with same Ogre version and with same visual studio as Mogre was built with (also MYGUI_BUILD_WRAPPER should be enabled).
2. Compile MyGUI.OgrePlatform.Export(_d).dll
3. Generate Managed wrapper (to do this run WrapperGenerator that comes with MyGUI -> (in app select one by one)Generate Solution, Doxygen, Managed).
4. Compile MyGUI.Managed.dll in newly generated solution.
5. In Mogre add MyGUI.Managed.dll as referecnce
6. Use MyGUI initialisation from MyGUI.OgrePlatform.Export(_d).dll


Hi,
I'm trying to follow these instructions, but I'm stuck at step 1. MYGUI_BUILD_WRAPPER is definitely enabled. I've managed to get it to compile, but it won't link. I get the following error for every demo project, the layout editor, the image set viewer, the font viewer and the wrapper base app.

Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl _FreeCLRHandle(void *)" (__imp_?_FreeCLRHandle@@YAXPAX@Z) referenced in function "public: __thiscall CLRHandle::~CLRHandle(void)" (??1CLRHandle@@QAE@XZ) C:\MyMogreBuild\MyGUI3.0Build\Demos\Demo_ScrollView\MyGUI.OgrePlatform_d.lib(MyGUI_OgreVertexBuffer.obj) Demo_ScrollView


So I updated cmake and all of my problems in step 1 went away.

I can't seem to get anywhere with step 2. I definitely checked the MYGUI_BUILD_WRAPPER option, but I still can't find a solution, project, or output with the name OgrePlatform.Export in it.
Where exactly should I look for this?

[Edit] Turns out that the problem was that the download doesn't contain everything you need. I checked out the latest version from SVN and everything was hunky dory. Now I just need to compile it for .NET 4.0. Does anyone have any suggestions?
Thanks,
Steve

XainFaith

17-08-2011 04:50:22

I just had a few questions regarding building Managed MyGui and MyGui.Platform.Export.dll

The instructions state to build my gui against the same version that MOgre was built against in my case that would be version 1.7.1 however
from what i have been reading MOgre is actually built against mysokes version of Ogre 1.7.1 if this is the case would i have to build MyGui against
mystokes version of will the one in the older versions section of Ogre source download do the trick.

One problem i have with building the export dll is that i all ways have to upgrade the project from something older then 2008, currently i only have vs 2010 installed. I am wondering if this has something to do with the errors i have been receiving as well as a few others.

i believe the issue has something to do with the Ogre platform miss matching with the one being used by mogre but of course this is just a theory at this point and i am just looking at gathering some more information.

Any ideas or information will be helpfull.