X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a29fe70bc90b08b4f0bd4c23c1d12ad17cbbed2..13b4df952c77383f50696e51fcbaa2d8bbd3b3b9:/src/aui/auibar.cpp?ds=sidebyside diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index fab0b5d247..d9bb3046b4 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -655,14 +655,13 @@ void wxAuiDefaultToolBarArt::DrawGripper(wxDC& dc, } void wxAuiDefaultToolBarArt::DrawOverflowButton(wxDC& dc, - wxWindow* wnd, + wxWindow* /*wnd*/, const wxRect& rect, int state) { if (state & wxAUI_BUTTON_STATE_HOVER || state & wxAUI_BUTTON_STATE_PRESSED) { - wxRect cli_rect = wnd->GetClientRect(); wxColor light_gray_bg = m_highlightColour.ChangeLightness(170); if (m_flags & wxAUI_TB_VERTICAL) @@ -1665,8 +1664,9 @@ wxSize wxAuiToolBar::GetHintSize(int dock_direction) const case wxAUI_DOCK_LEFT: return m_vertHintSize; default: - wxCHECK_MSG(false, wxDefaultSize, "invalid dock location value"); + wxFAIL_MSG("invalid dock location value"); } + return wxDefaultSize; } bool wxAuiToolBar::IsPaneValid(const wxAuiPaneInfo& pane) const @@ -2150,7 +2150,7 @@ void wxAuiToolBar::DoIdleUpdate() { bool is_enabled; if (item.m_window) - is_enabled = item.m_window->IsEnabled(); + is_enabled = item.m_window->IsThisEnabled(); else is_enabled = (item.m_state & wxAUI_BUTTON_STATE_DISABLED) ? false : true; @@ -2338,11 +2338,19 @@ void wxAuiToolBar::OnIdle(wxIdleEvent& evt) } } } - - DoIdleUpdate(); evt.Skip(); } +void wxAuiToolBar::UpdateWindowUI(long flags) +{ + if ( flags & wxUPDATE_UI_FROMIDLE ) + { + DoIdleUpdate(); + } + + wxControl::UpdateWindowUI(flags); +} + void wxAuiToolBar::OnPaint(wxPaintEvent& WXUNUSED(evt)) { wxAutoBufferedPaintDC dc(this); @@ -2679,15 +2687,12 @@ void wxAuiToolBar::OnRightUp(wxMouseEvent& evt) if (m_actionItem && hitItem == m_actionItem) { - if (hitItem->m_kind == wxITEM_NORMAL) - { - wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, m_actionItem->m_toolId); - e.SetEventObject(this); - e.SetToolId(m_actionItem->m_toolId); - e.SetClickPoint(m_actionPos); - GetEventHandler()->ProcessEvent(e); - DoIdleUpdate(); - } + wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, m_actionItem->m_toolId); + e.SetEventObject(this); + e.SetToolId(m_actionItem->m_toolId); + e.SetClickPoint(m_actionPos); + GetEventHandler()->ProcessEvent(e); + DoIdleUpdate(); } else {