bool IsActive() const;
/**
+ Set whether this tool has a drop down button.
+ This is only valid for wxITEM_NORMAL tools.
*/
void SetHasDropDown(bool b);
/**
-
+ Returns whether the toolbar item has an associated drop down button.
*/
bool HasDropDown() const;
void EnableTool(int tool_id, bool state);
bool GetToolEnabled(int tool_id) const;
+ /**
+ Set whether the specified toolbar item has a drop down button.
+
+ This is only valid for wxITEM_NORMAL tools.
+
+ @see wxAuiToolBarItem::SetHasDropDown()
+ */
void SetToolDropDown(int tool_id, bool dropdown);
+
+ /**
+ Returns whether the specified toolbar item has an associated drop down
+ button.
+
+ @see wxAuiToolBarItem::HasDropDown()
+ */
bool GetToolDropDown(int tool_id) const;
void SetToolBorderPadding(int padding);
if (!item)
return;
- item->m_dropDown = dropdown;
+ item->SetHasDropDown(dropdown);
}
bool wxAuiToolBar::GetToolDropDown(int tool_id) const
{
wxAuiToolBarItem* item = FindTool(tool_id);
if (!item)
- return 0;
+ return false;
- return item->m_dropDown;
+ return item->HasDropDown();
}
void wxAuiToolBar::SetToolSticky(int tool_id, bool sticky)
break;
}
- if (item.m_kind == wxITEM_SEPARATOR)
- {
- // draw a separator
- m_art->DrawSeparator(dc, this, item_rect);
- }
- else if (item.m_kind == wxITEM_LABEL)
- {
- // draw a text label only
- m_art->DrawLabel(dc, this, item, item_rect);
- }
- else if (item.m_kind == wxITEM_NORMAL)
- {
- // draw a regular button or dropdown button
- if (!item.m_dropDown)
- m_art->DrawButton(dc, this, item, item_rect);
- else
- m_art->DrawDropDownButton(dc, this, item, item_rect);
- }
- else if (item.m_kind == wxITEM_CHECK)
+ switch ( item.m_kind )
{
- // draw either a regular or dropdown toggle button
- if (!item.m_dropDown)
+ case wxITEM_NORMAL:
+ // draw a regular or dropdown button
+ if (!item.m_dropDown)
+ m_art->DrawButton(dc, this, item, item_rect);
+ else
+ m_art->DrawDropDownButton(dc, this, item, item_rect);
+ break;
+
+ case wxITEM_CHECK:
+ case wxITEM_RADIO:
+ // draw a toggle button
m_art->DrawButton(dc, this, item, item_rect);
- else
- m_art->DrawDropDownButton(dc, this, item, item_rect);
- }
- else if (item.m_kind == wxITEM_RADIO)
- {
- // draw a toggle button
- m_art->DrawButton(dc, this, item, item_rect);
- }
- else if (item.m_kind == wxITEM_CONTROL)
- {
- // draw the control's label
- m_art->DrawControlLabel(dc, this, item, item_rect);
+ break;
+
+ case wxITEM_SEPARATOR:
+ // draw a separator
+ m_art->DrawSeparator(dc, this, item_rect);
+ break;
+
+ case wxITEM_LABEL:
+ // draw a text label only
+ m_art->DrawLabel(dc, this, item, item_rect);
+ break;
+
+ case wxITEM_CONTROL:
+ // draw the control's label
+ m_art->DrawControlLabel(dc, this, item, item_rect);
+ break;
}
// fire a signal to see if the item wants to be custom-rendered