From: Vadim Zeitlin Date: Sat, 14 May 2011 14:18:14 +0000 (+0000) Subject: Correct the drawing of check tools with a drop down button in wxAuiToolBar. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/026c6eff708c867efe9eca35e41bf82b58ba1c1a Correct the drawing of check tools with a drop down button in wxAuiToolBar. This combination was simply not covered by the existing code, add the missing DrawDropDownButton() call. Closes #11139. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 8715e6a456..9d86d69a0c 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -463,6 +463,15 @@ void wxAuiDefaultToolBarArt::DrawDropDownButton( dc.DrawRectangle(button_rect); dc.DrawRectangle(dropdown_rect); } + else if (item.GetState() & wxAUI_BUTTON_STATE_CHECKED) + { + // Notice that this branch must come after the hover one to ensure the + // correct appearance when the mouse hovers over a checked item. + dc.SetPen(wxPen(m_highlight_colour)); + dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(170))); + dc.DrawRectangle(button_rect); + dc.DrawRectangle(dropdown_rect); + } wxBitmap bmp; wxBitmap dropbmp; @@ -2444,8 +2453,11 @@ void wxAuiToolBar::OnPaint(wxPaintEvent& WXUNUSED(evt)) } else if (item.kind == wxITEM_CHECK) { - // draw a toggle button - m_art->DrawButton(dc, this, item, item_rect); + // draw either a regular or dropdown toggle button + if (!item.dropdown) + m_art->DrawButton(dc, this, item, item_rect); + else + m_art->DrawDropDownButton(dc, this, item, item_rect); } else if (item.kind == wxITEM_RADIO) {