Aztec® Programming Language
Version 1.1 Alpha 2

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

Download Aztec

Search        Contact Us

What did I do... What did I say...
To turn your angel eyes my way?

- John Hiatt and Fred Koller

 

aztec.ui.SelectItem

public abstract class SelectItem from<Window>

Base

Window

SelectItem

aztec.ui.ISelectItem

public abstract class ISelectItem from<Base>

Base

ISelectItem

SelectItem is an abstract class which provides a simple framework for handling menu items and toolbar items. Menus and toolbars are handled in a similar way. Each contains items which can be "selected" in order to accomplish a task (SelectItem class). The MenuItem and ToolBarItem classes are both derived from this abstract class, allowing the same event handlers to be used for menus and toolbars.

 

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

SelectItem Methods

SelectItem() Constructor for the SelectItem class
Check() Abstract method to check the item
Gray() Abstract method to gray out the item
IsChecked() Abstract method to return true if the item is checked
IsGrayed() Abstract method to return true if the item is grayed out
SetPosition() Abstract method to set the one based position of the item
Position() Abstract method to get the one based position of the item
AddItemSelectHandler() Abstract method to register an event handler for an item select event using a method reference
AddItemSelectHandler() Abstract register to an event handler for an item select event using an ISelectItem reference
OnItemSelect() Abstract method to handle ItemSelect events - must be overridden

ISelectItem Methods

OnItemSelect() Virtual method to handle ItemSelect events

Derived Classes

See Also

 


SelectItem()

public method SelectItem(Window Parent, string Label, BitMap ItemIcon = null, bool AutoCheck = false, int Index = 0)

Parameters

Parent

Parent window of the select item

Label

Text to be entered in the select item

ItemIcon

Icon to be displayed in the select item (can be null)

AutoCheck

Handle check processing automatically in the select item

Index

One based index for location of new item (0 means append)

Return Value

None

Description

Constructor for the SelectItem class. The parent must be specified, and it must be one of several valid window types. The derived classes (MenuItem and ToolBarItem) specify which window types are valid as a parent.

 

SelectItem Class


Check()

public abstract method Check(bool CheckState = true)

Parameters

CheckState

Checked if true and not checked if false

Return Value

None

Description

This method is used to check the item or uncheck the item. If CheckState is true, the item becomes checked, and if false, it becomes unchecked.

 

SelectItem Class


Gray()

public abstract method Gray()

Parameters

None

Return Value

None

Description

This method grays out and disables the item, which makes the item NOT selectable.

 

SelectItem Class


IsChecked()

public abstract method<bool> IsChecked()

Parameters

None

Return Value

True if checked

Description

This method returns true if the item is currently checked and false if not checked.

 

SelectItem Class


IsGrayed()

public abstract method<bool> IsGrayed()

Parameters

None

Return Value

True if checked

Description

This method returns true if the item is currently grayed out (grayed and NOT selectable) and false if not grayed out.

 

SelectItem Class


SetPosition()

public abstract method<int> SetPosition(int Position)

Parameters

Position

One based position to put this item in

Return Value

Old one based position

Description

This abstract method sets the one based position for the item within the select bar that it's attached to. Each derived class needs to override and handle it internally for the item list that it maintains.

 

SelectItem Class


Position()

public abstract method<int> Position()

Parameters

None

Return Value

One based position

Description

This abstract method returns the one based position of this item within the select bar that it's attached to.

 

SelectItem Class


AddItemSelectHandler()

public abstract method AddItemSelectHandler(ItemSelectHandler 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 abstract method registers a method reference to be executed when an "item select" event occurs within the select item. 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 ItemSelectHandler data type represents a method reference specific to a handler for ItemSelectEvent. ItemSelectHandler is defined as follows:

 

        public type<method<ItemSelectEvent,Base>> ItemSelectHandler

 

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

 

        public method ItemSelectMethod(ItemSelectEvent event, Base Extra) { }.

 

SelectItem Class


AddItemSelectHandler()

public abstract method AddItemSelectHandler(ISelectItem Interface, Base ExtraObject = null)

Parameters

Interface

Reference to an ISelectItem object

ExtraObject

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

Return Value

NONE

Description

This abstract method registers an ISelectItem interface object to be executed when an "item select" event occurs with this item. 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 item is selected, the OnItemSelect() method within the ISelectItem object will be executed.

 

SelectItem Class


OnItemSelect()

public abstract method OnItemSelect(ItemSelectEvent SelectEvent, Base ExtraObject)

Parameters

SelectEvent

ItemSelectEvent 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 ItemSelectEvent within the select item. It is invoked internally when the item is selected by the user. This method in turn executes every registered handler with the same argument list which comes in. Both implementations of the SelectItem.AddItemSelectHandler() method register the event handlers which get invoked by this method.

 

This abstract method is overridden by each class derived from SelectItem.

 

SelectItem Class


OnItemSelect()

public virtual method OnItemSelect(ItemSelectEvent SelectEvent, Base ExtraObject)

Parameters

SelectEvent

ItemSelectEvent 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 ItemSelectEvent within the ISelectItem interface class. The method which overrides it is invoked for ItemSelectEvent within a SelectItem object when the interface object is registered with the SelectItem.AddItemSelectHandler() method.

 

ISelectItem Class

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec