Aztec® Programming Language
Version 1.1 Alpha 2

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

Download Aztec

Search        Contact Us

Times are hard... you're afraid to pay the fee.

So you find yourself somebody... who can do the job for free.

- Walter Becker and Donald Fagen

 

aztec.ui.Edit

public class Edit from<Control>

Base

Window

Control

Edit

aztec.ui.IEdit

public class abstract IEdit from<Base>

Base

IEdit

The Edit class provides a single line text edit control which allows the user to modify the text string. It supports an event to get control when each character is typed, and an event to get control when the "Enter" key is pressed within the Edit control.

 

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

Edit Methods

Edit() Constructor for the Edit class with initial value and optional readonly flag
Edit() Constructor for the Edit class for an empty window that can be edited
AddTextChangedHandler() Registers an event handler for a text changed event using a method reference
AddTextChangedHandler() Registers an event handler for a text changed event using an IEdit reference
AddEnterKeyHandler() Registers an event handler for an enter key event using a method reference
AddEnterKeyHandler() Registers an event handler for an enter key event using an IEdit reference
OnTextChanged() Virtual method to handle TextChanged events - can be overridden
OnEnterKey() Virtual method to handle EnterKey events - can be overridden

IEdit Methods

OnTextChanged() Virtual method to handle TextChanged events
OnEnterKey() Virtual method to handle EnterKey events

Derived Classes

See Also

 


Edit()

public method Edit(Window Parent, int XPos, int YPos, int Width, int Height, string TextString, bool ReadOnly = false)

Parameters

Parent

Parent window for the edit control

XPos

One based X position of control relative to parent

YPos

One based Y position of control relative to parent

Width

Initial width of the control in pixels

Height

Initial height of the control in pixels

TextString

Initial string to be used for the Edit control

ReadOnly

Text cannot be edited if flag is true (false by default)

Return Value

None

Description

Constructor for the Edit class. This implementation supports an initial string value for the Edit window and a ReadOnly flag (default is editable).

 

Edit Class


Edit()

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

Parameters

Parent

Parent window for the edit control

XPos

One based X position of control relative to parent

YPos

One based Y position of control relative to parent

Width

Initial width of the control in pixels

Height

Initial height of the control in pixels

Return Value

None

Description

Constructor for the Edit class. This implementation creates an empty Edit window that can be edited.

 

Edit Class


AddTextChangedHandler()

public method AddTextChangedHandler(TextChangedHandler 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 a "text changed" event occurs within the Edit object. Each time a character is typed into the Edit control, this event will be sent. It provides a copy of the "old string" and the "new string". This event occurs "after the fact", the text has already been modified, but it allows the script to perform validation on the new data. The text can also be restored to "old string" if preferred.

 

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 TextChangedHandler data type represents a method reference specific to a handler for TextChangedEvent. TextChangedHandler is defined as follows:

 

        public type<method<TextChangedEvent,Base>> TextChangedHandler

 

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

 

        public method TextChangedMethod(TextChangedEvent event, Base Extra) { }.

 

Edit Class


AddTextChangedHandler()

public method AddTextChangedHandler(IEdit Interface, Base ExtraObject = null)

Parameters

Interface

Reference to an IEdit 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 IEdit interface object to be executed when a "text changed" event occurs for this Edit control. 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 text is modified in the Edit control, the OnTextChanged() method within the IEdit object will be executed.

 

Edit Class


AddEnterKeyHandler()

public method AddEnterKeyHandler(EnterKeyHandler 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 an "enter key" event occurs within the Edit object. When the Enter key is pressed within the Edit control, this event will be sent.

 

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 EnterKeyHandler data type represents a method reference specific to a handler for EnterKeyEvent. EnterKeyHandler is defined as follows:

 

        public type<method<EnterKeyEvent,Base>> EnterKeyHandler

 

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

 

        public method EnterKeyMethod(EnterKeyEvent event, Base Extra) { }.

 

Edit Class


AddEnterKeyHandler()

public method AddEnterKeyHandler(IEdit Interface, Base ExtraObject = null)

Parameters

Interface

Reference to an IEdit 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 IEdit interface object to be executed when an "enter key" event occurs for this Edit control. 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 Enter key is pressed in the Edit control, the OnEnterKey() method within the IEdit object will be executed.

 

Edit Class


OnTextChanged()

public method virtual OnTextChanged(TextChangedEvent TextEvent, Base ExtraObject)

Parameters

TextEvent

TextChangedEvent object associated with the event

ExtraObject

Optional object sent along from when it was registered

Return Value

NONE

Description

This method is the event handler for TextChangedEvent for the Edit control. It is invoked internally when a character is typed into the Edit control.. This method in turn executes every registered handler with the same argument list which comes in. Both implementations of the Edit.AddTextChangedHandler() method register the event handlers which get invoked by this method.

 

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

 

Edit Class


OnEnterKey()

public method virtual OnEnterKey(EnterKeyEvent KeyEvent, Base ExtraObject)

Parameters

KeyEvent

EnterKeyEvent object associated with the event

ExtraObject

Optional object sent along from when it was registered

Return Value

NONE

Description

This method is the event handler for EnterKeyEvent for the Edit control. It is invoked internally when the Enter Key is pressed in the Edit control.. This method in turn executes every registered handler with the same argument list which comes in. Both implementations of the Edit.AddEnterKeyHandler() method register the event handlers which get invoked by this method.

 

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

 

Edit Class


OnTextChanged()

public method virtual OnTextChanged(TextChangedEvent TextEvent, Base ExtraObject)

Parameters

TextEvent

TextChangedEvent 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 TextChangedEvent within the IEdit interface class. The method which overrides it is invoked for TextChangedEvent within an Edit object when the interface object is registered with the Edit.AddTextChangedHandler() method.

 

IEdit Class


OnEnterKey()

public method virtual OnEnterKey(EnterKeyEvent KeyEvent, Base ExtraObject)

Parameters

KeyEvent

EnterKeyEvent 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 EnterKeyEvent within the IEdit interface class. The method which overrides it is invoked for EnterKeyEvent within an Edit object when the interface object is registered with the Edit.AddEnterKeyHandler() method.

 

IEdit Class

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec