+// ----------------------------------------------------------------------------
+// wxToolBarBase geometry
+// ----------------------------------------------------------------------------
+
+void wxToolBarBase::SetMargins(int x, int y)
+{
+ m_xMargin = x;
+ m_yMargin = y;
+}
+
+void wxToolBarBase::SetRows(int WXUNUSED(nRows))
+{
+ // nothing
+}
+
+bool wxToolBarBase::IsVertical() const
+{
+ return HasFlag(wxTB_LEFT | wxTB_RIGHT);
+}
+
+
+// ----------------------------------------------------------------------------
+// event processing
+// ----------------------------------------------------------------------------
+
+// Only allow toggle if returns true
+bool wxToolBarBase::OnLeftClick(int toolid, bool toggleDown)
+{
+ wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, toolid);
+ event.SetEventObject(this);
+
+ // 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)
+ HandleWindowEvent(event);
+
+ return true;
+}
+
+// Call when right button down.
+void wxToolBarBase::OnRightClick(int toolid,
+ long WXUNUSED(x),
+ long WXUNUSED(y))
+{
+ wxCommandEvent event(wxEVT_COMMAND_TOOL_RCLICKED, toolid);
+ event.SetEventObject(this);
+ event.SetInt(toolid);
+
+ GetEventHandler()->ProcessEvent(event);
+}
+
+// Called when the mouse cursor enters a tool bitmap (no button pressed).
+// Argument is wxID_ANY if mouse is exiting the toolbar.
+// Note that for this event, the toolid of the window is used,
+// and the integer parameter of wxCommandEvent is used to retrieve
+// the tool toolid.
+void wxToolBarBase::OnMouseEnter(int toolid)
+{
+ wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, GetId());
+ event.SetEventObject(this);
+ event.SetInt(toolid);
+
+ wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
+ if ( frame )
+ {
+ wxString help;
+ if ( toolid != wxID_ANY )
+ {
+ const wxToolBarToolBase * const tool = FindById(toolid);
+ if ( tool )
+ help = tool->GetLongHelp();
+ }
+
+ // call DoGiveHelp() even if help string is empty to avoid showing the
+ // help for the previously selected tool when another one is selected
+ frame->DoGiveHelp(help, toolid != wxID_ANY);
+ }
+
+ (void)GetEventHandler()->ProcessEvent(event);
+}
+
+// ----------------------------------------------------------------------------
+// UI updates
+// ----------------------------------------------------------------------------
+