wxCodeGen

BlitzMax Forums/Brucey's Modules/wxCodeGen

Artemis(Posted 2008) [#1]
wxCodeGen issues here.

I've got one thing to say: not all events are "converted" correctly by the wrapper functions. E.g. events which are connected to a TreeCtr should be wxTreeEvent rather than wxCommandEvent.


Brucey(Posted 2008) [#2]
Thanks. Now fixed (revision 248)


Glenn Dodd(Posted 2008) [#3]
wxCodeGen has an "Application Code" tab.
I assume this is where i put the initial:
New MyApp.run()
and
Type MyApp Extends wxApp

but it doesn't take any input.

Is my assumption wrong or is it just a feature that hasn't been added yet?

Cheers
Glenn


Brucey(Posted 2008) [#4]
I was considering having it generate some basic application code that you might use to get started with, but I dunno if that's really very useful at all.


Brucey(Posted 2008) [#5]
Just out !

wxCodeGen does indeed now populate the Application Code textfield with an example application framework.

Doesn't write to any files. Copy and paste (all/some/none of it) to somewhere else.

Mostly there just to help you get your app started :-)


Brucey(Posted 2008) [#6]
Updated to add generation of wxToolBar.


Brucey(Posted 2008) [#7]
I've fixed a problem whereby if you had two (or more) controls using the same callback function for their events, it would generate duplicate Functions - which wasn't so clever.

Now you get one, regardless.

However, it doesn't check to ensure your events are all of the same kind (eg. wxCommandEvent), but this is your warning :-)


Glenn Dodd(Posted 2008) [#8]
is wxStdDialogButtonSizer implemented?


DavidDC(Posted 2008) [#9]
Import wx.wxStdDialogButtonSizer doesn't work for you?


Glenn Dodd(Posted 2008) [#10]
you have mail.


Brucey(Posted 2008) [#11]
Looks like another control needs added :-)


Brucey(Posted 2008) [#12]
Okay... have added wxStdDialogButtonSizer code generation.


Brucey(Posted 2008) [#13]
Added support for wxSplitterWindow :-)

And toolbars will work better on non-frame parents too now.


Also added the ability to use subclass properties in wxFormBuilder to include your custom (extended) control names as part of the generation.
However, it gets complicated when you do this, as BlitzMax doesn't like cyclic Imports, and therefore your application design needs to be quite specific.
But, it is then possible to say, have your own custom Panel, which is included inside your own custom frame. Since not many people are likely to be using this tho, I won't be posting much in the way of an example anytime soon - works for me!


Glenn Dodd(Posted 2008) [#14]
this wouldn't compile till i added Import wx.wxListCtrl
. it was giving wxmouseevent errors.
I am not sure why adding wxlistctrl helped but thought it might be a bug.





Brucey(Posted 2008) [#15]
Ah. I expect it wants to be importing wx.wxMouseEvent then.

:-)


Brucey(Posted 2008) [#16]
Fixed.

Now detects properly when mouse events are used, and adds an appropriate import :-)


Glenn Dodd(Posted 2008) [#17]
another couple of issues email to you, along with a sample file


Glenn Dodd(Posted 2008) [#18]
i don't think wxCodeGen is generating the tooltips for listboxes.
In the absence of a header for the listbox i thought i might use the tooltip instead


Brucey(Posted 2008) [#19]
Seems not. Fixed :-)


Glenn Dodd(Posted 2008) [#20]
you are quick :)


flytom1(Posted 2008) [#21]
Putting the code output from wxCodeGen in my MaxIDE and try to compile it, gives me this error messages back:

DebugBulit is ON
Build GUI App is ON

Building wxMyApp
Compiling:wxMyApp.bmx
flat assembler version 1.66
3 passes, 23668 bytes.
Linking:wxMyApp.debug.exe
C:/Programme/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'
C:/Programme/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'
C:/Programme/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:/wxWidgets-2.8.7/wxMYApp/wxMyApp.debug.exe
Process complete


And this is shown, as DebugBuilt is OFF:

DebugBulit is OFF
Build GUI App is ON


Building wxMyApp
Compiling:wxMyApp.bmx
flat assembler version 1.66
3 passes, 19828 bytes.
Linking:wxMyApp.exe
C:/Programme/BlitzMax/mod/wx.mod/wx.mod/wx.release.win32.x86.a(wxglue.cpp.release.win32.x86.o):wxglue.cpp:(.text+0x2f5): undefined reference to `_wx_wxapp_wxApp__OnInit'
C:/Programme/BlitzMax/mod/wx.mod/wx.mod/wx.release.win32.x86.a(wxglue.cpp.release.win32.x86.o):wxglue.cpp:(.text+0x2884): undefined reference to `_wx_wx_wxAcceleratorTable__getEntry'
C:/Programme/BlitzMax/mod/wx.mod/wx.mod/wx.release.win32.x86.a(wxglue.cpp.release.win32.x86.o):wxglue.cpp:(.text+0x393f): undefined reference to `_wx_wx_wxObject(long double,...)(...)'
C:/Programme/BlitzMax/mod/wx.mod/wx.mod/wx.release.win32.x86.a(wxglue.cpp.release.win32.x86.o):wxglue.cpp:(.text+0x309): undefined reference to `_wx_wxapp_wxApp__OnExit'
C:/Programme/BlitzMax/mod/wx.mod/wx.mod/wx.release.win32.x86.a(wxglue.cpp.release.win32.x86.o):wxglue.cpp:(.text+0x355): undefined reference to `_wx_wxapp_wxAppMain__MainLoop'
C:/Programme/BlitzMax/mod/wx.mod/wx.mod/wx.release.win32.x86.a(wxglue.cpp.release.win32.x86.o):wxglue.cpp:(.text+0xc65): undefined reference to `_wx_wx_TEventHandler_eventCallback'
Build Error: Failed to link D:/wxWidgets-2.8.7/wxMYApp/wxMyApp.exe
Process complete



Has anyone an idea, what went wrong.

OS: WinXP SP2

greez
Tom


plash(Posted 2008) [#22]
@flytom1: I'm getting the exact same errors (though its called cgmain.bmx not wxmyapp.bmx). Did you ever get it to work?

EDIT: Nevermind, got it to work, it was actually wxCodeGen.bmx - didn't notice it before.


flytom1(Posted 2008) [#23]
hey plash,

yes i got it also to work. don't know what was or is still wrong. still can't compile it with debug mode on....

greez
tom


Brucey(Posted 2008) [#24]
undefined reference to `_wx_wxapp_wxApp__OnInit'

It can mean that either Framework wx.wxApp or Import wx.wxApp isn't part of your application.