Panel_Add( | HParent, | | | | X | = | "", | | Y | = | "", | | W | = | "", | | H | = | "", | | Style | = | "", | | Text | = | "" | ) |
|
Adds new panel.
Parameters
HParent | Handle of the parent. |
X..H | Placement. |
Style | White space separated list of panel styles. Additionally, any integer style can be specified among other styles. See SetStyle for details. |
Text | Text 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