II. GUI Basics
Chapter 8. Prefabricated Widgets
Window Control
Window Widget Window consists of the following widgets: Widget, Drag, Button, Resize.
XML Element Name Structure
- <Widget>
- <Drag>
- <Button/>
- <Button/>
- <Button/>
- </Drag>
- </Widget>
Example
Line 02 Widget-container in which Window will be placed.
Line 03 Widget-container - it is frame for the window. The attributes are discribed in the Widgets Attributes, Chapter 10.
Line 05 Drag widget discribed in Widgets, Chapter 7.<9>. Drag is used as a header in the window. It allows to drag a window,
set a title for a window and place any widget inside, like in this case we have placed three buttons: maximize, minimize and close window.
Line 09 Button widget is used to create a maximize (max) button, which appears only on minimized window like it is displayed in the
image:
setVisible for 'max' button is set 'false', so the 'max' button will appear only when the user clicks on the 'min' button
(setVisible for 'max' button is set 'true' in line 26).
Lines 15-17 When the user clicks on the 'max' button, number of events occur: window is relocated to the coordinates: 10,40; window
size is changed to: 200,200; 'max' button appears invisible while 'min' and 'cls' buttons appears visible.
Line 18 Button wibget is used to create a minimize (min) button.
Lines 24-26 When the user clicks on the 'min' button, the number of events occur: window is relocated to the coordinates: 3,223;
window's size is changed to: 200,23; 'min' button appears invisible, and 'max' button appears visible.
Line 27 Button wibget is used to create a close (cls) button.
Lines 33-34 When the user clicks on the 'cls' button, only one event is triggured: window is placed in location with coordinates
'-200' and '-200' to make it out of visible range.
Window attributes
Window control consists of the following widgets: widget, button, and drag. All basic widget's attributes
apply to these widgets. Basic set of methods that applies to all widgets is described in the Chapter 9 for widgets styles, and Chapter 10
for widgets attributes. For event handling methods please refer to Chapter 12.
Back
Next