1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/wince/tbarwce.h
3 // Purpose: Windows CE wxToolBar class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
16 #include "wx/dynarray.h"
18 // Smartphones don't have toolbars, so use a dummy class
21 class WXDLLIMPEXP_CORE wxToolBar
: public wxToolBarBase
27 wxToolBar(wxWindow
*parent
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 long style
= wxTB_HORIZONTAL
,
32 const wxString
& name
= wxToolBarNameStr
)
34 Create(parent
, id
, pos
, size
, style
, name
);
37 bool Create(wxWindow
*parent
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
,
41 long style
= wxTB_HORIZONTAL
,
42 const wxString
& name
= wxToolBarNameStr
);
44 // override/implement base class virtuals
45 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
46 virtual bool Realize() { return true; }
49 // implement base class pure virtuals
50 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
51 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
53 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
54 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
55 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
57 virtual wxToolBarToolBase
*CreateTool(int id
,
58 const wxString
& label
,
59 const wxBitmap
& bmpNormal
,
60 const wxBitmap
& bmpDisabled
,
63 const wxString
& shortHelp
,
64 const wxString
& longHelp
);
65 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
,
66 const wxString
& label
);
70 DECLARE_DYNAMIC_CLASS(wxToolBar
)
71 wxDECLARE_NO_COPY_CLASS(wxToolBar
);
78 #include "wx/msw/toolbar.h"
80 class WXDLLIMPEXP_CORE wxToolMenuBar
: public wxToolBar
84 wxToolMenuBar() { Init(); }
86 wxToolMenuBar(wxWindow
*parent
,
88 const wxPoint
& pos
= wxDefaultPosition
,
89 const wxSize
& size
= wxDefaultSize
,
90 long style
= wxTB_HORIZONTAL
,
91 const wxString
& name
= wxToolBarNameStr
,
92 wxMenuBar
* menuBar
= NULL
)
96 Create(parent
, id
, pos
, size
, style
, name
, menuBar
);
99 bool Create(wxWindow
*parent
,
101 const wxPoint
& pos
= wxDefaultPosition
,
102 const wxSize
& size
= wxDefaultSize
,
103 long style
= wxTB_HORIZONTAL
,
104 const wxString
& name
= wxToolBarNameStr
,
105 wxMenuBar
* menuBar
= NULL
);
107 virtual ~wxToolMenuBar();
109 // override/implement base class virtuals
110 virtual bool Realize();
112 // implementation only from now on
113 // -------------------------------
115 // Override in order to bypass wxToolBar's overridden function
116 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
118 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
120 // Return HMENU for the menu associated with the commandbar
123 // Set the wxMenuBar associated with this commandbar
124 void SetMenuBar(wxMenuBar
* menuBar
) { m_menuBar
= menuBar
; }
126 // Returns the wxMenuBar associated with this commandbar
127 wxMenuBar
* GetMenuBar() const { return m_menuBar
; }
130 // common part of all ctors
133 // create the native toolbar control
134 bool MSWCreateToolbar(const wxPoint
& pos
, const wxSize
& size
, wxMenuBar
* menuBar
);
136 // recreate the control completely
139 // implement base class pure virtuals
140 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
141 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
143 virtual wxToolBarToolBase
*CreateTool(int id
,
144 const wxString
& label
,
145 const wxBitmap
& bmpNormal
,
146 const wxBitmap
& bmpDisabled
,
148 wxObject
*clientData
,
149 const wxString
& shortHelp
,
150 const wxString
& longHelp
);
151 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
,
152 const wxString
& label
);
154 // The menubar associated with this toolbar
155 wxMenuBar
* m_menuBar
;
158 DECLARE_EVENT_TABLE()
159 DECLARE_DYNAMIC_CLASS(wxToolMenuBar
)
160 wxDECLARE_NO_COPY_CLASS(wxToolMenuBar
);
166 #endif // wxUSE_TOOLBAR