Public Types | Public Member Functions

IMenuItem Class Reference

Search for all occurrences

Detailed Description

See also:
Class IMenuElement, Class IMenuGlobalContext, Class IMenuLocalContext, Class ActionItem, Class IMenu, Class MaxIcon , Class IQuadMenuSettings

Description:
This class is available in release 4.0 and later only.

This abstract class represents an interface for a menu item. Methods that are marked as internal should not be used.

#include <imenus.h>

Inheritance diagram for IMenuItem:
Inheritance graph
[legend]

List of all members.

Public Types

enum   ActionMode {
  AM_INACTIVE = 0, AM_SEPARATOR, AM_ITEM, AM_FN,
  AM_SUBMENU, AM_ITEM_SUBMENU
}
enum   {
  setTitle, getTitle, setUseCustomTitle, getUseCustomTitle,
  setDisplayFlat, getDisplayFlat, getIsSeparator, getSubMenu,
  getMacroScript
}
typedef int  IMenuItemIcon
typedef void(*  ActionFn )(void)
typedef void(*  PreDisplayCB )(IMenuItem &menuItem)

Public Member Functions

virtual void  SetIMenuLocalContext (IMenuLocalContext *pIMenuLocalContext)=0
virtual ActionMode  GetActionMode () const =0
virtual bool  ExecuteAction () const =0
virtual void  ActAsSeparator ()=0
virtual bool  IsSeparator () const =0
virtual void  SetActionItem (ActionItem *pActionItem)=0
virtual ActionItem GetActionItem () const =0
virtual void  SetActionFn (ActionFn actionFn)=0
virtual const ActionFn  GetActionFn () const =0
virtual void  SetSubMenu (IMenu *menu)=0
virtual IMenu GetSubMenu ()=0
virtual void  SetPreDisplayCB (PreDisplayCB preDisplayCB)=0
virtual const PreDisplayCB  GetPreDisplayCB () const =0
virtual void  Display (bool leftToRight)=0
virtual MCHAR  GetAccelerator ()=0
virtual void  SetIcon (MaxIcon *pMaxIcon)=0
virtual const MaxIcon GetIcon () const =0
virtual void  SetChecked (bool checked)=0
virtual bool  GetChecked ()=0
virtual void  SetHighlighted (bool highlighted)=0
virtual bool  GetHighlighted () const =0
virtual void  SetUseCustomTitle (bool useCustomTitle)=0
virtual bool  GetUseCustomTitle () const =0
virtual void  SetDisplayFlat (bool displayFlat)=0
virtual bool  GetDisplayFlat () const =0
virtual void  PostMenuInteraction ()=0

Member Typedef Documentation

typedef int IMenuItemIcon
typedef void(* ActionFn)(void)
typedef void(* PreDisplayCB)(IMenuItem &menuItem)

Member Enumeration Documentation

enum ActionMode
anonymous enum

Member Function Documentation

virtual void SetIMenuLocalContext ( IMenuLocalContext pIMenuLocalContext ) [pure virtual]
Remarks:
This method is used internally.

This method allows you to set a new (local) context for the menu, invalidating the menu's cache.
Parameters:
IMenuLocalContext* pIMenuLocalContext

A pointer to the new local context object you wish to set.
virtual ActionMode GetActionMode ( ) const [pure virtual]
Remarks:
This method returns the current action mode. When item selection instigates an action item, calls functions, or displays a submenu the action mode changes to indicate the exact state the system is in.
Returns:
Either of the following; AM_INACTIVE, AM_SEPARATOR, AM_ITEM, AM_FN, AM_SUBMENU, AM_ITEM_SUBMENU
virtual bool ExecuteAction ( ) const [pure virtual]
Remarks:
This method will execute the current action.
Returns:
TRUE if the action was executed successfully, otherwise FALSE.
virtual void ActAsSeparator ( ) [pure virtual]
Remarks:
This method allows you to make the item act as an item seperator.
virtual bool IsSeparator ( ) const [pure virtual]
Remarks:
This method determines if the item is acting as a seperator (TRUE) or not (FALSE).
virtual void SetActionItem ( ActionItem pActionItem ) [pure virtual]
Remarks:
This method allows you to set the current action item. Note that GetActionItem() returns NULL if the ActionMode is not AM_ITEM.
Parameters:
ActionItem* pActionItem

