]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
compilation fixes - wxGTK compiles but not links
[wxWidgets.git] / src / common / tbarbase.cpp
index d904ff91949b1412732f40df617a08c293fc47f7..04b15b075ddc65b29849f49ef5977f8213a44f13 100644 (file)
@@ -28,6 +28,8 @@
     #pragma hdrstop
 #endif
 
+#if wxUSE_TOOLBAR
+
 #ifndef WX_PRECOMP
     #include "wx/wx.h"
 #endif
 #include <windows.h>
 #endif
 
-#if wxUSE_TOOLBAR
-
 #include "wx/tbarbase.h"
 
 // ----------------------------------------------------------------------------
 // wxWindows macros
 // ----------------------------------------------------------------------------
 
-#if !USE_SHARED_LIBRARY
-    BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
-        EVT_IDLE(wxToolBarBase::OnIdle)
-    END_EVENT_TABLE()
-#endif
-
 IMPLEMENT_CLASS(wxToolBarBase, wxControl)
 
+BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
+    EVT_IDLE(wxToolBarBase::OnIdle)
+END_EVENT_TABLE()
+
 #include "wx/listimpl.cpp"
 
 WX_DEFINE_LIST(wxToolBarToolsList);
@@ -470,7 +468,12 @@ bool wxToolBarBase::OnLeftClick(int id, bool toggleDown)
 {
     wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, id);
     event.SetEventObject(this);
-    event.SetExtraLong((long) toggleDown);
+
+    // we use SetInt() to make wxCommandEvent::IsChecked() return toggleDown
+    event.SetInt((int)toggleDown);
+
+    // and SetExtraLong() for backwards compatibility
+    event.SetExtraLong((long)toggleDown);
 
     // Send events to this toolbar instead (and thence up the window hierarchy)
     GetEventHandler()->ProcessEvent(event);