- DECLARE_DYNAMIC_CLASS(wxToolBarBase)
- public:
-
- wxToolBarBase(void);
- ~wxToolBarBase(void);
-
- // Handle wxToolBar events
-
- // 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);
-
- // If pushedBitmap is NULL, a reversed version of bitmap is
- // created and used as the pushed/toggled image.
- // If toggle is TRUE, the button toggles between the two states.
- virtual wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
- bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
- const wxString& helpString1 = "", const wxString& helpString2 = "");
- virtual void AddSeparator(void);
- virtual void ClearTools(void);
-
- virtual void EnableTool(int toolIndex, bool enable);
- virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
- virtual void SetToggle(int toolIndex, bool toggle); // Set this to be togglable (or not)
- virtual wxObject *GetToolClientData(int index) const;
- inline wxList& GetTools(void) const { return (wxList&) m_tools; }
-
- // After the toolbar has initialized, this is the size the tools take up
-#if WXWXIN_COMPATIBILITY
- inline void GetMaxSize ( long * width, long * height ) const
- { wxSize maxSize(GetMaxSize()); *width = maxSize.x; *height = maxSize.y; }
-#endif
- virtual wxSize GetMaxSize ( void ) const;
+public:
+ wxToolBarBase();
+ ~wxToolBarBase();
+
+ // toolbar construction
+ // --------------------
+
+ // If pushedBitmap is NULL, a reversed version of bitmap is created and
+ // used as the pushed/toggled image. If toggle is TRUE, the button toggles
+ // between the two states.
+ virtual wxToolBarTool *AddTool(int toolIndex,
+ const wxBitmap& bitmap,
+ const wxBitmap& pushedBitmap = wxNullBitmap,
+ bool toggle = FALSE,
+ wxCoord xPos = -1,
+ wxCoord yPos = -1,
+ wxObject *clientData = NULL,
+ const wxString& helpString1 = wxEmptyString,
+ const wxString& helpString2 = wxEmptyString);
+
+ // add an arbitrary control to the toolbar at given index, return TRUE if
+ // ok (notice that the control will be deleted by the toolbar and that it
+ // will also adjust its position/size)
+ //
+ // NB: the control should have toolbar as its parent
+ virtual bool AddControl(wxControl * WXUNUSED(control)) { return FALSE; }
+
+ virtual void AddSeparator();
+ virtual void ClearTools();
+
+ // must be called after all buttons have been created to finish toolbar
+ // initialisation
+ virtual bool Realize() = 0;
+
+ // tools state
+ // -----------
+
+ virtual void EnableTool(int toolIndex, bool enable);
+
+ // toggle is TRUE if toggled on
+ virtual void ToggleTool(int toolIndex, bool toggle);
+
+ // Set this to be togglable (or not)
+ virtual void SetToggle(int toolIndex, bool toggle);
+ virtual wxObject *GetToolClientData(int index) const;