MacroButtonData Class Reference

MacroButtonData Class Reference

#include <custcont.h>

Class Description

See also
Class ToolMacroItem, Class MacroEntry, Class MacroDir, Class ICustButton, Class ICustomControl, Class ActionItem, Custom User Interface Controls.

Description:
A Macro Button is a button which can execute either a keyboard macro or macro script. This class contains the data and access methods for such a UI button. This data includes a macro type, command ID, macro script ID, label, tooltip, image name, and image ID.

This object is used in the ToolMacroItem constructor. There are also methods of class ICustButton to get and set the macro button data.
Data Members:
int macroType;

The macro type. One of the following values:

MB_TYPE_KBD

A keyboard macro.

MB_TYPE_SCRIPT

A Script macro.

ActionTableId tblID;

The Shortcut Action Table ID.

void *cb;

The ShortcutCallback. This is currently not used.

int cmdID;

The command ID. There are method of class Interface that provide access to the command IDs for various keyboard shortcut tables. See Keyboard Shortcut Related Methods.

int macroScriptID;

The macroScriptID holds the id of the macroScript associated with this button. This id is the MacroID that is used by the methods in the MacroDir and MacroEntry classes (at one time it was an indirect reference to this id and so was typed as an int). The id can have values from 0 to the number of macro scripts currently defined in the running 3ds Max or the special value UNDEFINED_MACRO.

MCHAR *label;

The label text for a text button. This is used if imageID is -1.

MCHAR *tip;

The tooltip text.

MCHAR *imageName;

This is the name for the button image. This is the 'base' name only. For example if the actual image name was Spline_16i.bmp then the name supplied here would be Spline. See the remarks in Class CUIFrameMgr for details on the image naming scheme the CUI system uses.

int imageID;

The image ID. If this is set to -1 it indicates to use the label. If it is set to 0 or greater it indicates this is an image based button and this is the zero based index of the button that was added. This then is an ID into an image group as specified by imageName. Said another way, 3ds Max builds one large image list internally and uses the imageName to get an offset into the list and then uses this imageID as an additional offset from the start as indicated by the name (each imageName may contain multiple icons in the single BMP).

ActionItem* actionItem;

A pointer to the ActionItem.

DWORD flags;

These flags contain the last state when redrawing
+ Inheritance diagram for MacroButtonData:

Public Member Functions

CoreExport MacroButtonData ()
 
CoreExport MacroButtonData (long tID, int cID, const MCHAR *lbl, const MCHAR *tp=NULL, int imID=-1, const MCHAR *imName=NULL)
 
CoreExport MacroButtonData (int msID, const MCHAR *lbl, const MCHAR *tp=NULL, int imID=-1, const MCHAR *imName=NULL)
 
CoreExport ~MacroButtonData ()
 
CoreExport MacroButtonDataoperator= (const MacroButtonData &mbd)
 
CoreExport void SetLabel (const MCHAR *lbl)
 
const MCHARGetLabel ()
 
CoreExport void SetTip (const MCHAR *tp)
 
const MCHARGetTip ()
 
void SetCmdID (int id)
 
int GetCmdID ()
 
void SetScriptID (int id)
 
int GetScriptID ()
 
CoreExport void SetImageName (const MCHAR *imName)
 
const MCHARGetImageName ()
 
void SetImageID (int id)
 
int GetImageID ()
 
CoreExport void SetIconName (const MCHAR *iconName)
 
const MCHARGetIconName () const
 
void SetTblID (ActionTableId id)
 
ActionTableId GetTblID ()
 
void SetActionItem (ActionItem *pAction)
 
ActionItemGetActionItem ()
 
CoreExport BOOL IsActionButton ()
 

Public Attributes

int macroType
 
ActionTableId tblID
 
int cmdID
 
int macroScriptID
 
const MCHARlabel
 
const MCHARtip
 
const MCHARimageName
 
int imageID
 
ActionItemactionItem
 
const MCHARiconName
 
DWORD flags
 

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

Constructor & Destructor Documentation

Remarks
Constructor. The data members are initialized as follows:

label = tip = imageName = NULL; imageID = -1;
955 { label = tip = imageName = NULL; imageID = -1; iconName = nullptr; }
#define NULL
Definition: autoptr.h:18
const MCHAR * label
Definition: custcont.h:1048
const MCHAR * tip
Definition: custcont.h:1049
int imageID
Definition: custcont.h:1052
const MCHAR * imageName
Definition: custcont.h:1051
const MCHAR * iconName
Definition: custcont.h:1054
CoreExport MacroButtonData ( long  tID,
int  cID,
const MCHAR lbl,
const MCHAR tp = NULL,
int  imID = -1,
const MCHAR imName = NULL 
)
Remarks
Constructor. This one is used for keyboard macro buttons (MB_TYPE_KBD). The data members are initialized to the values passed as shown:

macroType=MB_TYPE_KBD; tblID=tID; this->cb=cb; cmdID=cID; imageID=imID; label=NULL; SetLabel(lbl); tip=NULL; SetTip(tp); imageName=NULL; SetImageName(imName);
CoreExport MacroButtonData ( int  msID,
const MCHAR lbl,
const MCHAR tp = NULL,
int  imID = -1,
const MCHAR imName = NULL 
)
inline
Remarks
Constructor. This one is used for macro script buttons (MB_TYPE_SCRIPT). The data members are initialized to the values passed as shown:

