The Window Object

Main Characteristics of Window Objects

Appearance on Screen

 

In Zim applications, window objects are visually identical to standard windows in Microsoft Windows;

The visual and behavioral attributes of window objects are fully customizable by the Zim IDE via the Properties Tab;

The Zim language includes an extensive suite of commands for dynamically modifying both the visual and behavioral characteristics of window objects;

The Zim IDE supports the creation of associations among windows, menus, and either forms or displays so that they can be viewed and/or edited as a group;

A window object may be created directly by the developer or by the Zim IDE, in which case it is created automatically when the user creates a form or a display;

Window objects do not own user interface objects. Instead, they act as an interface between the operating system and forms, displays or menus.

Window Object Attributes

Appearance

Attribute Name Default Value Description
Caption Bar True True →  This window will have a caption bar.
False →  This window will not have a caption bar.
Note:
The attributes Maximize, Minimize, Close Button, System Menu, and Movable are also set to False and become unavailable when Caption Bar is set to False;
If this window object has an associated menu object, a caption bar will be required;
Borderless windows cannot have a caption bar.
Caption Text Caption The caption text for this window;
May also be assigned through the Zim language with the command window set.
Clip to Parent False True →  This window will be constrained to be positioned within the dimensions of its parent window;
Note:
If this window object has an associated menu object, it cannot be clipped to its parent.
Close Button True True →  This window's system menu will include a Close menu item;
Note:
When this attribute is set to True, the On Closed Callback Event attribute will be automatically set to True.
Icon - True →  The icon that will appear in this windows's system menu.
Note:
If no icon is selected, the Zim icon will be used by default.
Maximize Button True True →  This window will have a maximize button.
Note:
Dialog windows cannot have maximize or minimize buttons.
Minimize Button True True →  This window will have a minimize button.
Position 0, 0 The position (in pixels) of this window in relation to the top-left corner of the desktop.
X 0 The horizontal position of this window.
Y 0 The vertical position of this window.
Scroll Bars True True →  This window will have scroll bars;
Scroll bars will appear when this window hosts an object (form or display) whose dimensions are larger than its own.
Size 640, 480 The size of this window in pixels.
Width 640 The width of this window.
Height 480 The height of this window.
Status Bar False True → This window will have a status bar;
Note:
The status bar may be used to display error messages and help messages.
System Menu True True →  This window's caption bar will include a system menu;
Note:
The system menu cannot be displayed if the window style is Borderless;
False →  This window's caption bar will not include a system menu;
Note:
The Close attribute is set to False and becomes unavailable since it depends on the presence of a system menu.
Style Resizable This window's border style:
Resizable →  Double line borders enabled for horizontal, vertical and diagonal resizing;
Dialog →  A thick border and a close button, but no other buttons or scroll bars;
Simple →  A hairline border;
Borderless → No visible borders and no caption bar.
Note:
Menu objects cannot be associated with either Dialog, Simple, or Borderless windows;
Menu objects can only be associated only with Resizable windows that:
have a caption bar;
are not clipped to their parent window.

 

Behavior

Attribute Name Default Value Description
Auto Size True True →  This window's dimensions are automatically adjusted to contain the object (form or display) it hosts;
False →  This window's dimensions are fixed and:
If Scroll Bars = True →  Scroll bars are inserted if the object (form or display) is wider or taller than the window;
If Scroll Bars = False →  The window clips the object (form or display) and the object is moved within the window to ensure the form field with input focus is visible.

 

Callback Events

Attribute Name Default Value Description
Got Focus False True → Triggered by the window receiving input focus when the application end-user switches the input focus between windows.
Lost Focus False True →  Triggered by the window losing input focus when the application end-user switches the input focus between windows.
On Close True True →  Triggered by the window being closed by the application end-user.

 

Colors

Attribute Name Default Value Description
Background Color Control The background color of the window in R(ed) G(reen) B(lue) values.
Foreground Color 0,0,0 The foreground color of the window in R(ed) G(reen) B(lue) values.

 

Properties

Attribute Name Default Value Description
Availabilty Available Available →  The application end-user will be able to interact with this window;
Unavailable →  The application end-user will not be able to interact with this window and the window will appear grayed-out;
Modal True True →  The application end-user will not be able to switch input focus away from this window;
Movable True True →  The application end-user will be able to move this window by:
     Dragging the window's caption bar;
     Using the Move menu item, in the window's system menu;
Note: Only windows that have a Caption Bar can be moved.
Topmost Setting Not Topmost The relative position of this window in relation to other windows:
Not Topmost →  This window will only appear on top of all other application windows except other System Topmost and Application Topmost windows when it has the input focus;
Application Topmost →  This window will appear on top of all other application windows except other System Topmost and Application Topmost windows;
System Topmost →  This window will appear on top of all other windows except other System Topmost windows.

 

Style

Attribute Name Default Value Description
Font Microsoft Sans Serif, 8pt The font in which text will be displayed inside this form field.
Name Microsoft Sans Serif The system name of the selected font.
Size 8 The size of the font in units. (Point is the default unit);
Unit Point The unit of measurement for the font;
Defined in the window object that displays the parent form of this form field.
GdiCharSet 1 True →  The text inside this form field will appear in italic.
GdiVerticalFont False True →  The text inside this form field will appear in italic.
Bold False True →  The text inside this form field will appear in bold.
Italic False True →  The text inside this form field will appear in italic.
Strikeout False True →  The text inside this form field will appear with a line across.
Underline False True →  The text inside this form field will appear underlined.