InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DynMnuActionComponent Class Reference
Inheritance diagram for DynMnuActionComponent:
CActionComponentIActionComponentIPMUnknown

Public Member Functions

 DynMnuActionComponent (IPMUnknown *boss)
 
virtual void DoAction (IActiveContext *ac, ActionID actionID, GSysPoint mousePoint, IPMUnknown *widget)
 
virtual void UpdateActionStates (IActiveContext *ac, IActionStateList *listToUpdate, GSysPoint mousePoint, IPMUnknown *widget)
 
- Public Member Functions inherited from CActionComponent
 CActionComponent (IPMUnknown *boss)
 
virtual ~CActionComponent ()
 

Additional Inherited Members

- Public Types inherited from IActionComponent
enum  { kDefaultIID = IID_IACTIONCOMPONENT }
 

Detailed Description

DynMnuActionComponent implements the actions that are executed when the plug-in's menu items are selected.

DynMnuActionComponent implements IActionComponent based on the partial implementation CActionComponent.

Constructor & Destructor Documentation

Binds the C implementation class onto its ImplementationID making the C code callable by the application * DynMnuActionComponent::DynMnuActionComponent (IPMUnknownboss)

Constructor.

Parameters
bossinterface ptr from boss object on which this interface is aggregated.

Member Function Documentation

void DynMnuActionComponent::DoAction (IActiveContextac,
ActionID actionID,
GSysPoint mousePoint,
IPMUnknownwidget 
)
virtual

The action component should do the requested action. Because this plug-in has dynamic menu entries, the ActionIDs received by this method from the action manager is not a closed set. Action IDs for static menu entries are handled as an explicit case in a switch statement. Action IDs for dynamic menu entries are handled by the switch's default case, and are delegated to the DoHandleDynamic() method.

Parameters
acrefers to the current active context, such as the front document
actionIDidentifies which action this action component should perform
mousePointcontains the global mouse location at time of event causing action (e.g. context menus). kInvalidMousePoint if not relevant.
widgetcontains the widget that invoked this action. May be nil. e.g. Useful to use as a basis for Utils<IWidgetUtils>()->QueryRelatedWidget(...) to find widgets in a panel after its popup menu is hit.

Implements IActionComponent.

void DynMnuActionComponent::UpdateActionStates (IActiveContextac,
IActionStateListlistToUpdate,
GSysPoint mousePoint,
IPMUnknownwidget 
)
virtual

This method controls what menu items are enabled at any given time. InDesign calls this method when a menu is exposed if the ActionDef has entries with the enabling type set to kCustomEnabling. This method is the opportunity to enable or disable any of the menu entries in the IActionStateList. This implementation simply enables any item in the action state list for which it can find a valid spread UID in the IActionIDToUIDData interface.

Parameters
acrefers to the current active context, such as the front document
listToUpdatecontains the items that client code should update the state for
mousePointcontains the global mouse location at time of event causing action (e.g. context menus). kInvalidMousePoint if not relevant.
widgetcontains the widget that invoked this action. May be nil. e.g. Useful to use as a basis for Utils<IWidgetUtils>()->QueryRelatedWidget(...) to find widgets in a panel after its popup menu is hit.

Reimplemented from CActionComponent.