1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     GTK toolbar 
   4 // Author:      Robert Roebling 
   6 // Copyright:   (c) Robert Roebling 
   7 // Licence:     wxWindows licence 
   8 ///////////////////////////////////////////////////////////////////////////// 
  10 #ifndef _WX_GTK_TBARGTK_H_ 
  11 #define _WX_GTK_TBARGTK_H_ 
  15 // ---------------------------------------------------------------------------- 
  17 // ---------------------------------------------------------------------------- 
  19 class WXDLLIMPEXP_CORE wxToolBar 
: public wxToolBarBase
 
  22     // construction/destruction 
  23     wxToolBar() { Init(); } 
  24     wxToolBar( wxWindow 
*parent
, 
  26                const wxPoint
& pos 
= wxDefaultPosition
, 
  27                const wxSize
& size 
= wxDefaultSize
, 
  28                long style 
= wxTB_HORIZONTAL
, 
  29                const wxString
& name 
= wxToolBarNameStr 
) 
  33         Create(parent
, id
, pos
, size
, style
, name
); 
  36     bool Create( wxWindow 
*parent
, 
  38                  const wxPoint
& pos 
= wxDefaultPosition
, 
  39                  const wxSize
& size 
= wxDefaultSize
, 
  41                  const wxString
& name 
= wxToolBarNameStr 
); 
  45     // override base class virtuals 
  46     virtual void SetMargins(int x
, int y
); 
  47     virtual void SetToolSeparation(int separation
); 
  49     virtual wxToolBarToolBase 
*FindToolForPosition(wxCoord x
, wxCoord y
) const; 
  51     virtual void SetToolShortHelp(int id
, const wxString
& helpString
); 
  53     virtual void SetWindowStyleFlag( long style 
); 
  55     virtual void SetToolNormalBitmap(int id
, const wxBitmap
& bitmap
); 
  56     virtual void SetToolDisabledBitmap(int id
, const wxBitmap
& bitmap
); 
  58     static wxVisualAttributes
 
  59     GetClassDefaultAttributes(wxWindowVariant variant 
= wxWINDOW_VARIANT_NORMAL
); 
  61     // implementation from now on 
  62     // -------------------------- 
  64     GtkToolbar   
*m_toolbar
; 
  68     void OnInternalIdle(); 
  71     // common part of all ctors 
  74     // set the GTK toolbar style and orientation 
  77     virtual GdkWindow 
*GTKGetWindow(wxArrayGdkWindows
& windows
) const; 
  79     // implement base class pure virtuals 
  80     virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase 
*tool
); 
  81     virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase 
*tool
); 
  83     virtual void DoEnableTool(wxToolBarToolBase 
*tool
, bool enable
); 
  84     virtual void DoToggleTool(wxToolBarToolBase 
*tool
, bool toggle
); 
  85     virtual void DoSetToggle(wxToolBarToolBase 
*tool
, bool toggle
); 
  87     virtual wxToolBarToolBase 
*CreateTool(int id
, 
  88                                           const wxString
& label
, 
  89                                           const wxBitmap
& bitmap1
, 
  90                                           const wxBitmap
& bitmap2
, 
  93                                           const wxString
& shortHelpString
, 
  94                                           const wxString
& longHelpString
); 
  95     virtual wxToolBarToolBase 
*CreateTool(wxControl 
*control
, 
  96                                           const wxString
& label
); 
  99     DECLARE_DYNAMIC_CLASS(wxToolBar
) 
 102 #endif // wxUSE_TOOLBAR 
 105     // _WX_GTK_TBARGTK_H_