createWindow is used to create an application window. This window will either be a child of wbSystem of another window.
Syntax:
wbWindow & createWindow($class, $name, = null, $caption = null, $xpos = null, $ypos = null, $width = 0, $height = 0, $style = null, $param1 = null)
Contents |
| class | WinBinder window class type class may also be an array of the parameters indexed by their variable name (eg array('class'=>AppWindow,'name'='window...). This array may have an additional element: controls, which is itself an array of arrays. The subarray is an array of the parameters of createControl. (see example for a better understanding of this feature. |
| name | wbObjects name for this window |
| caption | Window title |
| xpos | Horizontal position of the window in pixels |
| ypos | Vertical position of the window in pixes |
| width | Width of the window in pixels |
| height | Width of the window in pixels |
| style | WinBinder style flag |
| param1 | Defines which events the window will throw |
createWindow returns a reference to the newly create wbWindow object.
$window = createWindow(AppWindow, 'theWindow', 'Test Window', 200, 300, 300, 400);
$main = $wb->createWindow(
array(
'class' => ResizableWindow,
'name' => 'main',
'caption' => 'Main Window',
'xpos' => WBC_CENTER,
'ypos' => WBC_CENTER,
'width' => 700,
'height' => 240,
'controls' =>
array(
array(PushButton, 'UpdateButton','Update', 630, 10, 125, 42),
array(Label, 'DriveLabel', 'Drive letter', 275, 13, 125, 42),
array(PushButton, 'AddButton', 'Add to list', 10, 35, 90, 22),
array(PushButton, 'DelButton', 'Delete Selected', 110, 35, 120, 22),
array(EditBox, 'Edit', "", 10, 10, 200, 22, WBC_LEFT),
array(EditBox, 'Drive', "", 250, 10, 22, 22, WBC_LEFT),
array(ListView, 'List', "", 0, 70, 10, 10, WBC_VISIBLE | WBC_ENABLED | WBC_SORT | WBC_LINES ),
array(StatusBar, 'Status')
)
)
);