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.
statusCode AlEditor::enableItem( ComponentId itemId, boolean enable )
Returns TRUE if the item described by itemId is enabled. FALSE is returned otherwise.
statusCode AlEditor::addSeparator( ComponentDescriptor *descriptor )
Adds a grouping to the editor. All components added after this call will be placed under this grouping until another grouping is added.
statusCode AlEditor::addGrouping( ComponentDescriptor *descriptor )
< 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
statusCode AlEditor::addFloat( ComponentDescriptor *descriptor, float &value, FloatComponentData *data, IdCallback callback )
statusCode AlEditor::addString( ComponentDescriptor *descriptor, const char *value, IdStringCallback callback )
< 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
statusCode AlEditor::addInt( ComponentDescriptor *descriptor, int &value, IntComponentData *data, IdCallback callback )
< 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
statusCode AlEditor::add3Floats( ComponentDescriptor *descriptor, float (&reference)[3], IdCallback callback )
< 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
statusCode AlEditor::addCheckBox( ComponentDescriptor *descriptor, int &reference, IdCallback callback )
< 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
statusCode AlEditor::addCheckBoxes( ComponentDescriptor *descriptor, int &reference, ComponentDescriptor *descriptor2, int &reference2, IdCallback callback )
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.
statusCode AlEditor::addButton( ComponentDescriptor *descriptor, IdCallback callback )
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
statusCode AlEditor::addRadioGroup( ComponentDescriptor *descriptor, AlEditorRadioGroupStyle style, ComponentDescriptor *subComponentDescriptorList, IdCallback callback )
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
statusCode AlEditor::addPulldownMenu( ComponentDescriptor *descriptor, ComponentDescriptor *subComponentDescriptorList, IdCallback callback )
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