Public Types | Public Member Functions

DynamicMenu Class Reference

This reference page is linked to from the following overview topics: Classes Involved in the Action System.


Search for all occurrences

Detailed Description

Provides an easy mechanism for plug-ins to produce the menu needed in the ActionItem::GetDynamicMenu() method.

The constructor of this class is used to create the menu and the ActionItem::GetMenu() method returns the appropriate IMenu pointer.

Version:
4.0
See also:
Class DynamicMenuCallback, Class IMenu, Class ActionTable, Class ActionItem, Class ActionCallback, Class ActionContext, Class IActionManager, Class Interface.

#include <actiontable.h>

Inheritance diagram for DynamicMenu:
Inheritance graph
[legend]

List of all members.

Public Types

enum   DynamicMenuFlags { kDisabled = 1 << 0, kChecked = 1 << 1, kSeparator = 1 << 2 }
 

Constants used in AddItem.

More...

Public Member Functions

CoreExport  DynamicMenu (DynamicMenuCallback *pCallback)
  Constructor.
CoreExport IMenu GetMenu ()
  This is the value returned from ActionItem::GetDynamicMenu().
CoreExport void  AddItem (DWORD flags, UINT itemId, MCHAR *pItemTitle)
  Adds an item to the dynamic menu.
CoreExport void  BeginSubMenu (MCHAR *pTitle)
  This begins a new sub menu.
CoreExport void  EndSubMenu ()
  Ends construction of a sub menu.

Member Enumeration Documentation

Constants used in AddItem.

Enumerator:
kDisabled 
kChecked 
kSeparator 
                              {
                kDisabled   = 1 << 0, //< Item is disabled (can't be selected)
                kChecked    = 1 << 1, //< Item has a check mark beside it or is pressed 
                kSeparator  = 1 << 2, //< Item is a seperator between the previous menu item and the next one.
        };

Constructor & Destructor Documentation

CoreExport DynamicMenu ( DynamicMenuCallback pCallback )

Constructor.

Parameters:
pCallback Points to the instance of the DynamicMenuCallback class that handles the menu selection.

Member Function Documentation

CoreExport IMenu* GetMenu ( )

This is the value returned from ActionItem::GetDynamicMenu().

This method may be called after menu creation to get a pointer to the IMenu created.

Returns:
A pointer to Imenu that can be returned from ActionItem::GetDynamicMenu(*)
CoreExport void AddItem ( DWORD  flags,
UINT  itemId,
MCHAR *  pItemTitle 
)

Adds an item to the dynamic menu.

Parameters:
flags One or more of the DynamicMenuFlags.
itemId The ID for the menu item.
pItemTitle The name to appear for the menu item.
CoreExport void BeginSubMenu ( MCHAR *  pTitle )

This begins a new sub menu.

Items added after this call will appear as sub choices of this one until EndSubMenu() is called.

Parameters:
pTitle The name to appear for the sub menu item.
CoreExport void EndSubMenu ( )

Ends construction of a sub menu.

Items added after this call will appear as they did prior to calling BeginSubMenu().


DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu
DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu DynamicMenu