3ds Max C++ API Reference
Loading...
Searching...
No Matches
IMenu Class Referenceabstract

#include <imenus.h>

+ 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 BaseInterfaceGetInterface (Interface_ID id)
 
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.
 
UtilExport BaseInterfaceGetInterface (Interface_ID id) override
 
virtual UtilExport Interface_ID GetID ()
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=nullptr)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 
- 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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 
- 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
 

Detailed 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.

Member Enumeration Documentation

◆ anonymous enum

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 };
@ addItem
Definition: imenus.h:1737
@ setTitle
Definition: imenus.h:1740
@ getItem
Definition: imenus.h:1736
@ numItems
Definition: imenus.h:1735
@ getTitle
Definition: imenus.h:1741
@ removeItem
Definition: imenus.h:1738
@ getUseCustomTitle
Definition: imenus.h:1742
@ removeItemByPosition
Definition: imenus.h:1739

Member Function Documentation

◆ SetIMenuGlobalContext()

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.

◆ GetIMenuLocalContext()

virtual IMenuLocalContext * GetIMenuLocalContext ( )
pure virtual
Remarks
This method is used internally.

Returns a pointer to the menu's local context.

◆ NumItems()

virtual int NumItems ( ) const
pure virtual
Remarks
Returns the number of items in the menu.

◆ GetItem()

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.

◆ AddItem()

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.

◆ RemoveItem() [1/2]

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.

◆ RemoveItem() [2/2]

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.

◆ GetMaxItemSize()

virtual IPoint2 GetMaxItemSize ( )
pure virtual
Remarks
This method is used internally.

Returns the maximum size of all items in the menu in pixels.

◆ Initialize()

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.

◆ PostMenuInteraction()

virtual void PostMenuInteraction ( )
pure virtual
Remarks
This method is used internally.

This method is called after a user / menu interaction.

◆ HandleEvent()

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.

◆ Show()

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.

◆ Hide()

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.

◆ FindAccelItem()

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.

◆ FindNewSelectedItem()

virtual IMenuItem * FindNewSelectedItem ( )
pure virtual
Remarks
This method is used internally.

Returns a pointer to the currently selected menu item.

◆ Display()

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.

◆ DisplayItems()

virtual void DisplayItems ( IPoint2 origin,
bool  descending,
bool  leftToRight,
bool  nextSeparatorOK 
)
pure virtual
Remarks
This method is used internally.

◆ Undisplay()

virtual void Undisplay ( )
pure virtual
Remarks
This method is used internally.

This methods removes the menu from the display.

◆ IsDisplayingSubMenu()

virtual bool IsDisplayingSubMenu ( )
pure virtual
Remarks
This method is used internally.

Returns TRUE if the menu is displaying a sub-menu; otherwise FALSE.

◆ TimerElapsed()

virtual void TimerElapsed ( EventParam  timingType)
pure virtual
Remarks
This method is used internally.

This method notifies the menu that the timer has elapsed.

◆ SetShowTitle()

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.

◆ GetShowTitle()

virtual bool GetShowTitle ( ) const
pure virtual
Remarks
This method is used internally.

Returns true if a title is shown; otherwise false.

◆ SetCustomTitle()

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.

◆ GetCustomTitle()

virtual const MSTR & GetCustomTitle ( ) const
pure virtual
Remarks
Returns the custom title string.

◆ SetUseCustomTitle()

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.

◆ GetUseCustomTitle()

virtual bool GetUseCustomTitle ( ) const
pure virtual
Remarks
This method returns TRUE if the menu uses a custom title, otherwise FALSE.

◆ SetUseGlobalWidths()

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.

◆ GetUseGlobalWidths()

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.

◆ NoVisibleItems()

virtual bool NoVisibleItems ( )
pure virtual
Remarks
This method is used internally.

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