Aztec® Programming Language
Version 1.1 Alpha 2

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

Download Aztec

Search        Contact Us

I suppose I could collect my books and get on back to school...

Or steal my daddy's cue and make a living out of playing pool.

- Rod Stewart and Martin Quittenton

 

aztec.ui.Frame

public class Frame from<Window>

Base

Window

Frame

aztec.ui.IFrame

public class abstract IFrame from<Base>

Base

IFrame

The Frame class provides a top-level frame window which contains a single window to populate with UI controls and is surrounded by a standard OS frame with resize capability. The frame can also contain a menu bar and one or more toolbars.

 

The Frame class can be used alone for an application with a single window, or the ParentFrame (a class derived from Frame) can be used to provide an MDI interface which supports multiple child frame windows (ChildFrame) within the parent frame environment.

 

The IFrame class is an abstract interface class which contains a virtual event handler method for each of the events which the Frame class supports.

 

The following diagram provides a complete list of valid child windows for the Frame class (when Frame is used alone). These are the only type of windows that can use a Frame object as a parent.

Valid Child Windows of Frame

Frame Methods

Frame() Constructor for the Frame class
SetIcon() Sets the icon to be displayed in the Frame's title bar
Minimize() Virtual method to programmatically minimize the top-level frame window
Maximize() Virtual method to programmatically maximize the top-level frame window
Restore() Virtual method to programmatically restore the top-level frame window to its "natural" size and position
SplitterPane() Returns the splitter pane for the frame given a row and column
Close() Closes the frame and all child windows/controls
AddWindowCloseHandler() Registers an event handler for closing the top-level window using a method reference
AddWindowCloseHandler() Registers an event handler for closing the top-level window using an IFrame reference
AddWindowResizeHandler() Registers an event handler for resizing the frame window using a method reference
AddWindowResizeHandler() Registers an event handler for resizing the frame window using an IFrame reference
OnWindowClose() Virtual method to handle WindowClose events by default - can be overridden
OnWindowResize() Virtual method to handle WindowResize events by default - can be overridden

IFrame Methods

OnWindowClose() Virtual method to handle WindowClose events
OnWindowResize() Virtual method to handle WindowResize events

Derived Classes

See Also

 


Frame()

public method Frame(Display TargetDisplay, int XPos, int YPos, int Width, int Height, string Title, bool AllowResize = false, int NumRows = 0, int NumColumns = 0)

Parameters

TargetDisplay

The Display object where the top-level frame is displayed (null for local Display)

XPos

One based X position of window relative to parent

YPos

One based Y position of window relative to parent

Width

Initial width of the entire frame window in pixels

Height

Initial height of the entire frame window in pixels

Title

Title for the frame window

AllowResize

Provides user resize capability in the frame (false by default)

NumRows

Number of SplitterPane Rows (default of 0)

NumColumns

Number of SplitterPane Columns (default of 0)

Return Value

None

Description

Constructor for the Frame class. The target Display is passed in (null means local Display) and the parent window is null by definition (since it is a top-level window). Base information such as position and size is also passed in. If the number of rows and columns are one or greater, then the system automatically creates a 2-D array of SplitterPane windows within the ChildFrame. Note that either NumRows or NumColumns must be greater than one, or no splitters will be created, which is the default.

 

If the Display object is connected to a remote UI Display Server process, the frame window will be created on the remote machine. All child windows of the frame will automatically be displayed on the remote machine as well. All UI events from the remote UIs are handled in the local Aztec program.

 

If the XPos and YPos are zero, the window will be centered within the Display.

 

Note that the Frame window is created in a "hidden" state, so the 'Show()' method must be called to display the window. This allows the script to create and initialize the entire UI before actually displaying it on the screen.

 

Frame Class


SetIcon()

public method<bool> SetIcon(BitMap WindowIcon)

Parameters

WindowIcon

Icon image to be attached to the window

Return Value

Returns true if successful and false if not

Description

This method attaches the specified BitMap image to the Frame window. It gets displayed in the Frame's title bar, and also in the operating system task bar, if applicable. Note that the BitMap image must have been created as an Icon, and this method will not work if it is not a valid Icon.

 

A single Icon can have multiple images, and it is recommended that the Icon contain a 16x16 (small) icon and a 32x32 (large) icon.

 

Frame Class


Minimize()

public virtual method Minimize()

Parameters

None

Return Value

None

Description

This virtual method minimizes the top-level frame window at the operating system level.

 

Frame Class


Maximize()

public virtual method Maximize()

Parameters

None

Return Value

None

Description

This virtual method maximizes the top-level frame window at the operating system level. This typically results in the parent frame becoming the size of the entire screen.

 

Frame Class


Restore()

public virtual method Restore()

Parameters

None

Return Value

None

Description

This virtual method restores the top-level parent window at the operating system level to its "natural size" prior to be being minimized and/or maximized.

 

Frame Class


SplitterPane()

public method<SplitterPane> SplitterPane(int Row, int Column)

Parameters

Row

One based Row of the splitter

Column

One based Column of the splitter

Return Value

SplitterPane associated with specified row and column

Description

This method returns the SplitterPane within the frame object specified by the one based row and column. If the row and column are not valid for the frame, or there are no splitters for the frame, the method returns null.

 

Frame Class


Close()

public virtual method Close()

Parameters

None

Return Value

None

Description

This virtual method closes the frame window and all windows/controls that are children of the frame. It can be manually called from within a WindowCloseEvent handler if the logic determines that the Close operation can continue.

 

Once a frame window and its children are closed, the windows are no longer usable. A DisplayException will be fired if the code attempts to use one.

 

Frame Class


AddWindowCloseHandler()

public method AddWindowCloseHandler(WindowCloseHandler Handler, Base ExtraObject = null)

