MaxGUI suggested changes/upgrade
BlitzMax Forums/MaxGUI Module/MaxGUI suggested changes/upgrade
| ||
I post here some of my changes I'm working on. I know - maybe - SourceForge should be a better place, but I prefer here because is still a BlitzMax related product. I'm working on a Auto Layout (Sizer?) implemented directly in MaxGUI (tested at the moment only on Win32 and FLTK-Win32, only for CreateButton and CreateLabel) Here some images This features requires some changes in Maxgui (maxgui.bmx) ' createwindow.bmx Import MaxGui.Drivers Strict AppTitle = "Automatic Layout Example" Global FLAGS:Int=WINDOW_TITLEBAR| WINDOW_RESIZABLE| WINDOW_STATUS Local window:TGadget = CreateWindow( AppTitle, 100, 100, 320, 240, Null, FLAGS ) If (FLAGS & WINDOW_STATUS) Then SetStatusText( window, "Left aligned~tCenter aligned~tRight aligned" ) EndIf Local P1:TGADGET=CreatePanel(0,0,ClientWidth(window),40,window) Local P2:TGADGET=CreatePanel(0,41,ClientWidth(window),ClientHeight(window)-40,window) InitializeLayout(p1,GADGET_LAYOUT_HORIZONTAL) For Local F:Int=1 To 4 CreateButton(F,,,,25) 'you don't need to specify anymore width, heigth or parent 'they are related to the Layout parent gadget. 'CREATEBUTTON TEXT,X,Y,W,H,GROUP,STYLE 'you can set a 'fixed' height/width of any gadget Next ApplyLayout() 'apply the new gadget layout InitializeLayout(p2) For Local F:Int=1 To 4 CreateButton("This is the button "+F) Next ApplyLayout() Repeat WaitEvent() Print CurrentEvent.ToString() Select EventID() Case EVENT_APPTERMINATE, EVENT_WINDOWCLOSE End End Select Forever Last edited 2010 Last edited 2010 |