Class for creating the OpenAlias interface to Alias
#include <AlFunctionHandle.h>
class AlFunctionHandle
AlFunctionHandle();
virtual ~AlFunctionHandle();
statusCode create( const char*, const char* );
statusCode create( const char*, AlFunction * );
AlFunctionHandle& operator =( const AlFunctionHandle& );
int operator !() const;
statusCode setAttributeString( const char * );
statusCode setOptionBox( const char *, const char *, const char * = NULL );
statusCode setIconPath( const char* );
statusCode setHelpFile( const char* );
statusCode addToMenu( const char * );
statusCode appendToMenu( const char * );
statusCode installOnSubmenu( const char * );
statusCode removeFromMenu();
statusCode deleteObject();
class AlSubmenu
AlSubmenu();
~AlSubmenu();
statusCode createSubmenu( const char *, const char * );
statusCode removeSubmenu( );
This class provides a means to interface the OpenAlias application to the Alias user interface. An AlFunction class or one of its derivatives (AlMomentaryFunction, AlContinuousFunction) is required by the create method. Note that the string name of an Al*Function could also be specified in the create() method.
The class AlSubmenu is used for creating submenus in Alias. Create a new submenu on an existing Alias menu and then use the AlFunctionHandle::installOnSubmenu() method to add a new item.
Note: avoid attaching submenu items to submenus created by other plug-ins since your submenu item will disappear when the other plug-in is unloaded.
statusCode AlFunctionHandle::create( const char * popupLabel, const char * command )
statusCode AlFunctionHandle::create( const char * popupLabel, AlFunction *func )
statusCode AlFunctionHandle::setAttributeString( const char * str )
statusCode AlFunctionHandle::setOptionBox( const char * schemeFileName, const char * editorName, const char * schemeFileNamePrefix )
Sets the option box for the plug-in. If the plug-in has no option box, then do not call this method. This method will fail if the scheme file described by the name and prefix does not exist. Normally, the ’schemeFileName’ is the name of the file which defines the option box.
The string formed by concatenating ’schemeFileName’ to ’schemeFileNamePrefix’ will be used as the filename that will be loaded, that is, the actual scheme file that is loaded will be equivalent to schemeFileNamePrefix/schemeFileName.
statusCode AlFunctionHandle::installOnMenu( const char * menuname, boolean topOfMenu )
statusCode AlFunctionHandle::installOnSubmenu( const char *subMenuName )
statusCode AlFunctionHandle::setIconPath( const char* path )
Sets the pathname to load the icon files from. Normally icons are loaded from ALIAS_BITMAP_LOCATION. In the specified path, there should be two directories:
small medium
In the small/ directory, there should be an icon file ending in the function name followed by ’.S’ In the medium/ directory, there should be an icon file ending in the function name followed by ’.M’ For example, if the function name is ’MySphere’ and the icon path is ’/usr/myicons’, then the following files should exist:
/usr/myicons/small/MySphere.S /usr/myicons/medium/MySphere.M
statusCode AlSubmenu::createSubmenu( const char *menuname, const char *submenuname )