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 // Override in order to bypass wxToolBar's overridden function
120 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
122 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
124 // Return HMENU for the menu associated with the commandbar
127 // Set the wxMenuBar associated with this commandbar
128 void SetMenuBar(wxMenuBar
* menuBar
) { m_menuBar
= menuBar
; }
130 // Returns the wxMenuBar associated with this commandbar
131 wxMenuBar
* GetMenuBar() const { return m_menuBar
; }
134 // common part of all ctors
137 // create the native toolbar control
138 bool MSWCreateToolbar(const wxPoint
& pos
, const wxSize
& size
, wxMenuBar
* menuBar
);
140 // recreate the control completely
143 // implement base class pure virtuals
144 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
145 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
147 virtual wxToolBarToolBase
*CreateTool(int id
,
148 const wxString
& label
,
149 const wxBitmap
& bmpNormal
,
150 const wxBitmap
& bmpDisabled
,
152 wxObject
*clientData
,
153 const wxString
& shortHelp
,
154 const wxString
& longHelp
);
155 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
157 // The menubar associated with this toolbar
158 wxMenuBar
* m_menuBar
;
161 DECLARE_EVENT_TABLE()
162 DECLARE_DYNAMIC_CLASS(wxToolMenuBar
)
163 DECLARE_NO_COPY_CLASS(wxToolMenuBar
)
169 #endif // wxUSE_TOOLBAR