]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/toolbar.h
Lots of cleanup, mostly consolidating globals
[wxWidgets.git] / include / wx / os2 / toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: toolbar.h
3 // Purpose: wxToolBar class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/17/98
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
14
15 #if wxUSE_TOOLBAR
16 #include "wx/tbarbase.h"
17
18 class WXDLLEXPORT wxToolBar: public wxToolBarBase
19 {
20 public:
21 /*
22 * Public interface
23 */
24
25 wxToolBar() { Init(); }
26
27 inline wxToolBar( wxWindow* pParent
28 ,wxWindowID vId
29 ,const wxPoint& rPos = wxDefaultPosition
30 ,const wxSize& rSize = wxDefaultSize
31 ,long lStyle = wxNO_BORDER|wxTB_HORIZONTAL
32 ,const wxString& rName = wxToolBarNameStr
33 )
34 {
35 Create( pParent
36 ,vId
37 ,rPos
38 ,rSize
39 ,lStyle
40 ,rName
41 );
42 }
43 bool Create( wxWindow* pParent
44 ,wxWindowID vId
45 ,const wxPoint& rPos = wxDefaultPosition
46 ,const wxSize& rSize = wxDefaultSize
47 ,long lStyle = wxNO_BORDER|wxTB_HORIZONTAL
48 ,const wxString& rName = wxToolBarNameStr
49 );
50
51 virtual ~wxToolBar();
52
53 // override/implement base class virtuals
54 virtual wxToolBarToolBase* FindToolForPosition( wxCoord x
55 ,wxCoord y
56 ) const;
57
58 // The post-tool-addition call
59 virtual bool Realize(void);
60
61 virtual void SetToolBitmapSize(const wxSize& rSize);
62 virtual wxSize GetToolSize(void) const;
63
64 virtual void SetRows(int nRows);
65
66 // IMPLEMENTATION
67 virtual bool OS2Command( WXUINT uParam
68 ,WXWORD wId
69 );
70 virtual bool OS2OnNotify( int nCtrl
71 ,WXLPARAM lParam
72 ,WXLPARAM* pResult
73 );
74 void OnMouseEvent(wxMouseEvent& rEvent);
75 void OnSysColourChanged(wxSysColourChangedEvent& rEvent);
76
77 protected:
78 void Init(void);
79 // implement base class pure virtuals
80 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
81 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
82
83 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
84 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
85 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
86
87 virtual wxToolBarToolBase* CreateTool( int vId
88 ,const wxBitmap& rBitmap1
89 ,const wxBitmap& rBitmap2
90 ,bool bToggle
91 ,wxObject* pClientData
92 ,const wxString& rShortHelpString
93 ,const wxString& rLongHelpString
94 );
95 virtual wxToolBarToolBase* CreateTool(wxControl* pControl);
96
97 // should be called whenever the toolbar size changes
98 void UpdateSize(void);
99
100 // override WndProc to process WM_SIZE
101 virtual MRESULT OS2WindowProc( WXUINT ulMsg
102 ,WXWPARAM wParam
103 ,WXLPARAM lParam
104 );
105
106 // the big bitmap containing all bitmaps of the toolbar buttons
107 WXHBITMAP m_hBitmap;
108
109 // the total number of toolbar elements
110 size_t m_nButtons;
111
112 private:
113 DECLARE_EVENT_TABLE()
114 DECLARE_DYNAMIC_CLASS(wxToolBar)
115 };
116
117 #endif // wxUSE_TOOLBAR
118
119 #endif
120 // _WX_TOOLBAR_H_