Related Scripting Object: MenuItem
The MenuItem object represents an individual item on a custom menu. More...
#include <xsi_menuitem.h>
Inheritance diagram for MenuItem:

Public Member Functions |
|
| MenuItem () | |
| ~MenuItem () | |
| MenuItem (const CRef &in_ref) | |
| MenuItem (const MenuItem &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| MenuItem & | operator= (const MenuItem &in_obj) |
| MenuItem & | operator= (const CRef &in_ref) |
| CStatus | PutCallback (const CString &in_strCallback) |
| CString | GetCallback () const |
| CStatus | PutCommand (const CString &in_strCommand) |
| siMenuItemStyle | GetStyle () const |
| CStatus | PutFilter (const CString &in_strFilter) |
| CRef | GetFilter () const |
| bool | IsEnabled () |
| CStatus | PutEnabled (bool in_bFlag) |
Here are some of the features:
Default destructor.
Constructor.
| in_ref | constant reference object. |
Copy constructor.
| in_obj | constant class object. |
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns the type of the API class.
Reimplemented from UIObject.
Reimplemented in Menu.
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
| in_ref | constant class object. |
Reimplemented from UIObject.
Reimplemented in Menu.
Sets the callback function for this menu item. The callback function is called when the item is selected and is executed by XSI as a single undo event. You can always undo/redo the action of a menu item callback function provided your function calls undoable commands or object model methods. The callback function must have the following signature:
CStatus MyFunction( const XSI::CRef& in_context )
item_name [origin]
item_name is the name of the menu item and origin the origin of the callback ([u] for user, [w] for workgroup).
| in_strCallback | Callback function name. |
CStatus::Fail failure
Returns the callback function for this menu item.
Sets the command for this menu item. You can attach any native or custom commands you want to a menu item. If your menu is attached to a contextual menu and one of your command's arguments takes the selected objects by default, then the current selected object(s) is passed into your command. The target object under the cursor is also passed in as part of the selected objects. However if no objects are selected then only the target is passed in.
When a command is attached to a menu item, the caption is set as follows:
item_name [origin] hotkey
item_name is the name of the menu item, origin the origin of the command ([u] for user, [w] for workgroup) and hotkey the hotkey associated with the command.
The menu item will be greyed out if the command is disabled.
| in_strCommand | Command name. |
CStatus::Fail failure
Returns the style of this menu item.
Sets the filter for this menu item. XSI uses the filter for validating the menu item or an entire menu against the target or selected objects before it gets displayed.
If the filter criteria are not satisfied then the menu item is greyed out. Menus are removed if attached to a contextual menu.
| in_strFilter | Filter name. |
CStatus::Fail failure
Reimplemented in Menu.
Returns the filter attached to this menu item.
Returns true if the menu item is enabled.
Enables or disables a menu item. Menu objects can also be enabled or disabled which means all menu items defined in a menu are affected. This property is typically used for updating a menu item based on a specific context. Enabled by default.
| in_bFlag | True enables the menu item, false disables it. |
CStatus::Fail Failure.