Aztec® Programming Language
Version 1.1 Alpha 2

Copyright © 2010-2017, Aztec Development Group, All Rights Reserved

Download Aztec

Search        Contact Us

I know it's not much... but it's the best I can do.

My gift is my song, and... this one's for you.

- Bernie Taupin and Elton John

 

aztec.ui.Window

public abstract class Window from<Base>

Base

Window

Window is an abstract class which provides the framework for all other UI window classes, such as Frame, Dialog, Control, Button and Edit. It provides a useful set of methods for manipulating the window, such as color, position, size, font and state (show/hide and enable/disable).

 

Windows are created with a parent/child relationship, and the X and Y position of every window is relative to its parent. Every Aztec window is created using a parent window, and there are strict rules defining which window types can be used as a parent for each window type. If an invalid window type is passed in as the parent when creating any type of Aztec window, the window is not created and a WindowParentException is fired. The description for each window class defines the allowable "child" window types for that class. The Frame, ParentFrame and Dialog classes have no parent.

 

All UI event handling is defined and handled in a consistent manner, conforming to standard Aztec event handling rules.

 

All UI classes can be safely used across multiple Aztec VM threads. The actual UI processing occurs within a single internal UI display server thread, and all VM threads communicate internally with that UI display server.

 

Window Methods

Window() Constructor for the Window class
XPos() Returns the X position of the window
YPos() Returns the Y position of the window
Width() Returns the usable width of the window in pixels
Height() Returns the usable height of the window in pixels
TotalWidth() Returns the total width of the window in pixels
TotalHeight() Returns the total height of the window in pixels
SetPos() Sets a new X, Y position for the window
SetSize() Sets a new size (width and height) for the window
SetFont() Sets a new Font object to be associated with window
SetFocus() Sets the keyboard focus to this window
SetForeColor() Sets the current foreground color
SetBackColor() Sets the current background color
WindowText() Returns the current text associated with the window
SetWindowText() Sets the current text associated with the window
Parent() Returns the parent window (null for top-level window)
GetChildren() Returns an array of Window objects that contains children of this window
WindowId() Returns window Id for this window (automatic or manual)
SetWindowId() Sets the window id manually for this window
Hide() Hides the window from the display
Show() Shows the window and draws it onto the display
Enable() Enables the window and allows U/I event handling
Disable() Disables U/I interaction and event handling within the window
IsEnabled() Returns true if the window is enabled
IsDisabled() Returns true if the window is disabled

Derived Classes

See Also

 


Window()

public method Window(int XPos, int YPos, int Width, int Height)

Parameters

XPos

One based X position of window relative to parent

YPos

One based Y position of window relative to parent

Return Value

None

Description

Constructor for the Window class. The base information such as position and size is passed in, but can be changed.

 

Window Class


XPos()

public method<int> XPos(bool Relative = true)

Parameters

Relative

Returns position relative to parent if true, relative to frame/dialog if false

Return Value

One based X position relative to parent or dialog/frame

Description

This method returns the one based X position of the window. If the "Relative" flag is true, the position is relative to its immediate parent in pixels (horizontal direction). If the "Relative" flag is false, the position is relative to the top level frame or dialog that contains the window. If the window in question is a top level frame or dialog, the position will be in absolute screen coordinates.

 

Window Class


YPos()

public method<int> YPos(bool Relative = true)

Parameters

Relative

Returns position relative to parent if true, relative to frame/dialog if false

Return Value

One based Y position relative to parent or dialog/frame

Description

This method returns the one based Y position of the window. If the "Relative" flag is true, the position is relative to its immediate parent in pixels (vertical direction). If the "Relative" flag is false, the position is relative to the top level frame or dialog that contains the window. If the window in question is a top level frame or dialog, the position will be in absolute screen coordinates.

 

Window Class


Width()

public method<int> Width()

Parameters

None

Return Value

Width of the window

Description

This method returns the usable width of the window in pixels (horizontal direction). The "usable" portion of a window is also sometimes known as the "client" area of the window. For a Frame or ChildFrame window, it is the area of the window where you can place control windows, etc. This width value does not include the frame or toolbars, if applicable. For most control windows, such as Button and Edit, the Width and TotalWidth are the same, but for certain controls, such as the Canvas and GroupBox, the total width and height will be slightly larger, since there is a small frame around the portion of the window where drawing can occur (Canvas) or where controls can be placed (GroupBox).

 

Window Class


Height()

public method<int> Height()

Parameters

None

Return Value

Height of the window

Description

This method returns the usable height of the window in pixels (vertical direction). The "usable" portion of a window is also sometimes known as the "client" area of the window. For a Frame or ChildFrame window, it is the area of the window where you can place control windows, etc. This height value does not include the frame, title bar, menu or toolbars, if applicable. For most control windows, such as Button and Edit, the Height and TotalHeight are the same, but for certain controls, such as the Canvas and GroupBox, the total width and height will be slightly larger, since there is a small frame around the portion of the window where drawing can occur (Canvas) or where controls can be placed (GroupBox).

 

Window Class


TotalWidth()

public method<int> TotalWidth()

Parameters

None

Return Value

Total Width of the window, including frame

Description

This method returns the total width of the window in pixels (horizontal direction). This includes all frames, menus, toolbars, in addition to the "usable" portion of a window. For most controls, this value will be identical to Width.

 

Window Class


TotalHeight()

public method<int> TotalHeight()

Parameters

None

Return Value

Total Height of the window, including frame

Description

This method returns the total height of the window in pixels (vertical direction). This includes all frames, menus, toolbars, in addition to the "usable" portion of a window. For most controls, this value will be identical to Height.

 

Window Class


SetPos()

public method SetPos(int XPos, int YPos)

Parameters

XPos

New X position of window (one based)