macroType=MB_TYPE_SCRIPT; macroScriptID=msID; imageID=imID; label=NULL; SetLabel(lbl); tip=NULL; SetTip(tp); imageName=NULL; SetImageName(imName);
970  {
971  iconName = nullptr;
973  label=NULL; SetLabel(lbl); tip=NULL; SetTip(tp); imageName=NULL; SetImageName(imName);
974 
975  }
#define MB_TYPE_SCRIPT
Definition: custcont.h:882
#define NULL
Definition: autoptr.h:18
CoreExport void SetImageName(const MCHAR *imName)
CoreExport void SetTip(const MCHAR *tp)
const MCHAR * label
Definition: custcont.h:1048
const MCHAR * tip
Definition: custcont.h:1049
int imageID
Definition: custcont.h:1052
int macroScriptID
Definition: custcont.h:1047
const MCHAR * imageName
Definition: custcont.h:1051
int macroType
Definition: custcont.h:1044
const MCHAR * iconName
Definition: custcont.h:1054
CoreExport void SetLabel(const MCHAR *lbl)
Remarks
Destructor. Any label, tooltip or image name strings are deleted.

Member Function Documentation

CoreExport MacroButtonData& operator= ( const MacroButtonData mbd)
Remarks
Assignment operator.
CoreExport void SetLabel ( const MCHAR lbl)
Remarks
Sets the label text.
Parameters
lblThe label to set.
const MCHAR* GetLabel ( )
inline
Remarks
Returns the label text.
987 { return label; }
const MCHAR * label
Definition: custcont.h:1048
CoreExport void SetTip ( const MCHAR tp)
Remarks
Sets the tooltip text.
Parameters
tpThe text to set.
const MCHAR* GetTip ( )
inline
Remarks
Returns the tooltip text.
992 { return tip; }
const MCHAR * tip
Definition: custcont.h:1049
void SetCmdID ( int  id)
inline
Remarks
Sets the command ID.
Parameters
idThe command ID to set.
995 { cmdID = id; }
int cmdID
Definition: custcont.h:1046
int GetCmdID ( )
inline
Remarks
Returns the command ID.
997 { return cmdID; }
int cmdID
Definition: custcont.h:1046
void SetScriptID ( int  id)
inline
Remarks
Sets the script ID.
Parameters
idThe script ID to set.
1000 { macroScriptID = id; }
int macroScriptID
Definition: custcont.h:1047
int GetScriptID ( )
inline
Remarks
Returns the script ID.
1002 { return macroScriptID; }
int macroScriptID
Definition: custcont.h:1047
CoreExport void SetImageName ( const MCHAR imName)
Remarks
Sets the image name. See the imageName data member above for details on the name format.
Parameters
imNameThe name to set.
const MCHAR* GetImageName ( )
inline
Remarks
Returns the image name.
1008 { return imageName; }
const MCHAR * imageName
Definition: custcont.h:1051
void SetImageID ( int  id)
inline
Remarks
Sets the image ID.
Parameters
idThe image ID to set.
1011 { imageID = id; }
int imageID
Definition: custcont.h:1052
int GetImageID ( )
inline
Remarks
Returns the image ID.
1013 { return imageID; }
int imageID
Definition: custcont.h:1052
CoreExport void SetIconName ( const MCHAR iconName)
Remarks
Sets a multi-resolution icon to the button.
Parameters
iconNameThe name of the icon.
See also
QIcon MaxSDK::LoadMaxMultiResIcon( const QString& iconName )
const MCHAR* GetIconName ( ) const
inline
Remarks
Returns the name of the multi-resolution icon assigned to the button.
See also
void SetIconName( const MSTR& iconName )
1024 { return iconName; }
const MCHAR * iconName
Definition: custcont.h:1054
void SetTblID ( ActionTableId  id)
inline
Remarks
This method sets the ActionTableID ID.
Parameters
idThe ActionTableID ID to set.
1029 { tblID = id; }
ActionTableId tblID
Definition: custcont.h:1045
ActionTableId GetTblID ( )
inline
Remarks
This method returns the ActionTableID ID.
1031 { return tblID; }
ActionTableId tblID
Definition: custcont.h:1045
void SetActionItem ( ActionItem pAction)
inline
Remarks
This method allows you to set the ActionItem.
Parameters
pActionA point to the ActionItem to set.
1035 { actionItem = pAction; }
ActionItem * actionItem
Definition: custcont.h:1053
ActionItem* GetActionItem ( )
inline
Remarks
This method returns a pointer to the ActionItem.
1037 { return actionItem; }
ActionItem * actionItem
Definition: custcont.h:1053
CoreExport BOOL IsActionButton ( )
inline
Remarks
This method returns TRUE if the button is an Action button. FALSE if it is not.
1041  { return macroType == MB_TYPE_ACTION_CUSTOM ||
#define MB_TYPE_ACTION
Definition: custcont.h:883
#define MB_TYPE_ACTION_CUSTOM
Definition: custcont.h:884
int macroType
Definition: custcont.h:1044

Member Data Documentation

int macroType
int cmdID
int macroScriptID
const MCHAR* label
const MCHAR* tip
const MCHAR* imageName
int imageID
ActionItem* actionItem
const MCHAR* iconName
DWORD flags