]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/wince/tbarwce.h
Update for new event handler stuff
[wxWidgets.git] / include / wx / msw / wince / tbarwce.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/wince/tbarwce.h
3 // Purpose: Windows CE wxToolBar class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 2003-07-12
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_BARWCE_H_
13 #define _WX_BARWCE_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "tbarwce.h"
17 #endif
18
19 #if wxUSE_TOOLBAR
20
21 #include "wx/dynarray.h"
22
23 // Smartphones don't have toolbars, so use a dummy class
24 #ifdef __SMARTPHONE__
25
26 class WXDLLEXPORT wxToolBar : public wxToolBarBase
27 {
28 public:
29 // ctors and dtor
30 wxToolBar() { }
31
32 wxToolBar(wxWindow *parent,
33 wxWindowID id,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = wxNO_BORDER | wxTB_HORIZONTAL,
37 const wxString& name = wxToolBarNameStr)
38 {
39 Create(parent, id, pos, size, style, name);
40 }
41
42 bool Create(wxWindow *parent,
43 wxWindowID id,
44 const wxPoint& pos = wxDefaultPosition,
45 const wxSize& size = wxDefaultSize,
46 long style = wxNO_BORDER | wxTB_HORIZONTAL,
47 const wxString& name = wxToolBarNameStr);
48
49 // override/implement base class virtuals
50 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
51 virtual bool Realize() { return true; }
52
53 protected:
54 // implement base class pure virtuals
55 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
56 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
57
58 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
59 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
60 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
61
62 virtual wxToolBarToolBase *CreateTool(int id,
63 const wxString& label,
64 const wxBitmap& bmpNormal,
65 const wxBitmap& bmpDisabled,
66 wxItemKind kind,
67 wxObject *clientData,
68 const wxString& shortHelp,
69 const wxString& longHelp);
70 virtual wxToolBarToolBase *CreateTool(wxControl *control);
71
72 private:
73 DECLARE_EVENT_TABLE()
74 DECLARE_DYNAMIC_CLASS(wxToolBar)
75 DECLARE_NO_COPY_CLASS(wxToolBar)
76 };
77
78 #else
79
80 // For __POCKETPC__
81
82 #include "wx/msw/tbar95.h"
83
84 class WXDLLEXPORT wxToolMenuBar : public wxToolBar
85 {
86 public:
87 // ctors and dtor
88 wxToolMenuBar() { Init(); }
89
90 wxToolMenuBar(wxWindow *parent,
91 wxWindowID id,
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)
97 {
98 Init();
99
100 Create(parent, id, pos, size, style, name, menuBar);
101 }
102
103 bool Create(wxWindow *parent,
104 wxWindowID id,
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);
110
111 virtual ~wxToolMenuBar();
112
113 // override/implement base class virtuals
114 virtual bool Realize();
115
116 // implementation only from now on
117 // -------------------------------
118
119 virtual bool MSWCommand(WXUINT param, WXWORD id);
120
121 // Return HMENU for the menu associated with the commandbar
122 WXHMENU GetHMenu();
123
124 // Set the wxMenuBar associated with this commandbar
125 void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
126
127 // Returns the wxMenuBar associated with this commandbar
128 wxMenuBar* GetMenuBar() const { return m_menuBar; }
129
130 protected:
131 // common part of all ctors
132 void Init();
133
134 // create the native toolbar control
135 bool MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuBar* menuBar);
136
137 // recreate the control completely
138 void Recreate();
139
140 // implement base class pure virtuals
141 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
142 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
143
144 virtual wxToolBarToolBase *CreateTool(int id,
145 const wxString& label,
146 const wxBitmap& bmpNormal,
147 const wxBitmap& bmpDisabled,
148 wxItemKind kind,
149 wxObject *clientData,
150 const wxString& shortHelp,
151 const wxString& longHelp);
152 virtual wxToolBarToolBase *CreateTool(wxControl *control);
153
154 // The menubar associated with this toolbar
155 wxMenuBar* m_menuBar;
156
157 private:
158 DECLARE_EVENT_TABLE()
159 DECLARE_DYNAMIC_CLASS(wxToolMenuBar)
160 DECLARE_NO_COPY_CLASS(wxToolMenuBar)
161 };
162
163 #endif
164 // __SMARTPHONE__
165
166 #endif // wxUSE_TOOLBAR
167
168 #endif
169 // _WX_BARWCE_H_