YPos

New Y position of window (one based)

Return Value

None

Description

This method sets a new position for the window relative to its parent (one based) and redraws the window at its new location.

 

Window Class


SetSize()

public method SetSize(int TotalWidth, int TotalHeight)

Parameters

TotalWidth

New width of window (one based), including frame, etc.

TotalHeight

New height of window (one based), including frame, etc.

Return Value

None

Description

This method sets a new size for the window given the total width and total height and redraws the window. The total width and height specified include any applicable frames, menus, toolbars, etc.

 

Window Class


SetFont()

public method SetFont(Font NewFont)

Parameters

NewFont

New Font for the window

Return Value

None

Description

This method sets a new font to be associated with the window.

 

Window Class


SetFocus()

public method SetFocus()

Parameters

None

Return Value

None

Description

This method sets the keyboard focus to the specified window. It is only supported by controls that support keyboard input, which are currently the Edit, Editor, Button, and ComboBox controls. Nothing happens if called for any other type of window.

 

Window Class


SetForeColor()

public method SetForeColor(Color ForeColor)

Parameters

ForeColor

New foreground Color for the window

Return Value

None

Description

This method sets a new foreground color to be associated with the window. Note that this method is currently supported for Canvas and ProgressBar classes only.

 

Window Class


SetBackColor()

public method SetBackColor(Color BackColor)

Parameters

BackColor

New background Color for the window

Return Value

None

Description

This method sets a new background color to be associated with the window. Note that this method is currently supported for Canvas and ProgressBar classes only.

 

Window Class


WindowText()

public method<string> WindowText()

Parameters

None

Return Value

Text associated with the window

Description

This method returns the text currently associated with the window. How this value is used depends on the window. For a Frame, it is the title of the window. For a button or an edit control, it is the text displayed in the control, etc.

 

Window Class


SetWindowText()

public method SetWindowText(string Text)

Parameters

Text

New text for the window

Return Value

None

Description

This method sets the text to be associated with the window. How this value is used depends on the window. For a Frame, it is the title of the window. For a button or an edit control, it is the text displayed in the control, etc.

 

Window Class


Parent()

public method<Window> Parent()

Parameters

None

Return Value

Parent window - can be null

Description

This method returns the reference to this window's parent window. This method will return null if there is no Parent (means we're a top-level frame or dialog window).

 

Window Class


GetChildren()

public method<Window[]> GetChildren()

Parameters

None

Return Value

Array of Window objects - can be null

Description

This method returns an array of Window objects which contains each of the child windows that are tied to this window object. If there are no child windows, the method returns null.

 

Window Class


WindowId()

public method<int> WindowId()

Parameters

None

Return Value

Window Id for this window

Description

This method returns the window Id associated with this window. The framework automatically assigns a unique internal number to each window (starting at 1000001), but it can be overridden by calling SetWindowId(), in which case any uniqueness requirements would need to be handled by the script/application.

 

Window Class


SetWindowId()

public method SetWindowId(int WindowId)

Parameters

WindowId

New window Id for the window

Return Value

None

Description

This method sets the new window Id to be associated with the window. The framework automatically assigns a unique internal number to each window, and is overridden by manually calling this method. Any uniqueness requirements need to be handled manually as well.

 

Window Class


Hide()

public method Hide()

Parameters

None

Return Value

None

Description

This method hides the window from the screen and recursively hides all child windows as well.

 

Window Class


Show()

public method Show()

Parameters

None

Return Value

None

Description

This method shows the window on the screen and recursively shows all child windows as well (unless a child was manually hidden previously).

 

Window Class


Enable()

public method Enable()

Parameters

None

Return Value

None

Description

This method enables the window and if applicable, makes it available for user input. All event handling is also turned on for the window. If the window has child windows that have not been manually hidden or disabled, they will also be enabled as a result of this operation.

.

Window Class


Disable()

public method Disable()

Parameters

None

Return Value

None

Description

This method disables the window and if applicable, disables all user input and all event handling for the window. Some window types such as Button classes also "gray out" the item when disabled. Others, such as SelectItem (MenuItem and ToolBarItem) do not gray out the window when disabled, but they provide a separate method specifically to gray it out (SelectItem.Gray()). If the window has child windows that have not been manually hidden or are already disabled, they will also be disabled as a result of this operation. However, all child windows that are disabled as a result of this operation are still marked as "enabled" internally, and if the Enable() operation is done on the parent in the future, these child windows will be restored normally.

.

Window Class


IsEnabled()

public virtual method<bool> IsEnabled()

Parameters

None

Return Value

True if checked

Description

This method returns true if the item is currently enabled (normal text and provides UI interaction) and false if not enabled. This method returns the setting based on a manual call to Enable/Disable, not necessarily the current UI appearance. For instance, if a child control is currently enabled, and its parent is then manually disabled (using the Disable() method), then all children underneath the parent will also be disabled within the UI (appearance). However, internally, the control is still considered "enabled", and if the parent is manually enabled in the future, all child controls will automatically be enabled again (based on this internal setting). This method returns the current value of that internal flag as opposed to its actual appearance in the UI.

 

Window Class


IsDisabled()

public virtual method<bool> IsDisabled()

Parameters

None

Return Value

True if checked

Description

This method returns true if the window is currently disabled (no UI interaction) and false if not enabled. This method returns the setting based on a manual call to Enable/Disable, not necessarily the current UI appearance. For instance, if a child control is currently enabled, and its parent is then manually disabled (using the Disable() method), then all children underneath the parent will also be disabled within the UI (appearance). However, internally, the control is still considered "enabled", and if the parent is manually enabled in the future, all child controls will automatically be enabled again (based on this internal setting). This method returns the current value of that internal flag as opposed to its actual appearance in the UI.

 

Window Class

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec