Detailed Description
- See also:
- Custom Controls. Class
ToolItem, Class
MacroButtonData, Class CUIFrameMsgHandler, Class
ICustStatusEdit, Class
ICustStatus,
Class ICustButton.
- Description:
- This control allows the creation of toolbars containing buttons
(push, check, and fly-offs), status fields, separators (spacers),
and other Windows or user defined controls.
\ The standard size for 3ds Max toolbar button icons is 16x15 or
16x16 pixels.
In 3ds Max 3.0 and later toolbars may have multiple rows, or appear
vertically. They may also have macro buttons (added with the
MacroButtonData class) which may
have icons or text.
To initialize the pointer to the control call:
ICustToolbar *GetICustToolbar(HWND
hCtrl);
To release the control call:
ReleaseICustToolbar(ICustToolbar *ict);
The value to use in the Class field of the Custom Control Properties dialog is:
CustToolbar
Note: The TB_RIGHTCLICK message is sent when the user right clicks
in open space on a toolbar:
Also Note: To add tooltips to the toolbar controls you can do so by
capturing the WM_NOTIFY message in the dialog proc. For complete
sample code see /MAXSDK/SAMPLES/HOWTO/CUSTCTRL/CUSTCTRL.CPP.
The specific message is processed as shown below.
case WM_NOTIFY:
if(((LPNMHDR)lParam)->code == TTN_NEEDTEXT) {
LPTOOLTIPTEXT lpttt;
lpttt = (LPTOOLTIPTEXT)lParam;
switch (lpttt->hdr.idFrom) {
case ID_TB_1:
lpttt->lpszText = _M("Do Nothing Up");
break;
case ID_TB_2:
lpttt->lpszText = _M("Do Nothing Down");
break;
case ID_TB_3:
lpttt->lpszText = _M("Do Nothing Lock");
break;
case IDC_BUTTON1:
if (to->custCtrlButtonC->IsChecked())
lpttt->lpszText = _M("Button Checked");
else
lpttt->lpszText = _M("Button Un-Checked");
break;
};
}
break;
#include <custcont.h>
List of all
members.
Member Function Documentation
virtual void SetImage |
( |
HIMAGELIST |
hImage |
) |
[pure virtual] |
- Parameters:
- HIMAGELIST hImage
The image list. An image list is a collection of same-sized images,
each of which can be referred to by an index. Image lists are used
to efficiently manage large sets of icons or bitmaps in Windows.
All images in an image list are contained in a single, wide bitmap
in screen device format. An image list may also include a
monochrome bitmap that contains masks used to draw images
transparently (icon style). The Windows API provides image list
functions, which enable you to draw images, create and destroy
image lists, add and remove images, replace images, and merge
images.
virtual void AddTool |
( |
ToolItem & |
entry, |
|
|
int |
pos = -1 |
|
) |
|
[pure virtual] |
- Parameters:
- const ToolItem& entry
Describes the item to add to the toolbar.
int pos=-1
Controls where the added tool is inserted. The default of -1
indicates the control will be added at the right end of the
toolbar.
virtual void AddTool2 |
( |
ToolItem & |
entry, |
|
|
int |
pos = -1 |
|
) |
|
[pure virtual] |
- Parameters:
- ToolItem&
entry
Describes the item to add to the toolbar.
int pos=-1
Controls where the added tool is inserted. The default of -1
indicates the control will be added at the right end of the
toolbar.
virtual void DeleteTools |
( |
int |
start, |
|
|
int |
num = -1 |
|
) |
|
[pure virtual] |
- Parameters:
- int start
Specifies which tool is the first to be deleted.
int num=-1
Specifies the number of tools to delete. If this parameter is -1
(the default) it deletes 'start' through count-1 tools.
virtual void SetBottomBorder |
( |
BOOL |
on |
) |
[pure virtual] |
- Parameters:
- BOOL on
TRUE to draw the border; FALSE for no border.
virtual void SetTopBorder |
( |
BOOL |
on |
) |
[pure virtual] |
- Parameters:
- BOOL on
TRUE to draw the border; FALSE for no border.
virtual int GetNeededWidth |
( |
int |
rows |
) |
[pure virtual] |
- Parameters:
- int rows
The number of rows.
virtual void SetNumRows |
( |
int |
rows |
) |
[pure virtual] |
- Parameters:
- int rows
The number of rows to set.
virtual ICustButton* GetICustButton |
( |
int |
id |
) |
[pure virtual] |
- Parameters:
- int id
Specifies the id of the toolbar button.
- Returns:
- A pointer to one of the toolbar's buttons. If the button is not
found it returns NULL. See Class ICustButton.
virtual ICustStatus* GetICustStatus |
( |
int |
id |
) |
[pure virtual] |
- Parameters:
- int id
Specifies the id of the toolbar button.
- Returns:
- A pointer to one of the toolbars status controls. See Class
ICustStatus.
virtual HWND GetItemHwnd |
( |
int |
id |
) |
[pure virtual] |
- Parameters:
- int id
Specifies the id of the toolbar button.
virtual int GetNumItems |
( |
|
) |
[pure virtual] |
virtual int GetItemID |
( |
int |
index |
) |
[pure virtual] |
- Parameters:
- int index
Specifies which toolbar item to return the id of. This is an index
between 0 and GetNumItems()-1.
- Returns:
- When the button is added using Class
ToolButtonItem this is the id that is part of that structure.
When the user operates a tool the dialog proc get a
WM_COMMAND message and this is also the id in
LOWORD(wParam).
virtual int FindItem |
( |
int |
id |
) |
[pure virtual] |
- Parameters:
- int id
The id of the control to find.
virtual void DeleteItemByID |
( |
int |
id |
) |
[pure virtual] |
- Parameters:
- int id
The id of the control to delete.
virtual void LinkToCUIFrame |
( |
HWND |
hCUIFrame, |
|
|
CUIFrameMsgHandler
* |
msgHandler |
|
) |
|
[pure virtual] |
- Parameters:
- HWND hCUIFrame
The window handle of the CUI frame to link this toolbar to.
CUIFrameMsgHandler
*msgHandler
Points to the message handler for the CUI frame. See Class
CUIFrameMsgHandler.
virtual void GetFloatingCUIFrameSize |
( |
SIZE * |
sz, |
|
|
int |
rows = 1 |
|
) |
|
[pure virtual] |
- Parameters:
- SIZE *sz
The computed size is returned here. sz.cx is the width,
sz.cy is the height.
int rows=1
The number of rows for the toolbar used in the computation.
- Parameters:
- int id
Specifies the id of the toolbar button.
virtual void ResetIconImages |
( |
|
) |
[pure virtual] |
ICustToolbar ICustToolbar ICustToolbar
ICustToolbar ICustToolbar ICustToolbar ICustToolbar ICustToolbar
ICustToolbar ICustToolbar
ICustToolbar ICustToolbar ICustToolbar
ICustToolbar ICustToolbar ICustToolbar ICustToolbar ICustToolbar
ICustToolbar ICustToolbar