1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/wince/tbarwce.h
3 // Purpose: Windows CE wxToolBar class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "tbarwce.h"
21 #include "wx/dynarray.h"
23 // Smartphones don't have toolbars, so use a dummy class
26 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
32 wxToolBar(wxWindow
*parent
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
37 const wxString
& name
= wxToolBarNameStr
)
39 Create(parent
, id
, pos
, size
, style
, name
);
42 bool Create(wxWindow
*parent
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
47 const wxString
& name
= wxToolBarNameStr
);
49 // override/implement base class virtuals
50 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
51 virtual bool Realize() { return true; }
54 // implement base class pure virtuals
55 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
56 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
58 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
59 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
60 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
62 virtual wxToolBarToolBase
*CreateTool(int id
,
63 const wxString
& label
,
64 const wxBitmap
& bmpNormal
,
65 const wxBitmap
& bmpDisabled
,
68 const wxString
& shortHelp
,
69 const wxString
& longHelp
);
70 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
74 DECLARE_DYNAMIC_CLASS(wxToolBar
)
75 DECLARE_NO_COPY_CLASS(wxToolBar
)
82 #include "wx/msw/tbar95.h"
84 class WXDLLEXPORT wxToolMenuBar
: public wxToolBar
88 wxToolMenuBar() { Init(); }
90 wxToolMenuBar(wxWindow
*parent
,
92 const wxPoint
& pos
= wxDefaultPosition
,
93 const wxSize
& size
= wxDefaultSize
,
94 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
95 const wxString
& name
= wxToolBarNameStr
,
96 wxMenuBar
* menuBar
= NULL
)
100 Create(parent
, id
, pos
, size
, style
, name
, menuBar
);
103 bool Create(wxWindow
*parent
,
105 const wxPoint
& pos
= wxDefaultPosition
,
106 const wxSize
& size
= wxDefaultSize
,
107 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
108 const wxString
& name
= wxToolBarNameStr
,
109 wxMenuBar
* menuBar
= NULL
);
111 virtual ~wxToolMenuBar();
113 // override/implement base class virtuals
114 virtual bool Realize();
116 // implementation only from now on
117 // -------------------------------
119 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
121 // Return HMENU for the menu associated with the commandbar
124 // Set the wxMenuBar associated with this commandbar
125 void SetMenuBar(wxMenuBar
* menuBar
) { m_menuBar
= menuBar
; }
127 // Returns the wxMenuBar associated with this commandbar
128 wxMenuBar
* GetMenuBar() const { return m_menuBar
; }
131 // common part of all ctors
134 // create the native toolbar control
135 bool MSWCreateToolbar(const wxPoint
& pos
, const wxSize
& size
, wxMenuBar
* menuBar
);
137 // recreate the control completely
140 // implement base class pure virtuals
141 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
142 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
144 virtual wxToolBarToolBase
*CreateTool(int id
,
145 const wxString
& label
,
146 const wxBitmap
& bmpNormal
,
147 const wxBitmap
& bmpDisabled
,
149 wxObject
*clientData
,
150 const wxString
& shortHelp
,
151 const wxString
& longHelp
);
152 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
154 // The menubar associated with this toolbar
155 wxMenuBar
* m_menuBar
;
158 DECLARE_EVENT_TABLE()
159 DECLARE_DYNAMIC_CLASS(wxToolMenuBar
)
160 DECLARE_NO_COPY_CLASS(wxToolMenuBar
)
166 #endif // wxUSE_TOOLBAR