Request for wxGridBagSizer

BlitzMax Forums/Brucey's Modules/Request for wxGridBagSizer

Vertex(Posted 2008) [#1]
I need wxGridBagSizer and started to program it:


	Function bmx_wxgridbagsizer_create:Byte Ptr(handle:Object, vgap:Int, hgap:Int)
	Function bmx_wxgridbagsizer_add:Byte Ptr(handle:Byte Ptr, window:Byte Ptr, row:Int, col:Int, rowspan:Int, colspan:Int, flag:Int, border:Int)
	Function bmx_wxgridbagsizer_addsizer:Byte Ptr(handle:Byte Ptr, sizer:Byte Ptr, row:Int, col:Int, rowspan:Int, colspan:Int, flag:Int, border:Int)
	Function bmx_wxgridbagsizer_addwh:Byte Ptr(handle:Byte Ptr, width:Int, height:Int, row:Int, col:Int, rowspan:Int, colspan:Int, flag:Int, border:Int)
	Function bmx_wxgridbagsizer_checkforintersection:Int(handle:Byte Ptr, item:Byte Ptr, excludeItem:Byte Ptr)
	Function bmx_wxgridbagsizer_checkforintersection2:Int(handle:Byte Ptr, row:Int, col:Int, rowspan:Int, colspan:Int, excludeItem:Byte Ptr)
	Function bmx_wxgridbagsizer_getcellsize(handle:Byte Ptr, row:Int, col:Int, width:Int Ptr, height:Int Ptr)
	Function bmx_wxgridbagsizer_getemptycellsize(handle:Byte Ptr, width:Int Ptr, height:Int Ptr)
	Function bmx_wxgridbagsizer_getitempositionwindow(handle:Byte Ptr, window:Byte Ptr, row:Int Ptr, col:Int Ptr)
	Function bmx_wxgridbagsizer_getitempositionsizer(handle:Byte Ptr, sizer:Byte Ptr, row:Int Ptr, col:Int Ptr)
	Function bmx_wxgridbagsizer_getitempositionwh(handle:Byte Ptr, width:Int, height:Int, row:Int Ptr, col:Int Ptr)
	Function bmx_wxgridbagsizer_getitemspanwindow(handle:Byte Ptr, window:Byte Ptr, rowspan:Int Ptr, colspan:Int Ptr)
	Function bmx_wxgridbagsizer_getitemspansizer(handle:Byte Ptr, sizer:Byte Ptr, rowspan:Int Ptr, colspan:Int Ptr)
	Function bmx_wxgridbagsizer_getitemspanwh(handle:Byte Ptr, width:Int, height:Int, rowspan:Int Ptr, colspan:Int Ptr)
	Function bmx_gridbagsizer_setemptycellsize(handle:Byte Ptr, width:Int, height:Int)
	Function bmx_wxgridbagsizer_setitempositionwindow:Int(handle:Byte Ptr, window:Byte Ptr, row:Int, col:Int)
	Function bmx_wxgridbagsizer_setitempositionsizer:Int(handle:Byte Ptr, sizer:Byte Ptr, row:Int, col:Int)
	Function bmx_wxgridbagsizer_setitempositionwh:Int(handle:Byte Ptr, width:Int, height:Int, row:Int, col:Int)
	Function bmx_wxgridbagsizer_setitemspanwindow:Int(handle:Byte Ptr, window:Byte Ptr, rowspan:Int, colspan:Int)
	Function bmx_wxgridbagsizer_setitemspansizer:Int(handle:Byte Ptr, sizer:Byte Ptr, rowspan:Int, colspan:Int)
	Function bmx_wxgridbagsizer_setitemspanwh:Int(handle:Byte Ptr, width:Int, height:Int, rowspan:Int, colspan:Int)


But I've get some barriers to implement the c++ code. So I hope for implementation for the next update :)

cu olli


Brucey(Posted 2008) [#2]
Someone's been busy ;-)

Yep. I'll see about finishing it off later. Thanks.


Vertex(Posted 2008) [#3]
sweetie, thank you! :)


Vertex(Posted 2008) [#4]
Yeah, thanks for the new module!

Please take a look on bmx_wxgridbagsizer_create in glue.cpp and change it to:
wxGridBagSizer * bmx_wxgridbagsizer_create(BBObject * maxHandle, int vgap, int hgap) {
	return new MaxGridBagSizer(maxHandle, vgap, hgap);
}

(in original there wars an empty line)

Can you change the default values of rowspan and colspan from 0 to 1 for the methods AddGB, AddGBSizer, AddGBSpacer?

Is there a need for to use the method name CreateGB as Create?

Can you put wxGridBagSizer into wx.wxWindow(becouse wxFlexGridSizer, wxBoxSizer and so on lies in this module)?

So I have a little example to work with this sizer:


It is a calculater layout similar to


cu olli


Brucey(Posted 2008) [#5]
take a look on bmx_wxgridbagsizer_create

Oops. That's what happens when ya do it right before bedtime!

Is there a need for to use the method name CreateGB as Create?

Unfortunately yes, as the parent FlexGridSizer has a different set of parameters, and as you know you can't overload methods in BlitzMax :-(

The other option would be to add ghost params, which are only there to align the two methods properly - but I think that's really messy.

Can you put wxGridBagSizer into wx.wxWindow

I'm trying hard not to add anything more to wx.wxWindow if I can help it. If BlitzMax could handle cyclic imports, there'd only be wxWindow in there :-)
Perhaps I should move those other sizers into their own mods...


Brucey(Posted 2008) [#6]
Now having a look at implementing it in wxCodeGen....


Brucey(Posted 2008) [#7]
... wxCodeGen now building code for wxGridSizer :-)


Vertex(Posted 2008) [#8]
Nice :)