InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
OwnerDrawMenu Class Reference
Inheritance diagram for OwnerDrawMenu:
CPMUnknown< IOwnerDrawMenu >IOwnerDrawMenuIPMUnknown

Public Member Functions

 OwnerDrawMenu (IPMUnknown *boss)
 
virtual void DrawMenuItem (IViewPort *viewPort, ActionID menuActionID, const SysRect &itemRect, bool16 isCurrentlySelectedItem, int16 actionState)
 
virtual void MeasureItem (ActionID menuActionID, uint16 *outItemWidth, uint16 *outItemHeight)
 
virtual void AddMenuWidget (ActionID menuActionID, IControlView *widget)
 
virtual void RemoveMenuWidget (ActionID menuActionID, bool16 deleteUID=kTrue)
 
virtual void RemoveAllMenuWidgets (bool16 deleteUID=kTrue)
 
virtual bool16 IsValidActionID (ActionID actionID)
 
virtual void ReadWrite (IPMStream *s, ImplementationID prop)
 
- Public Member Functions inherited from CPMUnknown< IOwnerDrawMenu >
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
 
Callbacks to manage Drawing of OwnerDraw menus
Adding and removing widgets for associated ActionIDs. Typically, widgets are added to the OwnerDraw menu using these methods and when DrawMenu is called,

it will draw the widget that was added for the requested ActionID

Protected Member Functions

IControlViewGetWidgetForAction (ActionID menuActionID)
 
virtual void DrawHilite (SysPort port, IControlView *menuView, bool16 isCurrentlySelectedItem)
 
virtual void HandleEnablement (IControlView *menuView, int16 actionState)
 
- Protected Member Functions inherited from CPMUnknown< IOwnerDrawMenu >
 CPMUnknown (IPMUnknown *boss)
 

Additional Inherited Members

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

Member Function Documentation

virtual void OwnerDrawMenu::AddMenuWidget (ActionID menuActionID,
IControlViewwidget 
)
virtual

Add a widget for a given ActionID. This is the preferred method for using OwnerDraw Menus. Widgets are added with AddMenuWidget and associated with an ActionID.

Parameters
TheActionID of the specific menu item that you are associating with the given widget.
Thewidget that is being added to the OwnerDraw menus list of widgets and associated actions

Implements IOwnerDrawMenu.

virtual void OwnerDrawMenu::DrawMenuItem (IViewPortviewPort,
ActionID menuActionID,
const SysRectitemRect,
bool16 isCurrentlySelectedItem,
int16 actionState 
)
virtual

This method is called by the Menu Manager code to draw an OwnerDraw menu item. When called, client should draw into the specified port and rectangle

Parameters
TheIViewPort that you should draw into
TheActionID of the specific menu that is being asked to be drawn. Only 1 menu item at a time is drawn. This identifies which menu item to draw.
Therect in which to draw you menu item
kTrueif this menu item has the mouse over it and should be drawn hilited to indicate that it is the curren target menu item. kFalse otherwise
actionstate of the menu item. This is the same as the action states in IActionStateList.h and should be used to determine whether to draw disabled, with a checkmark, etc. Options are (kDisabled_Unselected, kEnabledAction, kSelectedAction, kMultiSelectedAction, kAltSelectedAction)

Implements IOwnerDrawMenu.

virtual bool16 OwnerDrawMenu::IsValidActionID (ActionID actionID)
virtual

Test the Action ID to see if it is one of the actions that this class can render. Override this for components that have a mix of ownerdraw menus and regular menus. If you don't do this, your owner draw code will be called when your regular menu is colorized in the Menus dialog.

Parameters
actionIDthe action id you want to test
Returns
true if this owner draw class can render the actionID menu.

Implements IOwnerDrawMenu.

virtual void OwnerDrawMenu::MeasureItem (ActionID menuActionID,
uint16 * outItemWidth,
uint16 * outItemHeight 
)
virtual

This method is called by the Menu Manager code to determine the size of the given menu manager. The height and width returned here will match the height and width of the rectangle given in DrawMenuItem

Parameters
TheActionID of the specific menu that is being asked to be measured. Only 1 menu item at a time is measured. This identifies which menu item to measure.
thisan out only parameter. You should set it to the width of your menu. This may be nil, so check before setting it
thisan out only parameter. You should set it to the height of your menu. This may be nil, so check before setting it

Implements IOwnerDrawMenu.

virtual void OwnerDrawMenu::RemoveAllMenuWidgets (bool16 deleteUID = kTrue)
virtual

Remove all the widgets that have been added.

Parameters
Whenthe widgets are removed, do you want the UIDs of the widgets deleted? Typically, you've created the widgets for this purpose, so you want to delete the UIDs when they go away.

Implements IOwnerDrawMenu.

virtual void OwnerDrawMenu::RemoveMenuWidget (ActionID menuActionID,
bool16 deleteUID = kTrue 
)
virtual

Remove the widget that is associated with the specified action.

Parameters
TheActionID of the specific menu item whose widget you wish to remove.
Whenthe widget is removed, do you want the UID of the widget deleted? Typically, you've created the widget for this purpose, so you want to delete the UID when it goes away.

Implements IOwnerDrawMenu.