return (result ? true : false);
}
+bool ToolBar::getButtonRect(int nIndex, LPRECT buttonRect) {
+ int result = SendMessage(getHandle(), TB_GETITEMRECT,
+ nIndex, (LPARAM)buttonRect);
+ return (result ? true : false);
+}
+
bool ToolBar::setButtonSize(int width, int height) {
assert(width > 0);
assert(height > 0);
}
return false;
}
+
+void ToolBar::autoSize() {
+ SendMessage(getHandle(), TB_AUTOSIZE, 0, 0);
+}
// pressButton() presses or releases the specified button in the toolbar.
bool pressButton(int idButton, bool press);
+ // getButtonRect() gets the bounding rectangle of a button in a toolbar.
+ bool getButtonRect(int nIndex, LPRECT buttonRect);
+
// setButtonSize() sets the size of the buttons to be added to a toolbar.
// Button size must be largen the button bitmap.
bool setButtonSize(int width, int height);
+
+
+ // autoSize() resizes the toolbar window.
+ void autoSize();
// getHandle() returns handle to a toolbar window.
HWND getHandle() { return hwndToolBar; }