Splitter control.
(see splitter.png)
Splitter is control that is created between controls that need to have dynamic separation. To use it, you first need to create the splitter (Add), then you have to activate it when all controls that it separates are created (Set). You can set splitter position with SetPos and obtain it with GetPos. You can also limit splitter movement with <Limit> function if you don’t want controls it separates to be set completely invisible by the user.
Win 1.24
Splitter_Add( Opt = "", Text = "", Handler = "" )
Add new Splitter.
Opt | Splitter Gui options. Splitter is subclassed Text control (Static), so it accepts any Text options. plus one the following: blackframe, blackrect, grayframe, grayrect, whiteframe, whiterect, sunken. |
Text | Text to set. |
Handler | Notification function. See bellow. |
OnSplitter(Hwnd, Event, Pos)
P | Triggered when user changes the position by dragging the splitter with mouse. |
D | User doubleclicked the splitter. |
R | User right clicked the splitter. |
Splitter handle.
This function adds a new splitter on the given position. User is responsible for correct position of the splitter. Splitter is inactive until you call Set function. When setting dimension of the splitter (width or height) use even numbers.
Splitter_Add2Form( HParent, Txt, Opt )
Add Splitter into the form.
handler | Splitter handler name. |
extra | Extra parameters are transmited to Add Opt parameter. |
Function is required by the Forms framework.
Splitter_Set( HSep, Def, Pos = "", Limit = 0.0 )
Initiates separation of controls.
HSep | Splitter handle. |
Def | Splitter definition or words “off” or “on”. The syntax of splitter definition is given bellow. |
Pos | Position of the splitter to apply upon initialization (optional). |
Limit | Decimal, sets start and end limits for splitter movement. The minimum and maximum splitter value will be adjusted by this value. For instance, .100 means that maximum value will be less by 100. |
c11 c12 c13 ... Type c21 c22 c23 ...
c1n | Controls left or top of the splitter. |
Type | Splitter type: “ | “ vertical or “ - “ horizontal. |
c2n | Controls right or bottom of the splitter. |
Splitter_SetPos( HSep, Pos, bInternal = false )
Set splitter position.
HSep | Splitter handle. |
Pos | Position to set. Position is the client x/y coordinate of the splitter control. If followed by the sign %, position is set using procentage of splitter range. If Pos is empty, function returns without any action. |
Due to the rounding, if you set position using procentage, actuall position may be slightly different. You can find out what is exact position set if you use GetPos with Flag set to “%”.
w := 500, h := 600, sep := 5 w1 := w//3, w2 := w-w1 , h1 := h // 2, h2 := h // 3 Gui, Margin, 0, 0 Gui, Add, Edit, HWNDc11 w%w1% h%h1% Gui, Add, Edit, HWNDc12 w%w1% h%h1% hSepV := Splitter_Add( "x+0 y0 h" h " w" sep ) Gui, Add, Monthcal, HWNDc21 w%w2% h%h2% x+0 Gui, Add, ListView, HWNDc22 w%w2% h%h2%, c1|c2|c3 Gui, Add, ListBox, HWNDc23 w%w2% h%h2% , 1|2|3 sdef = %c11% %c12% | %c21% %c22% %c23% ;vertical splitter. Splitter_Set( hSepV, sdef ) Gui, show, w%w% h%h% return
Add new Splitter.
Splitter_Add( Opt = "", Text = "", Handler = "" )
Add Splitter into the form.
Splitter_Add2Form( HParent, Txt, Opt )
Returns maximum position of the splitter.
Splitter_GetMax( HSep )
Get position of the splitter.
Splitter_GetPos( HSep, Flag = "" )
Get size of the splitter.
Splitter_GetSize( HSep )
Initiates separation of controls.
Splitter_Set( HSep, Def, Pos = "", Limit = 0.0 )
Set splitter position.
Splitter_SetPos( HSep, Pos, bInternal = false )
Determines how a control is resized with its parent.
Attach( hCtrl = "", aDef = "" )