Panel

Control container.

Summary
PanelControl container.
AddAdds new panel.
SetStyleSet the panel style.
About

Add

Panel_Add(HParent,  
X = "",
Y = "",
W = "",
H = "",
Style = "",
Text = "")

Adds new panel.

Parameters

HParentHandle of the parent.
X..HPlacement.
StyleWhite space separated list of panel styles.  Additionally, any integer style can be specified among other styles.  See SetStyle for details.
TextText to display.

Returns

Handle of the control or error messge if control couldn’t be created.

Remarks

If you Attach Panel control to its parent, Panel will disable Attach for itself when it becomes explicitelly hidden and enable itself when you show it latter.  When Panel doesn’t attach, its parent will skip it when performing repositioning of the controls.  If Panel itself is attaching its own children, this means that it will also stop attaching them as its own size wont change.  However, its children won’t be disabled so if you programmatically change the the placement of such Panel, it will still reposition its controls.  Hence, if you create Panel with HIDDEN state and used Attach, you should also prefix attach defintion string with “-” to set up that Panel initialy disabled.  If you don’t do that Panel will do attaching in hidden state initially (as it was never hidden explicitelly).

If you have deep hierarchy of Panels(>10), script may block or show some undesired behavior.  Using #MaxThreads, 255 can sometimes help.

Depending on control you want to host inside the Panel, you may need to redifine which messages Panel redirects to the main window.  This is hardcoded in Panel_wndProc function.  For instance it may look like this:

redirect = "32,78,273,276,277"  ;WM_SETCURSOR=32, WM_COMMAND=78, WM_NOTIFY=273, WM_HSCROLL=276, WM_VSCROLL=277

SetStyle

Panel_SetStyle( Hwnd,  
 Style,  
ByRef hStyle = "",
ByRef hExStyle = "")

Set the panel style.

Parameters

HwndHandle of the parent.  If omitted, function returns hStyle in p3 and hExStyle in p4.
StyleWhite space separated list of styles to set.  HIDDEN DISABLED VSCROLL HSCROLL SCROLL RESIZE BORDER FRAME SUNKEN STATIC.  Any integer is accepted as style.  Invalid styles are skipped.
p3, p4If Hwnd is omitted, result is returned in this output variables.

Remarks

Scroll styles require Scroller module.  If you are adding big number of controls into the scrollable Panel, you can greatly improve performance by setting those flags after all control are added.  Otherwise, after each new control is added to the Panel it will readjust the scrollbars.  Panel will update scrollbars if you use this function to set any of the scroll styles and after resizing.  If you don’t have any of that, you need to call Scroller_UpdateBars to set up scrollbars initially.

You can’t use border and scroll styles together.  You can’t use 2 scroll types together.  The combination of “vscroll hscroll” should be specified just as “scroll”.

About

Panel_Add(HParent,  
X = "",
Y = "",
W = "",
H = "",
Style = "",
Text = "")
Adds new panel.
Panel_SetStyle( Hwnd,  
 Style,  
ByRef hStyle = "",
ByRef hExStyle = "")
Set the panel style.
Attach(hCtrl = "",
aDef = "")
Determines how a control is resized with its parent.
Makes window scrollable.
Close