InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DVOwnerDrawMenu Class Reference
Inheritance diagram for DVOwnerDrawMenu:
CPMUnknown< IDVOwnerDrawMenu >IDVOwnerDrawMenuIPMUnknown

Public Member Functions

 DVOwnerDrawMenu (IPMUnknown *boss)
 
virtual void DrawMenuItem (IGraphicsContext *oc, 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 PMReal GetMenuViewScale ()
 
virtual void SetMenuViewScale (PMReal scale)
 
virtual void ReadWrite (IPMStream *s, ImplementationID prop)
 
- Public Member Functions inherited from CPMUnknown< IDVOwnerDrawMenu >
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 (dvaui::drawbot::Drawbot *drawbotP, IControlView *menuView, bool16 isCurrentlySelectedItem)
 
virtual void HandleEnablement (IControlView *menuView, int16 actionState)
 
- Protected Member Functions inherited from CPMUnknown< IDVOwnerDrawMenu >
 CPMUnknown (IPMUnknown *boss)
 

Additional Inherited Members

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

Member Function Documentation

virtual void DVOwnerDrawMenu::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 IDVOwnerDrawMenu.

virtual void DVOwnerDrawMenu::DrawMenuItem (IGraphicsContextoc,
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 IDVOwnerDrawMenu.

virtual PMReal DVOwnerDrawMenu::GetMenuViewScale ()
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.

Returns
scale to display

Implements IDVOwnerDrawMenu.

virtual bool16 DVOwnerDrawMenu::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 IDVOwnerDrawMenu.

virtual void DVOwnerDrawMenu::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 IDVOwnerDrawMenu.

virtual void DVOwnerDrawMenu::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 IDVOwnerDrawMenu.

virtual void DVOwnerDrawMenu::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 IDVOwnerDrawMenu.

virtual void DVOwnerDrawMenu::SetMenuViewScale (PMReal scale)
virtual

This is set in the menu manager before calling the owner drawn menu to draw.

Parameters
scaleview is drawn at.

Implements IDVOwnerDrawMenu.