]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/tbargtk.cpp
don't give error messages if ws2_32.dll is not available in wxGetHostName()
[wxWidgets.git] / src / gtk / tbargtk.cpp
index 6adcd35417cf48a9857387e6bde01ae7a2369981..4755e17a0e16c75c2aca7d42daf8d82f878bd9ff 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "tbargtk.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/toolbar.h"
 
 #if wxUSE_TOOLBAR_NATIVE
@@ -136,7 +139,7 @@ protected:
 // wxWin macros
 // ----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxToolBarBase)
+IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
 
 // ============================================================================
 // implementation
@@ -181,7 +184,22 @@ static void gtk_toolbar_callback( GtkWidget *WXUNUSED(widget),
         }
     }
 
-    tbar->OnLeftClick( tool->GetId(), tool->IsToggled() );
+    if( !tbar->OnLeftClick( tool->GetId(), tool->IsToggled() ) && tool->CanBeToggled() )
+    {
+        // revert back
+        tool->Toggle();
+
+        wxBitmap bitmap = tool->GetBitmap();
+        if ( bitmap.Ok() )
+        {
+            GtkPixmap *pixmap = GTK_PIXMAP( tool->m_pixmap );
+
+            GdkBitmap *mask = bitmap.GetMask() ? bitmap.GetMask()->GetBitmap()
+                                               : (GdkBitmap *)NULL;
+
+            gtk_pixmap_set( pixmap, bitmap.GetPixmap(), mask );
+        }
+    }
 }
 
 //-----------------------------------------------------------------------------
@@ -255,6 +273,8 @@ void wxToolBar::Init()
     m_bg = (GdkColor *)NULL;
     m_toolbar = (GtkToolbar *)NULL;
     m_blockEvent = FALSE;
+    m_defaultWidth = 32;
+    m_defaultHeight = 32;
 }
 
 wxToolBar::~wxToolBar()