Class ToolButtonItem

3DS Max Plug-In SDK

Class ToolButtonItem

See Also: Class ToolItem, Class MAXBmpFileIcon, Custom Controls.

class ToolButtonItem : public ToolItem

Description:

This class describes the properties of a 3ds max custom toolbar button.

Note, you can use MaxBmpFileIcons on a toolbar button using the new constructor in custcont.h:

ToolButtonItem(ToolItemType t,

MaxBmpFileIcon* pIcon,

int iW, int iH, int wd,int ht,

int ID, DWORD hID=0, TCHAR *lbl = NULL,

int or = CTB_HORIZ|CTB_VERT|CTB_FLOAT)

Data Members:

public:

The following four data members (iOutEn, iInEn, iOutDis, iInDis) are indices into the image list. They indicate which images to use for each of the four possible button states. You may specify a unique image for each one of these states by passing a different index for each state. Or you may supply a single image to be used for all the states by specifying the same index four times.

int iOutEn

Out&Enabled.

int iInEn

In&Enabled.

int iOutDis

Out&Disabled.

int iInDis

In&Disabled.

int iw

The width of the button image.

int ih

The height of the button image.

TCHAR *label;

This data member is available in release 4.0 and later only.

The label describing the tool button item.

MaxBmpFileIcon *mpIcon;

This data member is available in release 4.0 and later only.

A pointer to the icon image associated with the button.

MaxBmpFileIcon *mpInIcon;

This data member is available in release 4.0 and later only.

A pointer to the in icon image associated with the button.

Methods:

Prototype:

ToolButtonItem(ToolItemType t, int iOE, int iIE, int iOD, int iID, int iW, int iH, int wd, int ht, int ID, DWORD hID=0, TCHAR *lbl = NULL, int or = CTB_HORIZ|CTB_VERT|CTB_FLOAT)

Remarks:

Constructor.

Parameters:

ToolItemType t

See List of Tool Item Types.

int iOE

The Out&Enabled index.

int iIE

The In&Enabled index.

int iOD

The Out&Disabled index.

int iID

The In&Disabled index.

int iW

The image width (size of the bitmap in the ImageList).

int iH

The image height (size of the bitmap in the ImageList).

int wd

The width of the button.

int ht

The height of the button.

int ID

The ID of the control.

DWORD hID=0

The help ID. For plug-in developers this id should be set to 0.

TCHAR *lbl = NULL

The label of the button.

int or = CTB_HORIZ|CTB_VERT|CTB_FLOAT

The allowable orientation of the item. This may be one or more of the following:

CTB_HORIZ - Horizontal

CTB_VERT - Vertical

CTB_FLOAT - Floating (not docked)

Prototype:

ToolButtonItem(ToolItemType t, MaxBmpFileIcon* pIcon, int iW, int iH, int wd,int ht, int ID, DWORD hID=0, TCHAR *lbl = NULL, int or = CTB_HORIZ|CTB_VERT|CTB_FLOAT);

Remarks:

This method is available in release 4.0 and later only.

Constructor.

Parameters:

ToolItemType t

See List of Tool Item Types.

MaxBmpFileIcon* pIcon

A pointer to the icon associated with the button.

int iW

The image width (size of the bitmap in the ImageList).

int iH

The image height (size of the bitmap in the ImageList).

int wd

The width of the button.

int ht

The height of the button.

int ID

The ID of the control.

DWORD hID=0

The help ID. For plug-in developers this id should be set to 0.

TCHAR *lbl = NULL

The label of the button.

int or = CTB_HORIZ|CTB_VERT|CTB_FLOAT

The orientation of the button item.

Prototype:

ToolButtonItem(ToolItemType t, MaxBmpFileIcon* pIcon, MaxBmpFileIcon* pInIcon, int iW, int iH, int wd,int ht, int ID, DWORD hID=0, TCHAR *lbl = NULL, int or = CTB_HORIZ|CTB_VERT|CTB_FLOAT);

Remarks:

This method is available in release 4.0 and later only.

Constructor.

Parameters:

ToolItemType t

See List of Tool Item Types.

MaxBmpFileIcon* pIcon

A pointer to the icon associated with the button.

MaxBmpFileIcon* pInIcon

A pointer to the in icon associated with the button.

int iW

The image width (size of the bitmap in the ImageList).

int iH

The image height (size of the bitmap in the ImageList).

int wd

The width of the button.

int ht

The height of the button.

int ID

The ID of the control.

DWORD hID=0

The help ID. For plug-in developers this id should be set to 0.

TCHAR *lbl = NULL

The label of the button.

int or = CTB_HORIZ|CTB_VERT|CTB_FLOAT

The orientation of the button item.