Aztec® Programming Language

Version 1.0 Alpha

Copyright © 2010-2013

Cold Spring® Development Group

All Rights Reserved

Download Aztec

Site Help

aztec.display.Frame

public class Frame from<Window>

Base

Window

Frame

aztec.display.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 (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 an event handler method for each of the events which the Frame class supports.

 

The following diagram provides a complete list of valid children for the Frame class (when Frame is used alone).

Frame Children

Frame Methods

Frame() Constructor for the Frame class
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
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
OnWindowClose() Virtual method to handle WindowClose events by default - can be overridden

IFrame Methods

OnWindowClose() Abstract method to handle WindowClose events - must be overridden

Derived Classes

See Also

 


Frame()

public method Frame(Display TargetDisplay, Window Parent, int XPos, int YPos, int Width, int Height, string Title)

Parameters

TargetDisplay

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

Parent

Parent window for the frame (appropriate for 'ChildFrame' and maybe 'Frame') or null

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

Return Value

None

Description

Constructor for the Frame class. The target Display is passed in (null means local Display) and the Parent window is also specified (null means top-level frame). Base information such as position and size is also passed in.

 

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


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 closed. 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 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.

 

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


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 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


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 state" prior to be being minimized and/or maximized.

 

Frame Class


OnWindowClose()

public method abstract 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 abstract 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

 

Copyright © 2010-2013

Cold Spring Development Group

All Rights Reserved

Download Aztec