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

#include <custcont.h>

+ 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)
 
 MacroButtonData (const MacroButtonData &other)
 
CoreExport ~MacroButtonData ()
 
CoreExport MacroButtonDataoperator= (const MacroButtonData &mbd)
 
CoreExport void SetLabel (const MCHAR *lbl)
 
const MCHARGetLabel () const
 
CoreExport void SetTip (const MCHAR *tp)
 
const MCHARGetTip () const
 
void SetCmdID (int id)
 
int GetCmdID () const
 
void SetScriptID (int id)
 
int GetScriptID () const
 
CoreExport void SetImageName (const MCHAR *imName)
 
const MCHARGetImageName () const
 
void SetImageID (int id)
 
int GetImageID () const
 
CoreExport void SetIconName (const MCHAR *iconName)
 
const MCHARGetIconName () const
 
void SetTblID (ActionTableId id)
 
ActionTableId GetTblID () const
 
void SetActionItem (ActionItem *pAction)
 
ActionItemGetActionItem ()
 
CoreExport BOOL IsActionButton () const
 

Public Attributes

int macroType = 0
 
ActionTableId tblID = 0
 
int cmdID = 0
 
int macroScriptID = 0
 
const MCHARlabel = nullptr
 
const MCHARtip = nullptr
 
const MCHARimageName = nullptr
 
int imageID = 0
 
ActionItemactionItem = nullptr
 
const MCHARiconName = nullptr
 
DWORD flags = 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.
 

Detailed 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

Constructor & Destructor Documentation

◆ MacroButtonData() [1/4]

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 * imageName
Definition: custcont.h:1058
const MCHAR * iconName
Definition: custcont.h:1061
const MCHAR * tip
Definition: custcont.h:1056
int imageID
Definition: custcont.h:1059
const MCHAR * label
Definition: custcont.h:1055

◆ MacroButtonData() [2/4]

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);

◆ MacroButtonData() [3/4]

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;
974
975 }
CoreExport void SetTip(const MCHAR *tp)
int macroType
Definition: custcont.h:1051
CoreExport void SetLabel(const MCHAR *lbl)
CoreExport void SetImageName(const MCHAR *imName)
int macroScriptID
Definition: custcont.h:1054
#define MB_TYPE_SCRIPT
Definition: custcont.h:882

◆ MacroButtonData() [4/4]

MacroButtonData ( const MacroButtonData other)
inline
978 {
979 *this = other;
980 }

◆ ~MacroButtonData()

Remarks
Destructor. Any label, tooltip or image name strings are deleted.

Member Function Documentation

◆ operator=()

CoreExport MacroButtonData & operator= ( const MacroButtonData mbd)
Remarks
Assignment operator.

◆ SetLabel()

CoreExport void SetLabel ( const MCHAR lbl)
Remarks
Sets the label text.
Parameters
lblThe label to set.

◆ GetLabel()

const MCHAR * GetLabel ( ) const
inline
Remarks
Returns the label text.
992{ return label; }

◆ SetTip()

CoreExport void SetTip ( const MCHAR tp)
Remarks
Sets the tooltip text.
Parameters
tpThe text to set.

◆ GetTip()

const MCHAR * GetTip ( ) const
inline
Remarks
Returns the tooltip text.
997{ return tip; }

◆ SetCmdID()

void SetCmdID ( int  id)
inline
Remarks
Sets the command ID.
Parameters
idThe command ID to set.
1000{ cmdID = id; }
int cmdID
Definition: custcont.h:1053

◆ GetCmdID()

int GetCmdID ( ) const
inline
Remarks
Returns the command ID.
1002{ return cmdID; }

◆ SetScriptID()

void SetScriptID ( int  id)
inline
Remarks
Sets the script ID.
Parameters
idThe script ID to set.
1005{ macroScriptID = id; }

◆ GetScriptID()

int GetScriptID ( ) const
inline
Remarks
Returns the script ID.
1007{ return macroScriptID; }

◆ SetImageName()

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.

◆ GetImageName()

const MCHAR * GetImageName ( ) const
inline
Remarks
Returns the image name.
1013{ return imageName; }

◆ SetImageID()

void SetImageID ( int  id)
inline
Remarks
Sets the image ID.
Parameters
idThe image ID to set.
1016{ imageID = id; }

◆ GetImageID()

int GetImageID ( ) const
inline
Remarks
Returns the image ID.
1018{ return imageID; }

◆ SetIconName()

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 )

◆ GetIconName()

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 )
1029{ return iconName; }

◆ SetTblID()

void SetTblID ( ActionTableId  id)
inline
Remarks
This method sets the ActionTableID ID.
Parameters
idThe ActionTableID ID to set.
1034{ tblID = id; }
ActionTableId tblID
Definition: custcont.h:1052

◆ GetTblID()

ActionTableId GetTblID ( ) const
inline
Remarks
This method returns the ActionTableID ID.
1036{ return tblID; }

◆ SetActionItem()

void SetActionItem ( ActionItem pAction)
inline
Remarks
This method allows you to set the ActionItem.
Parameters
pActionA point to the ActionItem to set.
1040{ actionItem = pAction; }
ActionItem * actionItem
Definition: custcont.h:1060

◆ GetActionItem()

ActionItem * GetActionItem ( )
inline
Remarks
This method returns a pointer to the ActionItem.
1042{ return actionItem; }

◆ IsActionButton()

CoreExport BOOL IsActionButton ( ) const
inline
Remarks
This method returns TRUE if the button is an Action button. FALSE if it is not.
1047 {
1049 }
#define MB_TYPE_ACTION
Definition: custcont.h:883
#define MB_TYPE_ACTION_CUSTOM
Definition: custcont.h:884

Member Data Documentation

◆ macroType

int macroType = 0

◆ tblID

ActionTableId tblID = 0

◆ cmdID

int cmdID = 0

◆ macroScriptID

int macroScriptID = 0

◆ label

const MCHAR* label = nullptr

◆ tip

const MCHAR* tip = nullptr

◆ imageName

const MCHAR* imageName = nullptr

◆ imageID

int imageID = 0

◆ actionItem

ActionItem* actionItem = nullptr

◆ iconName

const MCHAR* iconName = nullptr

◆ flags

DWORD flags = 0