wxGlade

BlitzMax Forums/Brucey's Modules/wxGlade

Yahfree(Posted 2008) [#1]
http://wxglade.sourceforge.net/apps.php

Anyone have any experience with it? Its a simple free wxWidgets GUI editor. It can apparently export in python, C++, and a couple other languages....


And furthermore, how hard would it be getting code generated from this neat little app to work in blitzmax wxMax? I assume you'd probably have to write a phraser to convert one of the generated languages into blitzmax code. But is there an easyer way?

I've played with it for a bit, its simple, and very easy to get complex gui layouts on screen quickly.

Love to hear your thoughts.


Brucey(Posted 2008) [#2]
I assume you'd probably have to write a phraser to convert one of the generated languages into blitzmax code.

No, what I would tend to do is write a parser for it's Project File format - which are usually XML.

That's what I've done so far with wxCodeGen (wx.mod/tools) and its support for wxFormBuilder. I've investigated also supporting DialogBlocks, which shouldn't be too hard I think. I haven't seen a saved wxGlade project file yet, so I can't say how hard that might be to include too.


Yahfree(Posted 2008) [#3]
theres not project file format for wxGlade as far as I can tell..


There is:

Lisp
Python
Perl
C++ and
XRC


I'll check out wxFormBuilder

So what is the process of getting code generated from wxFormBuilder to bmax code?

edit: Nevermind I figured it out


Brucey(Posted 2008) [#4]
theres not project file format for wxGlade as far as I can tell..

Sure there is ;-)
When you save the "project" in wxGlade it creates a ".wxg" file - the project - which is an XML description from which it can be re-loaded into wxGlade.
That is separate from generating C++ or python code.

wxFormBuilder is much the same. You can choose to generate C++ code from the current project.

wxCodeGen can Load .pfb (wxFormbuilder project) files, and from that generate BlitzMax code.
wxCodeGen itself can generate it's own UI code from a .pfb file.

I'm looking into adding support for wxGlade and DialogBlocks.


Yahfree(Posted 2008) [#5]
cool, Form builder and wxcodegen are awsome, but i'm having trouble compiling generated code from wxcodegen.


heres the code:



and the errors:

Building main
Compiling:main.bmx
flat assembler  version 1.66
3 passes, 25356 bytes.
Linking:main.debug.exe
D:/programming/BlitzMax/mod/wx.mod/wx.mod/wx.debug.win32.x86.a(wxglue.cpp.debug.win32.x86.o):wxglue.cpp:(.text+0x2f5): undefined reference to `_wx_wxapp_wxApp__OnInit'
D:/programming/BlitzMax/mod/wx.mod/wx.mod/wx.debug.win32.x86.a(wxglue.cpp.debug.win32.x86.o):wxglue.cpp:(.text+0x309): undefined reference to `_wx_wxapp_wxApp__OnExit'
D:/programming/BlitzMax/mod/wx.mod/wx.mod/wx.debug.win32.x86.a(wxglue.cpp.debug.win32.x86.o):wxglue.cpp:(.text+0x355): undefined reference to `_wx_wxapp_wxAppMain__MainLoop'
Build Error: Failed to link D:/programming/Programs/Source/BlitzMax/test/main.debug.exe
Process complete


Thanks for all the help!


Brucey(Posted 2008) [#6]
You'll need some more code with that.

If you look in the "Application Code" tab of wxCodeGen you'll see a bit of example "stub" code that you can use.

The design of wxCodeGen's generated code allows you to keep the generated .bmx code as a separate file from the rest of your application. This way you can safely re-generate that file at any time without worrying about losing any changes.

In the stub code, where it says "Add frame creation code here", you could add :
Local frame:myFrame = myFrame(new myFrame.Create())
frame.Show()


:o)


Brucey(Posted 2008) [#7]
You might also want to update a bit... as v1.02 of wxCodeGen is quite old. (eg. lacking features and bug-fixes)


slenkar(Posted 2008) [#8]
you probably need a glade plug-in





Brucey(Posted 2008) [#9]
heh. Nice one ;-)


Yahfree(Posted 2008) [#10]
I'm at rev 503 on svn... and it won't update any further... is there a seperate download for this tool?

EDIT: I recompiled the codegen source and it now reads as v1.10 -- problem solved?


Yahfree(Posted 2008) [#11]
also, how do you move gadgets around the window in form builder?