IMenu Class Reference

#include <imenus.h>

Class Description

See also
Class IMenuElement, Class IMenuItem, Class IMenuGlobalContext, Class IMenuLocalContext, Structure MenuEvent, Class IPoint2, Class Interface.

Description:
This abstract class represents an interface for a menu item. Methods that are marked as internal should not be used.
+ Inheritance diagram for IMenu:

Public Types

enum  {
  numItems, getItem, addItem, removeItem,
  removeItemByPosition, setTitle, getTitle, getUseCustomTitle
}
 
- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease, immediateRelease, wantsRelease, serverControlled }
 
- Public Types inherited from IMenuElement
enum  OriginLocation { UPPER_LEFT, LOWER_LEFT, LOWER_RIGHT, UPPER_RIGHT }
 

Public Member Functions

virtual void SetIMenuGlobalContext (IMenuGlobalContext *pIMenuGlobalContext, int level, Tab< IMenuItem * > *pExecutedItemPath, const MenuColors *pMenuColors)=0
 
virtual IMenuLocalContextGetIMenuLocalContext ()=0
 
virtual int NumItems () const =0
 
virtual IMenuItemGetItem (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 IMenuItemFindAccelItem (MCHAR accelerator)=0
 
virtual IMenuItemFindNewSelectedItem ()=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 MSTRGetCustomTitle () 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
 
- Public Member Functions inherited from FPMixinInterface
 FPMixinInterface ()
 
virtual LifetimeType LifetimeControl ()
 
virtual CoreExport bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
CoreExport ~FPMixinInterface ()
 
virtual BaseInterfaceGetInterface (Interface_ID id)
 
virtual FPInterfaceDescGetDescByID (Interface_ID id)
 
virtual Interface_ID GetID ()
 
- Public Member Functions inherited from FPInterface
virtual FPInterfaceDescGetDesc ()=0
 
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t=0, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPParams *params)
 
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t, FPValue &result, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPValue &result, FPParams *params=NULL)
 
virtual CoreExport FunctionID FindFn (const MCHAR *name)
 
virtual CoreExport BOOL IsEnabled (FunctionID actionID)
 
virtual CoreExport BOOL IsChecked (FunctionID actionID)
 
