| 1 | ///////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: tbargtk.h |
| 3 | // Purpose: GTK toolbar |
| 4 | // Author: Robert Roebling |
| 5 | // RCS-ID: $Id$ |
| 6 | // Copyright: (c) Robert Roebling |
| 7 | // Licence: wxWindows licence |
| 8 | ///////////////////////////////////////////////////////////////////////////// |
| 9 | |
| 10 | #ifndef _WX_GTK_TBARGTK_H_ |
| 11 | #define _WX_GTK_TBARGTK_H_ |
| 12 | |
| 13 | #ifdef __GNUG__ |
| 14 | #pragma interface "tbargtk.h" |
| 15 | #endif |
| 16 | |
| 17 | #if wxUSE_TOOLBAR |
| 18 | |
| 19 | // ---------------------------------------------------------------------------- |
| 20 | // wxToolBar |
| 21 | // ---------------------------------------------------------------------------- |
| 22 | |
| 23 | class wxToolBar : public wxToolBarBase |
| 24 | { |
| 25 | public: |
| 26 | // construction/destruction |
| 27 | wxToolBar() { Init(); } |
| 28 | wxToolBar( wxWindow *parent, |
| 29 | wxWindowID id, |
| 30 | const wxPoint& pos = wxDefaultPosition, |
| 31 | const wxSize& size = wxDefaultSize, |
| 32 | long style = 0, |
| 33 | const wxString& name = wxToolBarNameStr ) |
| 34 | { |
| 35 | Init(); |
| 36 | |
| 37 | Create(parent, id, pos, size, style, name); |
| 38 | } |
| 39 | |
| 40 | bool Create( wxWindow *parent, |
| 41 | wxWindowID id, |
| 42 | const wxPoint& pos = wxDefaultPosition, |
| 43 | const wxSize& size = wxDefaultSize, |
| 44 | long style = 0, |
| 45 | const wxString& name = wxToolBarNameStr ); |
| 46 | |
| 47 | virtual ~wxToolBar(); |
| 48 | |
| 49 | // override base class virtuals |
| 50 | virtual void SetMargins(int x, int y); |
| 51 | virtual void SetToolSeparation(int separation); |
| 52 | |
| 53 | virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; |
| 54 | |
| 55 | // implementation from now on |
| 56 | // -------------------------- |
| 57 | |
| 58 | GtkToolbar *m_toolbar; |
| 59 | |
| 60 | GdkColor *m_fg; |
| 61 | GdkColor *m_bg; |
| 62 | |
| 63 | bool m_blockNextEvent; |
| 64 | |
| 65 | void OnInternalIdle(); |
| 66 | |
| 67 | protected: |
| 68 | // common part of all ctors |
| 69 | void Init(); |
| 70 | |
| 71 | // implement base class pure virtuals |
| 72 | virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); |
| 73 | virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); |
| 74 | |
| 75 | virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); |
| 76 | virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); |
| 77 | virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); |
| 78 | |
| 79 | virtual wxToolBarToolBase *CreateTool(int id, |
| 80 | const wxBitmap& bitmap1, |
| 81 | const wxBitmap& bitmap2, |
| 82 | bool toggle, |
| 83 | wxObject *clientData, |
| 84 | const wxString& shortHelpString, |
| 85 | const wxString& longHelpString); |
| 86 | virtual wxToolBarToolBase *CreateTool(wxControl *control); |
| 87 | |
| 88 | private: |
| 89 | DECLARE_DYNAMIC_CLASS(wxToolBar) |
| 90 | }; |
| 91 | |
| 92 | #endif // wxUSE_TOOLBAR |
| 93 | |
| 94 | #endif |
| 95 | // _WX_GTK_TBARGTK_H_ |