InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DynMnuDynamicMenu Class Reference
Inheritance diagram for DynMnuDynamicMenu:
CPMUnknown< IDynamicMenu >IDynamicMenuIPMUnknown

Public Member Functions

 DynMnuDynamicMenu (IPMUnknown *boss)
 
 ~DynMnuDynamicMenu ()
 
void RebuildMenu (ActionID dynamicActionID, IPMUnknown *widget)
 
- Public Member Functions inherited from CPMUnknown< IDynamicMenu >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Protected Member Functions

UIDList GetSpreadUIDs ()
 
- Protected Member Functions inherited from CPMUnknown< IDynamicMenu >
 CPMUnknown (IPMUnknown *boss)
 

Additional Inherited Members

- Public Types inherited from IDynamicMenu
enum  { kDefaultIID = IID_IDYNAMICMENU }
 
- Protected Attributes inherited from CPMUnknown< IDynamicMenu >
HelperInterface fHelperInterface
 

Detailed Description

DynMnuDynamicMenu implements the IDynamicMenu interface. Builds the menu each time it is exposed.

Constructor & Destructor Documentation

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

Constructor.

Parameters
bossinterface ptr from boss object on which this interface is aggregated.
DynMnuDynamicMenu::~DynMnuDynamicMenu ()

Destructor

Member Function Documentation

UIDList DynMnuDynamicMenu::GetSpreadUIDs ()
protected

Gets the UIDs for spreads 1..n in the front document. This method will always return a UIDList with length > 0, event though the [0] entry may be kInvalidUID. It is the responsibility of the caller to insure that [0] is a valid UID and the Idatabase* is is not nil.

Returns
List of front document spread UIDs
void DynMnuDynamicMenu::RebuildMenu (ActionID dynamicActionID,
IPMUnknownwidget 
)
virtual

This method controls what menu items appear at any given time. InDesign calls this method when the menu is exposed and any menu entry in the MenuDef resource uses the kSDKDefIsDynamicMenuFlag. Control is exercised by rebuilding this action component's valid menus with the menu and action managers. This example implementation builds the menus and action IDs based on the number of spreads in the front document.

Parameters
dynamicActionIDID of menu hit just before this method is called.
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 IDynamicMenu.