Huge update (or hudge work...!) - full automatic resizing!
This is too cool, just check the lock states (left, right, top, bottom), and all is done for you.
Try the code below to see what the end result (the code doesn't look especially nice, but is fully generated by the FD and can be opened back).
There's probably quite some bugs in the code generation/loading, but it's just brilliant to be able to do that kind of stuff with a few clicks instead of long line of codes - and with no external lib
Code: Select all
Global Window_0
Global Button_0, Button_0_1, Tree_0, Panel_0
Declare ResizeGadgetsWindow_0()
Procedure InitWindow_0()
Window_0 = OpenWindow(#PB_Any, 0, 0, 600, 400, "", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
Button_0 = ButtonGadget(#PB_Any, WindowWidth(Window_0) - 100, WindowHeight(Window_0) - 30, 90, 25, "Save")
Button_0_1 = ButtonGadget(#PB_Any, WindowWidth(Window_0) - 200, WindowHeight(Window_0) - 30, 90, 25, "Cancel")
Tree_0 = TreeGadget(#PB_Any, 10, 10, 210, WindowHeight(Window_0) - 50)
Panel_0 = PanelGadget(#PB_Any, 230, 10, WindowWidth(Window_0) - 240, WindowHeight(Window_0) - 50)
AddGadgetItem(Panel_0, -1, "Tab 1")
CloseGadgetList()
EndProcedure
Procedure ResizeGadgetsWindow_0()
ResizeGadget(Button_0, WindowWidth(Window_0) - 100, WindowHeight(Window_0) - 30, 90, 25)
ResizeGadget(Button_0_1, WindowWidth(Window_0) - 200, WindowHeight(Window_0) - 30, 90, 25)
ResizeGadget(Tree_0, 10, 10, 210, WindowHeight(Window_0) - 50)
ResizeGadget(Panel_0, 230, 10, WindowWidth(Window_0) - 240, WindowHeight(Window_0) - 50)
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
EndProcedure
InitWindow_0()
Repeat
event = WaitWindowEvent()
If event = #PB_Event_SizeWindow
ResizeGadgetsWindow_0()
EndIf
Until event = #PB_Event_CloseWindow