An interface to Alias UI editing boxes.
#include <AlEditor.h> class AlEditor AlEditor( void ); ~AlEditor( void ); statusCode create( const char *title ); statusCode deleteEditor( void ); statusCode open( void ); statusCode close( void ); statusCode update( void ); statusCode toggle( void ); statusCode enableItem( ComponentId itemId, boolean enable ); boolean isEnabled( ComponentId itemId ); boolean isOpen( void ); statusCode addSeparator( ComponentDescriptor *descriptor ); statusCode addGrouping( ComponentDescriptor *descriptor ); statusCode addString( ComponentDescriptor *descriptor, const char *value, IdStringCallback callback ); statusCode addInt( ComponentDescriptor *descriptor, int &reference, IntComponentData *data, IdCallback callback = NULL ); statusCode addFloat( ComponentDescriptor *descriptor, float &reference, FloatComponentData *data, IdCallback callback = NULL ); statusCode add3Floats( ComponentDescriptor *descriptor, float (&reference)[3], IdCallback callback = NULL ); statusCode addCheckBox( ComponentDescriptor *descriptor, int &reference, IdCallback callback = NULL ); statusCode addCheckBoxes( ComponentDescriptor *descriptor, int &reference, ComponentDescriptor *descriptor2, int &reference2, IdCallback callback = NULL ); statusCode addButton( ComponentDescriptor *descriptor, IdCallback callback ); statusCode addRadioGroup( ComponentDescriptor *descriptor, AlEditorRadioGroupStyle style, ComponentDescriptor *subComponentDescriptorList, IdCallback callback ); statusCode addPulldownMenu( ComponentDescriptor *descriptor, ComponentDescriptor *subComponentDescriptorList, IdCallback callback ); class ComponentDescriptor ComponentDescriptor( const char *label ); ~ComponentDescriptor( void ); ComponentId id( void ); const char *label( void ); void setLabel( const char *label ); void setId( ComponentId id ); ComponentDescriptor *next( void ); void setNext( ComponentDescriptor *descriptor ); ComponentDescriptorType type( void ); class IntComponentData IntComponentData( int minValue, int maxValue ); ~IntComponentData( void ); int minValue( void ); int maxValue( void ); private: int fMinValue; int fMaxValue; class FloatComponentData FloatComponentData( float minValue, float maxValue ); ~FloatComponentData( void ); float minValue( void ); float maxValue( void );
This class provides an interface to Alias user interface. It allows the building of dynamic editors within a plug-in. Standard operations are supported, such as open, close, toggle, and a basic set of user interface components.
A reference variable is used as a parameter in a number of the user interface components. This reference maintains the state of the component and must be in permanent storage. If you allocate this variable on the stack, program errors will occur. In some cases, a user interface component will contain multiple parts. In this situation, a list of component descriptors will be used to describe this object to the class.
Descriptors are used to describe the components to be created. A label is set in the descriptor object as input. The AlEditor class will dynamically allocate a component ID and set it in the descriptor. Individual components of an editor cannot be deleted. Instead, the entire editor must be de-allocated all at once.
Constructor for a new AlEditor object.
Destruct an AlEditor object.
Create a new editor. First create an editor, then add components to it and then call the open method.
< title - title of the editor
sFailure - the method failed
sAlreadyCreated - the editor is already created
sSuccess - the create worked
De-allocate the storage for the editor once it has been closed. All components will be de-allocated and callbacks will be removed.
sFailure - the method failed
sSuccess - the delete worked
Open/display the editor window. The editor should already be created and have had components added to it.
sFailure - no components added or the method failed
sSuccess - the open worked
Close/remove the editor window. The editor will need to be deleted to properly clean up its storage.
sFailure - the method failed
sSuccess - the close worked
Returns TRUE if the editor is open. FALSE is returned otherwise.
Force the editor window to update/redraw itself. This call should be made if a reference variable is modified by the plug-in's code.
sFailure - the method failed
sSuccess - the update worked
Toggle the editor window. If the window is open, it will be closed. If the window is closed, it will be opened. Toggle can be used to temporarily close the window, if the plug-in will need to re-open it.
sFailure - the method failed
sSuccess - the toggle worked
Enables or disables the component that is described by itemId.
This call will always fail on subcomponents of default style radio group buttons.
< itemId - unique id associated with a component
< enable - TRUE or FALSE
sInvalidArgument - itemId cannot be found
sFailure - method failed
sSuccess - the item's enable state was changed
Returns TRUE if the item described by itemId is enabled. FALSE is returned otherwise.
See the documentation in AlEditor::enableItem() for information on how this method can fail.
< itemId - unique id associated with a component
boolean AlEditor::isEnabled( ComponentId itemId )
Adds a separator to the editor. Separators can be used to provide a logical grouping of components.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label setting is not required in the descriptor parameter class.
sInvalidArgument - descriptor is NULL or descriptor id is already in use
sFailure - method failed
sSuccess - the separator was created
Adds a grouping to the editor. All components added after this call will be placed under this grouping until another grouping is added.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
sInvalidArgument - descriptor or its label is NULL or descriptor id is already in use
sFailure - method failed
sSuccess - the grouping was created
Adds a float component to the editor.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< reference - variable that tracks the state of the float. This variable must be in permanent storage for the life of the plug-in.
< data - currently used to specify min and max ranges for component
< callback - optional function to be called when the float is modified
sInvalidArgument - descriptor or its label is NULL or descriptor id
is already in use or data is NULL
sFailure - method failed
sSuccess - the float was created
Adds an string entry component to the editor.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< callback - optional function to be called when the float is modified
sInvalidArgument - descriptor or its label is NULL or descriptor id is already in use
sFailure - method failed
sSuccess - the float was created
Adds an integer component to the editor.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< reference - variable that tracks the state of the integer. This variable must be in permanent storage for the life of the plug-in.
< data - currently used to specify min and max ranges for component
< callback - optional function to be called when the integer is modified
sInvalidArgument - descriptor or its label is NULL or descriptor id is already in use or data is NULL
sFailure - method failed
sSuccess - the integer was created
Adds a float triple to the editor.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< reference - variable that tracks the state of the float triple. This variable must be in permanent storage for the life of the plug-in.
< callback - optional function to be called when the float triple is modified
sInvalidArgument - descriptor or its label is NULL or descriptor id is already in use
sFailure - method failed
sSuccess - the float triple was created
Adds a check box to the editor.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< reference - variable that tracks the state of the check box.
This variable must be in permanent storage for the life of the plug-in.
< callback - optional function to be called when the check is pressed
sInvalidArgument - descriptor or its label is NULL or descriptor id
is already in use
sFailure - method failed
sSuccess - the check box was created
Adds two check boxes to the editor.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< reference - variable that tracks the state of the check box associated with itemId
This variable must be in permanent storage for the life of the plug-in.
< descriptor2 - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< reference2 - variable that tracks the state of the check box associated with itemId2
This variable must be in permanent storage for the life of the plug-in.
< callback - optional function to be called when one of the checks is pressed
sInvalidArgument - descriptor or its label is NULL or
descriptor2 or its label2 is NULL
sFailure - method failed
sSuccess - the check boxes were created
Adds a button to the bottom of the editor. Note that an editor can either have a pull down menu or buttons on the bottom of the editor. Both cannot be created at the same time.
< descriptor - the component id is dynamically created by the class and returned in this parameter class.
The label of the component is required to be set in the descriptor parameter class.
< callback - function to be called when the button is selected
sInvalidArgument - descriptor or its label is NULL or callback is NULL
sFailure - pulldown menu already created or method failed or the editor
already has a maximum of 4 buttons
sSuccess - the button was created
Adds a radio group selector. Radio group selectors allow a user to pick a single item out of a list.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< style - the style of the radio group
< subComponentDescriptorList - list of descriptors( currently label and an id that is returned by the class ) that describes the subcomponent
< callback - function to be called when the radio group item is selected
sInvalidArgument - descriptor or its label is NULL or
subComponentDescriptorList is NULL or callback is NULL
sFailure - method failed
sSuccess - the radio group was created
Adds a pull down menu to the editor. Pull down menus are added at the top of the editor window. Note that an editor can either have a pull down menu or buttons on the bottom of the editor. Both cannot be created at the same time.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< subComponentDescriptorList - list of descriptors( currently label and an id that is returned by the class ) that describes the subcomponent
< callback - function to be called when a menu item is selected
sInvalidArgument - descriptor or its label is NULL or
subComponentDescriptorList is NULL
or callback is NULL
sFailure - buttons already created or method failed
sSuccess - the pull down menu was created
Adds a pull down menu to the editor. Pull down menus are added at the top of the editor window. Note that an editor can either have a pull down menu or buttons on the bottom of the editor. Both cannot be created at the same time.
< descriptor - the component id is dynamically created by the class and returned in this parameter class. The label of the component is required to be set in the descriptor parameter class.
< subComponentDescriptorList - list of descriptors( currently
label and an id that is returned by the class ) that describes the subcomponent
< callback - function to be called when a menu item is selected
sInvalidArgument - descriptor or its label is NULL or subComponentDescriptorList is NULL or callback is NULL
sFailure - buttons already created or method failed
sSuccess - the pull down menu was created
Constructs a ComponentDescriptor.
The name label of the component descriptor.
Destruct a component descriptor.
Set the label name of the component descriptor.
< label - label name
Set the component identifier of the descriptor. Alias is most cases will automatically assign an identifier to the descriptor.
< id - the component id
Returns the current identifier for the component.
Returns the current label name for the descriptor.
Returns the next component descriptor.
Add a component descriptor to the end of the descriptor list.
< descriptor - the new descriptor to add to the list
Return the type of the descriptor.
Construct a similar Int data class to hold on to minimum and maximum values.
< minValue - the minimum integer to keep track of
< maxValue - the maximum integer to keep track of
Destroy the Int data class
Return the min value.
Return the max value.
Construct a simple Float class that tracks minimum and maximum values.
< minValue - the minimum float value to track
< maxValue - the maximum float value to track
Destroy the float class object.
Return the minimum float value.
Return the maximum float value.