Detailed Description
- See also:
- Class IMenuElement, Class IMenuItem, Class IMenuGlobalContext,
Class IMenuLocalContext, Structure
MenuEvent, Class
IPoint2, Class
Interface.
- 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>
List of all members.
Public Types
|
enum |
{
numItems,
getItem,
addItem,
removeItem,
removeItemByPosition,
setTitle,
getTitle,
getUseCustomTitle
} |
Public Member Functions
|
virtual
void |
SetIMenuGlobalContext
(IMenuGlobalContext
*pIMenuGlobalContext, int level, Tab< IMenuItem * > *pExecutedItemPath,
const MenuColors
*pMenuColors)=0 |
virtual
IMenuLocalContext
* |
GetIMenuLocalContext
()=0 |
virtual
int |
NumItems
() const =0 |
virtual
IMenuItem
* |
GetItem
(int position)=0 |
virtual
void |
AddItem
(IMenuItem *item,
int position=-1)=0 |
virtual
void |
RemoveItem
(int position)=0 |
virtual
void |
RemoveItem
(IMenuItem
*item)=0 |
virtual
IPoint2 |
GetMaxItemSize
()=0 |
virtual
void |
Initialize
()=0 |
virtual
void |
PostMenuInteraction
()=0 |
virtual
bool |
HandleEvent
(MenuEvent
&event)=0 |
virtual
void |
Show
(DisplayMethod displayMethod=DM_NORMAL, Box2 *rect=NULL)=0 |
virtual
void |
Hide
(DisplayMethod displayMethod=DM_NORMAL)=0 |
virtual
IMenuItem
* |
FindAccelItem
(MCHAR accelerator)=0 |
virtual
IMenuItem
* |
FindNewSelectedItem
()=0 |
virtual
void |
Display
(IMenu
*pParentMenu=NULL, bool show=true)=0 |
virtual
void |
DisplayItems
(IPoint2 &origin,
bool descending, bool leftToRight, bool nextSeparatorOK)=0 |
virtual
void |
Undisplay
()=0 |
virtual
bool |
IsDisplayingSubMenu
()=0 |
virtual
void |
TimerElapsed
(EventParam timingType)=0 |
virtual
void |
SetShowTitle
(bool showTitle)=0 |
virtual
bool |
GetShowTitle
() const =0 |
virtual
void |
SetCustomTitle
(const MCHAR *customTitle)=0 |
virtual const
MSTR & |
GetCustomTitle
() const =0 |
virtual
void |
SetUseCustomTitle
(bool useCustomTitle)=0 |
virtual
bool |
GetUseCustomTitle
() const =0 |
virtual
void |
SetUseGlobalWidths
(bool useGlobalWidths)=0 |
virtual
bool |
GetUseGlobalWidths
() const =0 |
virtual
bool |
NoVisibleItems
()=0 |
Member Enumeration Documentation
- Enumerator:
-
numItems |
|
getItem |
|
addItem |
|
removeItem |
|
removeItemByPosition |
|
setTitle |
|
getTitle |
|
getUseCustomTitle |
|
Member Function Documentation
- Parameters:
- IMenuGlobalContext* pIMenuGlobalContext
Points to the context to set.
virtual int NumItems |
( |
|
) |
const [pure virtual] |
virtual IMenuItem* GetItem |
( |
int |
position |
) |
[pure virtual] |
- Parameters:
- int position
The position/index in the menu.
virtual void AddItem |
( |
IMenuItem * |
item, |
|
|
int |
position =
-1 |
|
) |
|
[pure virtual] |
- Parameters:
- IMenuItem* item
Points to the menu item to add.
int position = -1
Position 0 indicates the beginnng of the list. A negative or
otherwise invalid position defaults to end of list.
virtual void RemoveItem |
( |
int |
position |
) |
[pure virtual] |
- Parameters:
- int position
The zero based index in the list of the item to remove. Position 0
is the first item.
virtual void RemoveItem |
( |
IMenuItem * |
item |
) |
[pure virtual] |
- Parameters:
- IMenuItem* item
Points to the menu item to remove.
virtual IPoint2 GetMaxItemSize |
( |
|
) |
[pure virtual] |
virtual void Initialize |
( |
|
) |
[pure virtual] |
virtual void PostMenuInteraction |
( |
|
) |
[pure virtual] |
virtual bool HandleEvent |
( |
MenuEvent & |
event |
) |
[pure virtual] |
- Parameters:
- MenuEvent
event
A menu event structure containing the event data.
- Returns:
- TRUE if the event was handled successfully, otherwise
FALSE.
virtual void Show |
( |
DisplayMethod |
displayMethod =
DM_NORMAL , |
|
|
Box2
* |
rect = NULL |
|
) |
|
[pure virtual] |
virtual void Hide |
( |
DisplayMethod |
displayMethod =
DM_NORMAL |
) |
[pure virtual] |
virtual IMenuItem* FindAccelItem |
( |
MCHAR |
accelerator |
) |
[pure virtual] |
- Parameters:
- MCHAR accelerator
The single character of the accelerator.
- Returns:
- A pointer to the menu item or NULL if not found.
virtual IMenuItem* FindNewSelectedItem |
( |
|
) |
[pure virtual] |
virtual void Display |
( |
IMenu * |
pParentMenu =
NULL , |
|
|
bool |
show = true |
|
) |
|
[pure virtual] |
- Parameters:
- IMenu* pParentMenu = NULL
Points to the parent menu.
virtual void DisplayItems |
( |
IPoint2 & |
origin, |
|
|
bool |
descending, |
|
|
bool |
leftToRight, |
|
|
bool |
nextSeparatorOK |
|
) |
|
[pure virtual] |
virtual void Undisplay |
( |
|
) |
[pure virtual] |
virtual bool IsDisplayingSubMenu |
( |
|
) |
[pure virtual] |
virtual void TimerElapsed |
( |
EventParam |
timingType |
) |
[pure virtual] |
virtual void SetShowTitle |
( |
bool |
showTitle |
) |
[pure virtual] |
- Parameters:
- bool showTitle
Pass true to show the title; false to not show it.
virtual bool GetShowTitle |
( |
|
) |
const [pure virtual] |
virtual void SetCustomTitle |
( |
const MCHAR * |
customTitle |
) |
[pure virtual] |
- Parameters:
- const MCHAR *customTitle
Points to the string to use.
virtual const MSTR& GetCustomTitle |
( |
|
) |
const [pure virtual] |
virtual void SetUseCustomTitle |
( |
bool |
useCustomTitle |
) |
[pure virtual] |
- Parameters:
- bool useCustomTitle
Pass true to use a custom title; false to not use one.
virtual bool GetUseCustomTitle |
( |
|
) |
const [pure virtual] |
virtual void SetUseGlobalWidths |
( |
bool |
useGlobalWidths |
) |
[pure virtual] |
- Parameters:
- bool useGlobalWidths
TRUE to use global widths, otherwise FALSE.
virtual bool GetUseGlobalWidths |
( |
|
) |
const [pure virtual] |
virtual bool NoVisibleItems |
( |
|
) |
[pure virtual] |