Public Member Functions | Public Attributes

MacroButtonData Class Reference

Search for all occurrences

Detailed Description

See also:
Class ToolMacroItem, Class MacroEntry, Class MacroDir, Class ICustButton, Class ICustomControl, Class ActionItem, User Interface Customization.

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

#include <custcont.h>

Inheritance diagram for MacroButtonData:
Inheritance graph
[legend]

List of all members.

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 MacroButtonData operator= (const MacroButtonData &mbd)
CoreExport void  SetLabel (const MCHAR *lbl)
const MCHAR *  GetLabel ()
CoreExport void  SetTip (const MCHAR *tp)
MCHAR *  GetTip ()
void  SetCmdID (int id)
int  GetCmdID ()
void  SetScriptID (int id)
int  GetScriptID ()
CoreExport void  SetImageName (const MCHAR *imName)
const MCHAR *  GetImageName ()
void  SetImageID (int id)
int  GetImageID ()
void  SetTblID (ActionTableId id)
ActionTableId  GetTblID ()
void  SetActionItem (ActionItem *pAction)
ActionItem GetActionItem ()
CoreExport BOOL  IsActionButton ()

Public Attributes

int  macroType
ActionTableId  tblID
int  cmdID
int  macroScriptID
MCHAR *  label
MCHAR *  tip
MCHAR *  imageName
int  imageID
ActionItem actionItem
DWORD  flags

Constructor & Destructor Documentation

CoreExport MacroButtonData ( ) [inline]
Remarks:
Constructor. The data members are initialized as follows:

label = tip = imageName = NULL; imageID = -1;
{ label = tip = imageName = NULL; imageID = -1; }
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);
        {
            macroType=MB_TYPE_SCRIPT; macroScriptID=msID; imageID=imID; 
            label=NULL; SetLabel(lbl); tip=NULL; SetTip(tp); imageName=NULL; SetImageName(imName);
        }
CoreExport ~MacroButtonData ( )
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:
lbl The label to set.
const MCHAR* GetLabel ( ) [inline]
Remarks:
Returns the label text.
{ return label; }
CoreExport void SetTip ( const MCHAR *  tp )
Remarks:
Sets the tooltip text.
Parameters:
tp The text to set.
MCHAR* GetTip ( ) [inline]
Remarks:
Returns the tooltip text.
{ return tip; }
void SetCmdID ( int  id ) [inline]
Remarks:
Sets the command ID.
Parameters:
id The command ID to set.
{ cmdID = id; }
int GetCmdID ( ) [inline]
Remarks:
Returns the command ID.
{ return cmdID; }
void SetScriptID ( int  id ) [inline]
Remarks:
Sets the script ID.
Parameters:
id The script ID to set.
{ macroScriptID = id; }
int GetScriptID ( ) [inline]
Remarks:
Returns the script ID.
{ return macroScriptID; }
CoreExport void SetImageName ( const MCHAR *  imName )
Remarks:
Sets the image name. See the imageName data member above for details on the name format.
Parameters:
imName The name to set.
const MCHAR* GetImageName ( ) [inline]
Remarks:
Returns the image name.
{ return imageName; }
void SetImageID ( int  id ) [inline]
Remarks:
Sets the image ID.
Parameters:
id The image ID to set.
{ imageID = id; }
int GetImageID ( ) [inline]
Remarks:
Retuns the image ID.
{ return imageID; }
void SetTblID ( ActionTableId  id ) [inline]
Remarks:
This method sets the ActionTableID ID.
Parameters:
id The ActionTableID ID to set.
{ tblID = id; }
ActionTableId GetTblID ( ) [inline]
Remarks:
This method returns the ActionTableID ID.
{ return tblID; }
void SetActionItem ( ActionItem pAction ) [inline]
Remarks:
This method allows you to set the ActionItem.
Parameters:
pAction A point to the ActionItem to set.
{ actionItem = pAction; }
ActionItem* GetActionItem ( ) [inline]
Remarks:
This method returns a pointer to the ActionItem.
{ return actionItem; }
CoreExport BOOL IsActionButton ( ) [inline]
Remarks:
This method returns TRUE if the button is an Action button. FALSE if it is not.
                                     { return macroType == MB_TYPE_ACTION_CUSTOM ||
                                           macroType == MB_TYPE_ACTION; }

Member Data Documentation

int macroType
ActionTableId tblID
int cmdID
MCHAR* label
MCHAR* tip
MCHAR* imageName
int imageID
DWORD flags

MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData
MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData MacroButtonData