1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
16 #include "wx/tbarbase.h"
18 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
25 wxToolBar() { Init(); }
27 inline wxToolBar( wxWindow
* pParent
29 ,const wxPoint
& rPos
= wxDefaultPosition
30 ,const wxSize
& rSize
= wxDefaultSize
31 ,long lStyle
= wxNO_BORDER
|wxTB_HORIZONTAL
32 ,const wxString
& rName
= wxToolBarNameStr
43 bool Create( wxWindow
* pParent
45 ,const wxPoint
& rPos
= wxDefaultPosition
46 ,const wxSize
& rSize
= wxDefaultSize
47 ,long lStyle
= wxNO_BORDER
|wxTB_HORIZONTAL
48 ,const wxString
& rName
= wxToolBarNameStr
53 // override/implement base class virtuals
54 virtual wxToolBarToolBase
* FindToolForPosition( wxCoord x
58 // The post-tool-addition call
59 virtual bool Realize(void);
61 virtual void SetToolBitmapSize(const wxSize
& rSize
);
62 virtual wxSize
GetToolSize(void) const;
64 virtual void SetRows(int nRows
);
67 virtual bool OS2Command( WXUINT uParam
70 virtual bool OS2OnNotify( int nCtrl
74 void OnMouseEvent(wxMouseEvent
& rEvent
);
75 void OnSysColourChanged(wxSysColourChangedEvent
& rEvent
);
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 vId
88 ,const wxBitmap
& rBitmap1
89 ,const wxBitmap
& rBitmap2
91 ,wxObject
* pClientData
92 ,const wxString
& rShortHelpString
93 ,const wxString
& rLongHelpString
95 virtual wxToolBarToolBase
* CreateTool(wxControl
* pControl
);
97 // should be called whenever the toolbar size changes
98 void UpdateSize(void);
100 // override WndProc to process WM_SIZE
101 virtual MRESULT
OS2WindowProc( WXUINT ulMsg
106 // the big bitmap containing all bitmaps of the toolbar buttons
109 // the total number of toolbar elements
113 DECLARE_EVENT_TABLE()
114 DECLARE_DYNAMIC_CLASS(wxToolBar
)
117 #endif // wxUSE_TOOLBAR