]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/buttonbar.cpp
Added logic, API and docs for wxDataViewModel::HasDefaultCompare indicating a compare...
[wxWidgets.git] / src / generic / buttonbar.cpp
index 49e3210bb9b96dbb4939e545de6b7b61eef4b71a..512352bf79414e16c7161902bf1ec0a910f386e7 100644 (file)
     #include "wx/frame.h"
     #include "wx/dcclient.h"
     #include "wx/settings.h"
     #include "wx/frame.h"
     #include "wx/dcclient.h"
     #include "wx/settings.h"
+    #include "wx/image.h"
 #endif
 
 #endif
 
-#include "wx/image.h"
-
 // ----------------------------------------------------------------------------
 // wxButtonToolBarTool: our implementation of wxToolBarToolBase
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxButtonToolBarTool: our implementation of wxToolBarToolBase
 // ----------------------------------------------------------------------------
@@ -67,8 +66,10 @@ public:
         m_button = NULL;
     }
 
         m_button = NULL;
     }
 
-    wxButtonToolBarTool(wxButtonToolBar *tbar, wxControl *control)
-        : wxToolBarToolBase(tbar, control)
+    wxButtonToolBarTool(wxButtonToolBar *tbar,
+                        wxControl *control,
+                        const wxString& label)
+        : wxToolBarToolBase(tbar, control, label)
     {
         m_x = m_y = wxDefaultCoord;
         m_width =
     {
         m_x = m_y = wxDefaultCoord;
         m_width =
@@ -272,9 +273,10 @@ wxToolBarToolBase *wxButtonToolBar::CreateTool(int id,
                              clientData, shortHelp, longHelp);
 }
 
                              clientData, shortHelp, longHelp);
 }
 
-wxToolBarToolBase *wxButtonToolBar::CreateTool(wxControl *control)
+wxToolBarToolBase *wxButtonToolBar::CreateTool(wxControl *control,
+                                               const wxString& label)
 {
 {
-    return new wxButtonToolBarTool(this, control);
+    return new wxButtonToolBarTool(this, control, label);
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -352,7 +354,7 @@ bool wxButtonToolBar::Realize()
     m_needsLayout = true;
     DoLayout();
 
     m_needsLayout = true;
     DoLayout();
 
-    SetBestSize(wxSize(m_maxWidth, m_maxHeight));
+    SetInitialSize(wxSize(m_maxWidth, m_maxHeight));
 
     return true;
 }
 
     return true;
 }
@@ -547,7 +549,7 @@ void wxButtonToolBar::OnLeftUp(wxMouseEvent& event)
         {
             wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, tool->GetId());
             event.SetEventObject(tool->GetButton());
         {
             wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, tool->GetId());
             event.SetEventObject(tool->GetButton());
-            if (!ProcessEvent(event))
+            if (!GetEventHandler()->ProcessEvent(event))
                 event.Skip();
         }
     }
                 event.Skip();
         }
     }