SplitterGadget()
Syntax
Result = SplitterGadget(#Gadget, x, y, Width, Height, #Gadget1, #Gadget2 [, Flags])Description
Creates a Splitter gadget in the current GadgetList. If #PB_Any is used as '#Gadget' parameter, the new gadget identifier will be returned as 'Result'. It contains two gadgets which are separated by an horizontal or vertical bar and which can be resized automatically. #Gadget will be the numeric identifier returned by EventGadgetID() command.
'Flags' is an optional parameter and can be composed of one of the following constants:#PB_Splitter_Vertical : The gadget is split vertically (instead of horizontally which is the default). #PB_Splitter_Separator : A 3D-looking separator is drawn in the splitter. #PB_Splitter_FirstFixed : When the splitter gadget is resized, the first gadget will keep its size #PB_Splitter_SecondFixed : When the splitter gadget is resized, the second gadget will keep its sizeYou can add a 'mini help' to this gadget by using GadgetToolTip().
The following commands can be used to act on a SplitterGadget:
GetGadgetState(): Get the current splitter position, in pixels.
SetGadgetState(): Change the current splitter position, in pixels.
SetGadgetAttribute(): With one of the following attribute:#PB_Splitter_FirstMinimumSize : Sets the minimum size (in pixels) than the first gadget can have. #PB_Splitter_SecondMinimumSize: Sets the minimum size (in pixels) than the second gadget can have.
Example:If OpenWindow(0, 0, 0, 230, 180, #PB_Window_SystemMenu|#PB_Window_ScreenCentered, "SplitterGadget") If CreateGadgetList(WindowID(0)) #Button1 = 0 #Button2 = 1 #Splitter = 2 ButtonGadget(#Button1,0, 0, 0, 0, "Button 1") ; No need to specify size or coordiantes ButtonGadget(#Button2,0, 0, 0, 0, "Button 2") ; as they will be sized automatically SplitterGadget(#Splitter, 5, 5, 220, 120, #Button1, #Button2, #PB_Splitter_Separator) TextGadget(3, 10, 135, 210, 40, "Above GUI part shows two automatically resizing buttons inside the 230x130 SplitterGadget area.",#PB_Text_Center ) Repeat Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf EndIf
Supported OS
Windows, Linux, MacOS X