virtual CoreExport BOOL IsVisible (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsEnabled (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsChecked (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsVisible (FunctionID actionID)
 
virtual ActionTableGetActionTable ()
 
virtual void EnableActions (BOOL onOff)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
- Public Member Functions inherited from IMenuElement
virtual ~IMenuElement ()
 
virtual void SetOrigin (const IPoint2 &origin, OriginLocation location)=0
 
virtual const IPoint2GetOrigin () const =0
 
virtual void SetVisible (bool visible)=0
 
virtual bool GetVisible ()=0
 
virtual void SetTitle (const MCHAR *customTitle)=0
 
virtual const MSTRGetTitle ()=0
 
virtual void SetEnabled (bool enabled)=0
 
virtual bool GetEnabled ()=0
 
virtual const IPoint2GetSize ()=0
 
virtual const Box2GetRect ()=0
 
virtual bool IsInRect (const IPoint2 &point)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 
- Static Public Attributes inherited from FPInterface
static CoreExport FPInterfaceDesc nullInterface
 
- Protected Member Functions inherited from FPMixinInterface
 FPMixinInterface (const FPMixinInterface &rhs)
 
FPMixinInterfaceoperator= (const FPMixinInterface &rhs)
 
- Protected Member Functions inherited from FPInterface
virtual FPStatus _dispatch_fn (FunctionID fid, TimeValue t, FPValue &result, FPParams *p)
 
- Protected Attributes inherited from FPMixinInterface
Tab< InterfaceNotifyCallback * > * interfaceNotifyCBs
 

Member Enumeration Documentation

anonymous enum
Enumerator
numItems 
getItem 
addItem 
removeItem 
removeItemByPosition 
setTitle 
getTitle 
getUseCustomTitle 
1734  {
1735  numItems,
1736  getItem,
1737  addItem,
1738  removeItem,
1740  setTitle,
1741  getTitle,
1743  };
Definition: imenus.h:1739
Definition: imenus.h:1740
Definition: imenus.h:1736
Definition: imenus.h:1738
Definition: imenus.h:1735
Definition: imenus.h:1741
Definition: imenus.h:1737
Definition: imenus.h:1742

Member Function Documentation

virtual void SetIMenuGlobalContext ( IMenuGlobalContext pIMenuGlobalContext,
int  level,
Tab< IMenuItem * > *  pExecutedItemPath,
const MenuColors pMenuColors 
)
pure virtual
Remarks
This method is used internally.

This method sets a new context for the menu, invalidating the menu's cache.
Parameters:
IMenuGlobalContext* pIMenuGlobalContext

Points to the context to set.
virtual IMenuLocalContext* GetIMenuLocalContext ( )
pure virtual
Remarks
This method is used internally.

Returns a pointer to the menu's local context.
virtual int NumItems ( ) const
pure virtual
Remarks
Returns the number of items in the menu.
virtual IMenuItem* GetItem ( int  position)
pure virtual
Remarks
Returns a pointer to the specified menu item.
Parameters:
int position

The position/index in the menu.
virtual void AddItem ( IMenuItem item,
int  position = -1 
)
pure virtual
Remarks
This method adds the specified item into the menu at the position passed. The default position is at the end.
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
Remarks
Removes the item from the menu whose position is passed.
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
Remarks
Removes the specified item from the menu (if it indeed appears in the menu).
Parameters:
IMenuItem* item

Points to the menu item to remove.
virtual IPoint2 GetMaxItemSize ( )
pure virtual
Remarks
This method is used internally.

Returns the maximum size of all items in the menu in pixels.
virtual void Initialize ( )
pure virtual
Remarks
This method is used internally.

This method is called before menu is first displayed during a user / menu interaction.
virtual void PostMenuInteraction ( )
pure virtual
Remarks
This method is used internally.

This method is called after a user / menu interaction.
virtual bool HandleEvent ( MenuEvent event)
pure virtual
Remarks
This method is used internally.

This method is called to handle an event occuring within the menu.
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
Remarks
This method is used internally.

This method will display the menu using the provided display method.
virtual void Hide ( DisplayMethod  displayMethod = DM_NORMAL)
pure virtual
Remarks
This method is used internally.

This method will hide the menu using the provided display method.
virtual IMenuItem* FindAccelItem ( MCHAR  accelerator)
pure virtual
Remarks
This method is used internally.

Finds and returns a pointer to the menu item whose accelerator is passed.
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
Remarks
This method is used internally.

Returns a pointer to the currently selected menu item.
virtual void Display ( IMenu pParentMenu = NULL,
bool  show = true 
)
pure virtual
Remarks
This method is used internally.

This method displays the menu.
Parameters:
IMenu* pParentMenu = NULL

Points to the parent menu.
virtual void DisplayItems ( IPoint2 origin,
bool  descending,
bool  leftToRight,
bool  nextSeparatorOK 
)
pure virtual
Remarks
This method is used internally.
virtual void Undisplay ( )
pure virtual
Remarks
This method is used internally.

This methods removes the menu from the display.
virtual bool IsDisplayingSubMenu ( )
pure virtual
Remarks
This method is used internally.

Returns TRUE if the menu is displaying a sub-menu; otherwise FALSE.
virtual void TimerElapsed ( EventParam  timingType)
pure virtual
Remarks
This method is used internally.

This method notifies the menu that the timer has elapsed.
virtual void SetShowTitle ( bool  showTitle)
pure virtual
Remarks
This method is used internally.

Sets whether to show the title or not.
Parameters:
bool showTitle

Pass true to show the title; false to not show it.
virtual bool GetShowTitle ( ) const
pure virtual
Remarks
This method is used internally.

Returns true if a title is shown; otherwise false.
virtual void SetCustomTitle ( const MCHAR customTitle)
pure virtual
Remarks
Sets the custom title to the string passed.
Parameters:
const MCHAR *customTitle

Points to the string to use.
virtual const MSTR& GetCustomTitle ( ) const
pure virtual
Remarks
Returns the custom title string.
virtual void SetUseCustomTitle ( bool  useCustomTitle)
pure virtual
Remarks
Sets if the item should use a custom title.
Parameters:
bool useCustomTitle

Pass true to use a custom title; false to not use one.
virtual bool GetUseCustomTitle ( ) const
pure virtual
Remarks
This method returns TRUE if the menu uses a custom title, otherwise FALSE.
virtual void SetUseGlobalWidths ( bool  useGlobalWidths)
pure virtual
Remarks
This method is used internally.

This method allows you to instruct the menu to use global widths in order to show the title.
Parameters:
bool useGlobalWidths

TRUE to use global widths, otherwise FALSE.
virtual bool GetUseGlobalWidths ( ) const
pure virtual
Remarks
This method is used internally.

This method returns TRUE if the menu uses global widths in order to show the title, otherwise FALSE.
virtual bool NoVisibleItems ( )
pure virtual
Remarks
This method is used internally.

Returns true if the menu has no visible items in it; otherwise false.