X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ac91b9d22aea519059b3f64adfba506d43aba639..29f7914424a7941e9374a5445f95574f2f041659:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index fb0f5bda35..318a701601 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -24,6 +24,8 @@ #include "wx/wx.h" #endif +#include "wx/frame.h" + // For ::UpdateWindow #ifdef __WXMSW__ #include @@ -53,7 +55,7 @@ wxToolBarTool::wxToolBarTool(wxToolBar *owner, int theIndex, const wxBitmap& theBitmap1, const wxBitmap& theBitmap2, bool toggle, wxObject *clientData, const wxString& helpS1, const wxString& helpS2, - GtkWidget *item ) + GtkWidget *pixmap ) #else wxToolBarTool::wxToolBarTool(int theIndex, const wxBitmap& theBitmap1, const wxBitmap& theBitmap2, bool toggle, @@ -63,7 +65,8 @@ wxToolBarTool::wxToolBarTool(int theIndex, m_toolStyle = wxTOOL_STYLE_BUTTON; #ifdef __WXGTK__ m_owner = owner; - m_item = item; + m_pixmap = pixmap; + m_item = (GtkWidget*) NULL; m_clientData = clientData; m_x = 0; m_y = 0; @@ -147,6 +150,7 @@ bool wxToolBarBase::OnLeftClick(int toolIndex, bool toggleDown) event.SetEventObject(this); event.SetExtraLong((long) toggleDown); + // Send events to this toolbar instead (and thence up the window hierarchy) GetEventHandler()->ProcessEvent(event); return TRUE; @@ -217,6 +221,7 @@ wxToolBarTool *wxToolBarBase::AddTool(int index, const wxBitmap& bitmap, const w void wxToolBarBase::AddSeparator () { wxToolBarTool *tool = new wxToolBarTool; + tool->m_index = -1; tool->m_toolStyle = wxTOOL_STYLE_SEPARATOR; m_tools.Append(-1, tool); } @@ -394,7 +399,7 @@ void wxToolBarBase::Command(wxCommandEvent& WXUNUSED(event)) { } -void wxToolBarBase::Layout() +void wxToolBarBase::LayoutTools() { } @@ -720,7 +725,13 @@ void wxToolBarBase::ViewStart (int *x, int *y) const *y = m_yScrollPosition; } -void wxToolBarBase::OnIdle(wxIdleEvent& WXUNUSED(event)) +void wxToolBarBase::OnIdle(wxIdleEvent& +#ifdef __WXGTK__ + WXUNUSED(event) +#else + event +#endif + ) { #ifndef __WXGTK__ wxWindow::OnIdle(event); @@ -732,6 +743,8 @@ void wxToolBarBase::OnIdle(wxIdleEvent& WXUNUSED(event)) // Do the toolbar button updates (check for EVT_UPDATE_UI handlers) void wxToolBarBase::DoToolbarUpdates() { + wxEvtHandler* evtHandler = GetEventHandler() ; + wxNode* node = GetTools().First(); while (node) { @@ -740,7 +753,7 @@ void wxToolBarBase::DoToolbarUpdates() wxUpdateUIEvent event(tool->m_index); event.SetEventObject(this); - if (GetEventHandler()->ProcessEvent(event)) + if (evtHandler->ProcessEvent(event)) { if (event.GetSetEnabled()) EnableTool(tool->m_index, event.GetEnabled()); @@ -756,12 +769,4 @@ void wxToolBarBase::DoToolbarUpdates() } } -#ifdef __WXMSW__ -// Circumvent wxControl::MSWOnMouseMove which doesn't set the cursor. -void wxToolBarBase::MSWOnMouseMove(int x, int y, WXUINT flags) -{ - wxWindow::MSWOnMouseMove(x, y, flags); -} -#endif - #endif