Parameters

Handler

Method reference to be executed when the event occurs

ExtraObject

Optional object which will be sent along to each event handler when it is executed

Return Value

NONE

Description

This method registers a method reference to be executed when the frame window is about to be closed. It is invoked when the user clicks the frame window's close button. An optional object can also be registered which will be sent to each event handler as it is executed.

 

When the Close event occurs for the Frame, the default UI behavior checks to see if there are one or more event handlers registered (using this or the other implementation of this same method). If there are, the handler(s) are queued up for execution. The handler(s) can decide whether or not it is safe to close the window (if document is dirty, etc.), and process accordingly. The event handler(s) must manually close the frame window if it is appropriate based on the script/application logic. If there are no registered event handlers for the Close event, the default behavior will close the window automatically.

 

As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.

 

The WindowCloseHandler data type represents a method reference specific to a handler for WindowCloseEvent. WindowCloseHandler is defined as follows:

 

        public type<method<WindowCloseEvent,Base>> WindowCloseHandler

 

Given this definition, the method handler must be defined with the following signature (name can be anything):

 

        public method WindowCloseMethod(WindowCloseEvent event, Base Extra) { }.

 

Frame Class


AddWindowCloseHandler()

public method AddWindowCloseHandler(IFrame Interface, Base ExtraObject = null)

Parameters

Interface

Reference to an IFrame object

ExtraObject

Optional object which will be sent along to each event handler when it is executed

Return Value

NONE

Description

This method registers an IFrame interface object to be executed when the frame window is closed. An optional object can also be registered which will be sent to each event handler as it is executed. Refer to the description of the other implementation of this same method for more details.

 

As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.

 

When the frame window is closed, the OnWindowClose() method within the IFrame object will be executed.

 

Frame Class


AddWindowResizeHandler()

public method AddWindowResizeHandler(WindowResizeHandler Handler, Base ExtraObject = null)

Parameters

Handler

Method reference to be executed when the event occurs

ExtraObject

Optional object which will be sent along to each event handler when it is executed

Return Value

NONE

Description

This method registers a method reference to be executed when the frame window is resized. An optional object can also be registered which will be sent to each event handler as it is executed.

 

As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.

 

The WindowResizeHandler data type represents a method reference specific to a handler for WindowResizeEvent. WindowResizeHandler is defined as follows:

 

        public type<method<WindowResizeEvent,Base>> WindowResizeHandler

 

Given this definition, the method handler must be defined with the following signature (name can be anything):

 

        public method WindowResizeMethod(WindowResizeEvent event, Base Extra) { }.

 

Frame Class


AddWindowResizeHandler()

public method AddWindowResizeHandler(IFrame Interface, Base ExtraObject = null)

Parameters

Interface

Reference to an IFrame object

ExtraObject

Optional object which will be sent along to each event handler when it is executed

Return Value

NONE

Description

This method registers an IFrame interface object to be executed when the frame window is resized. An optional object can also be registered which will be sent to each event handler as it is executed.

 

As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.

 

When the frame window is closed, the OnWindowResize() method within the IFrame object will be executed.

 

Frame Class


OnWindowClose()

public method virtual OnWindowClose(WindowCloseEvent CloseEvent, Base ExtraObject)

Parameters

CloseEvent

WindowCloseEvent object associated with the event

ExtraObject

Optional object sent along from when it was registered

Return Value

NONE

Description

This method is the default event handler for WindowCloseEvent within the frame. It is invoked internally as a result of the frame window associated with this object being closed. This method in turn executes every registered handler with the same argument list which comes in. Both implementations of the Frame.AddWindowCloseHandler() method register the event handlers which get invoked by this method.

 

If there are no registered event handlers, this method will close the frame automatically.

 

If this method is overridden by a class derived from Frame, it must call this implementation of the method if it needs to execute handlers registered with the Frame.AddWindowCloseHandler() methods.

 

Frame Class


OnWindowResize()

public method virtual OnWindowResize(WindowResizeEvent ResizeEvent, Base ExtraObject)

Parameters

ResizeEvent

WindowResizeEvent object associated with the event

ExtraObject

Optional object sent along from when it was registered

Return Value

NONE

Description

This method is the default event handler for WindowResizeEvent within the frame. It is invoked internally as a result of the frame window associated with this object being resized, maximized, minimized or restored. This method in turn executes every registered handler with the same argument list which comes in. Both implementations of the Frame.AddWindowResizeHandler() method register the event handlers which get invoked by this method.

 

If this method is overridden by a class derived from Frame, it must call this implementation of the method if it needs to execute handlers registered with the Frame.AddWindowResizeHandler() methods.

 

Frame Class


OnWindowClose()

public method virtual OnWindowClose(WindowCloseEvent CloseEvent, Base ExtraObject)

Parameters

CloseEvent

WindowCloseEvent object associated with the event

ExtraObject

Optional object sent along from when it was registered

Return Value

NONE

Description

This virtual method is the event handler for WindowCloseEvent within the IFrame interface class. The method which overrides it is invoked for WindowCloseEvent within a Frame object when the interface object is registered with the Frame.AddWindowCloseHandler() method.

 

IFrame Class


OnWindowResize()

public method virtual OnWindowResize(WindowResizeEvent ResizeEvent, Base ExtraObject)

Parameters

ResizeEvent

WindowResizeEvent object associated with the event

ExtraObject

Optional object sent along from when it was registered

Return Value

NONE

Description

This virtual method is the event handler for WindowResizeEvent within the IFrame interface class. The method which overrides it is invoked for WindowResizeEvent within a Frame object when the interface object is registered with the Frame.AddWindowResizeHandler() method.

 

IFrame Class

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec