![]() | InDesign SDK 20.5 |
#include <IDVOwnerDrawMenu.h>

Public Types | |
| enum | { kDefaultIID = IID_IDVOWNERDRAWMENU } |
Public Member Functions | |
Callbacks to manage Drawing of OwnerDraw menus | |
| virtual void | DrawMenuItem (IGraphicsContext *oc, ActionID menuActionID, const SysRect &itemRect, bool16 isCurrentlySelectedItem, int16 actionState)=0 |
| virtual void | MeasureItem (ActionID menuActionID, uint16 *outItemWidth, uint16 *outItemHeight)=0 |
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 | |
| virtual void | AddMenuWidget (ActionID menuActionID, IControlView *widget)=0 |
| virtual void | RemoveMenuWidget (ActionID menuActionID, bool16 deleteUID=kTrue)=0 |
| virtual void | RemoveAllMenuWidgets (bool16 deleteUID=kTrue)=0 |
| virtual bool16 | IsValidActionID (ActionID actionID)=0 |
| virtual PMReal | GetMenuViewScale ()=0 |
| virtual void | SetMenuViewScale (PMReal scale)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
This interface is necessary for OwnerDraw menus. When an ownerdraw menu is shown, this interface is called to draw the menu. It should be placed on the same boss as the IActionComponent for the menu
| pure 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.
| The | ActionID of the specific menu item that you are associating with the given widget. |
| The | widget that is being added to the OwnerDraw menus list of widgets and associated actions |
Implemented in DVOwnerDrawMenu.
| pure 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
| The | IViewPort that you should draw into |
| The | ActionID 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. |
| The | rect in which to draw you menu item |
| kTrue | if 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 |
| action | state 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) |
Implemented in DVOwnerDrawMenu.
| pure virtual |
A way to find out what scale the owner drawn view should be drawn at. If using a HIDPI screen this may be greater than 1.
Implemented in DVOwnerDrawMenu.
| pure 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.
| actionID | the action id you want to test |
Implemented in DVOwnerDrawMenu.
| pure 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
| The | ActionID 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. |
| this | an out only parameter. You should set it to the width of your menu. This may be nil, so check before setting it |
| this | an out only parameter. You should set it to the height of your menu. This may be nil, so check before setting it |
Implemented in DVOwnerDrawMenu.
| pure virtual |
Remove all the widgets that have been added.
| When | the 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. |
Implemented in DVOwnerDrawMenu.
| pure virtual |
Remove the widget that is associated with the specified action.
| The | ActionID of the specific menu item whose widget you wish to remove. |
| When | the 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. |
Implemented in DVOwnerDrawMenu.
| pure virtual |
This is set in the menu manager before calling the owner drawn menu to draw.
| scale | view is drawn at. |
Implemented in DVOwnerDrawMenu.