The action item you wish to set.
virtual ActionItem* GetActionItem ( ) const [pure virtual]
Remarks:
This method returns a pointer to the current action item, or NULL if the ActionMode is not AM_ITEM.
virtual void SetActionFn ( ActionFn  actionFn ) [pure virtual]
Remarks:
This method allows you to set the current action function. Note that GetActionFn() returns NULL if the ActionMode is not AM_FN. A

lso note: typedef void (* ActionFn)(void);
Parameters:
ActionFn actionFn

The action function you wish to set.
virtual const ActionFn GetActionFn ( ) const [pure virtual]
Remarks:
This method returns the current action function, or NULL if the ActionMode is not AM_FN.

Note: typedef void (* ActionFn)(void);
virtual void SetSubMenu ( IMenu menu ) [pure virtual]
Remarks:
This method allows you to set the submenu. Note that GetSubMenu() returns NULL if the ActionMode is not AM_SUBMENU.
Parameters:
IMenu* menu

The submenu you wish to set.
virtual IMenu* GetSubMenu ( ) [pure virtual]
Remarks:
This method returns a pointer to the submenu, or NULL if the ActionMode is not AM_SUBMENU.
virtual void SetPreDisplayCB ( PreDisplayCB  preDisplayCB ) [pure virtual]
Remarks:
This method allows you to set the pre-display callback.

Note: typedef void (* PreDisplayCB)(IMenuItem& menuItem);
Parameters:
PreDisplayCB preDisplayCB

The callback to set.
virtual const PreDisplayCB GetPreDisplayCB ( ) const [pure virtual]
Remarks:
This method returns the pre-display callback.
virtual void Display ( bool  leftToRight ) [pure virtual]
Remarks:
This method is used internally.
virtual MCHAR GetAccelerator ( ) [pure virtual]
Remarks:
This method is used internally.

This method returns the item's accelerator, or 0 if none is assigned.
virtual void SetIcon ( MaxIcon pMaxIcon ) [pure virtual]
Remarks:
This method allows you to set the item's icon.
Parameters:
MaxIcon* pMaxIcon

A pointer to a MaxIcon to set.
virtual const MaxIcon* GetIcon ( ) const [pure virtual]
Remarks:
This method returns a pointer to the item's icon.
virtual void SetChecked ( bool  checked ) [pure virtual]
Remarks:
This method allows you to set the checked state of the item.
Parameters:
bool checked

TRUE to check the item, FALSE to uncheck the item.
virtual bool GetChecked ( ) [pure virtual]
Remarks:
This method returns TRUE if the item is checked or FALSE if it is unchecked.
virtual void SetHighlighted ( bool  highlighted ) [pure virtual]
Remarks:
This method allows you to set the highlighted state of the item.
Parameters:
bool highlighted

TRUE to highlight the item, FALSE if you do not want to highlight the item.
virtual bool GetHighlighted ( ) const [pure virtual]
Remarks:
This method returns TRUE if the item is highlighted, otherwise FALSE.
virtual void SetUseCustomTitle ( bool  useCustomTitle ) [pure virtual]
Remarks:
This method allows you to tell the item it should use a custom title, which is set through SetTitle().
Parameters:
bool useCustomTitle

TRUE to use a custom title, FALSE to use the default.
virtual bool GetUseCustomTitle ( ) const [pure virtual]
Remarks:
This method returns TRUE if the item is using a custom title or FALSE if it's using a default.
virtual void SetDisplayFlat ( bool  displayFlat ) [pure virtual]
Remarks:
This method allows you to set whether the submenu-item should be displayed 'flat'.
Parameters:
bool displayFlat

TRUE to set to flat, otherwise FALSE.
virtual bool GetDisplayFlat ( ) const [pure virtual]
Remarks:
This method returns TRUE if the submenu-item should be displayed 'flat', otherwise FALSE.
virtual void PostMenuInteraction ( ) [pure virtual]
Remarks:
This method is used internally.

This method is called after the user/menu interaction is done after which it will clear the caches for ActionItem handler values.

IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem
IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem IMenuItem