+ // Only allow toggle if returns TRUE. Call when left button up.
+ virtual bool OnLeftClick(int toolIndex, bool toggleDown);
+
+ // Call when right button down.
+ virtual void OnRightClick(int toolIndex, long x, long y);
+
+ // Called when the mouse cursor enters a tool bitmap.
+ // Argument is -1 if mouse is exiting the toolbar.
+ virtual void OnMouseEnter(int toolIndex);
+
+ // more deprecated functions
+ // -------------------------
+
+#if WXWIN_COMPATIBILITY
+ void SetDefaultSize(int w, int h) { SetDefaultSize(wxSize(w, h)); }
+ long GetDefaultWidth() const { return m_defaultWidth; }
+ long GetDefaultHeight() const { return m_defaultHeight; }
+ int GetDefaultButtonWidth() const { return (int) GetDefaultButtonSize().x; };
+ int GetDefaultButtonHeight() const { return (int) GetDefaultButtonSize().y; };
+ virtual void SetDefaultSize(const wxSize& size) { SetToolBitmapSize(size); }
+ virtual wxSize GetDefaultSize() const { return GetToolBitmapSize(); }
+ virtual wxSize GetDefaultButtonSize() const { return GetToolSize(); }
+ void GetMaxSize ( long * width, long * height ) const
+ { wxSize maxSize(GetMaxSize()); *width = maxSize.x; *height = maxSize.y; }
+#endif // WXWIN_COMPATIBILITY
+
+ // implementation only from now on
+ // -------------------------------
+
+ wxList& GetTools() const { return (wxList&) m_tools; }
+
+ // Lay the tools out
+ virtual void LayoutTools();
+
+ // Add all the buttons: required for Win95.
+ virtual bool CreateTools() { return TRUE; }
+
+ void Command(wxCommandEvent& event);
+
+ // SCROLLING: this has to be copied from wxScrolledWindow since wxToolBarBase
+ // inherits from wxControl. This could have been put into wxToolBarSimple,
+ // but we might want any derived toolbar class to be scrollable.
+
+ // Number of pixels per user unit (0 or -1 for no scrollbar)
+ // Length of virtual canvas in user units
+ virtual void SetScrollbars(int horizontal, int vertical,
+ int x_length, int y_length,
+ int x_pos = 0, int y_pos = 0);
+
+ // Physically scroll the window
+ virtual void Scroll(int x_pos, int y_pos);
+ virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
+ virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
+ virtual void AdjustScrollbars();
+
+ // Prepare the DC by translating it according to the current scroll position
+ virtual void PrepareDC(wxDC& dc);
+
+ int GetScrollPageSize(int orient) const ;
+ void SetScrollPageSize(int orient, int pageSize);
+
+ // Get the view start
+ virtual void ViewStart(int *x, int *y) const;
+
+ // Actual size in pixels when scrolling is taken into account
+ virtual void GetVirtualSize(int *x, int *y) const;
+
+ // Do the toolbar button updates (check for EVT_UPDATE_UI handlers)
+ virtual void DoToolbarUpdates();
+
+ // event handlers
+ void OnScroll(wxScrollEvent& event);
+ void OnSize(wxSizeEvent& event);
+ void OnIdle(wxIdleEvent& event);