]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/wince/tbarwce.h
clear m_aTypes array in Clear() as well (patch 1165866)
[wxWidgets.git] / include / wx / msw / wince / tbarwce.h
CommitLineData
39d2f9a7
JS
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
65571936 9// Licence: wxWindows licence
39d2f9a7
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_BARWCE_H_
13#define _WX_BARWCE_H_
14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
39d2f9a7
JS
16 #pragma interface "tbarwce.h"
17#endif
18
19#if wxUSE_TOOLBAR
20
21#include "wx/dynarray.h"
22
a9102b36
JS
23// Smartphones don't have toolbars, so use a dummy class
24#ifdef __SMARTPHONE__
25
39d2f9a7
JS
26class WXDLLEXPORT wxToolBar : public wxToolBarBase
27{
28public:
29 // ctors and dtor
a9102b36 30 wxToolBar() { }
39d2f9a7
JS
31
32 wxToolBar(wxWindow *parent,
a9102b36
JS
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
53protected:
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
72private:
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
84class WXDLLEXPORT wxToolMenuBar : public wxToolBar
85{
86public:
87 // ctors and dtor
88 wxToolMenuBar() { Init(); }
89
90 wxToolMenuBar(wxWindow *parent,
39d2f9a7
JS
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
a9102b36 111 virtual ~wxToolMenuBar();
39d2f9a7
JS
112
113 // override/implement base class virtuals
39d2f9a7
JS
114 virtual bool Realize();
115
39d2f9a7
JS
116 // implementation only from now on
117 // -------------------------------
118
ea9aa80e
JS
119 // Override in order to bypass wxToolBar's overridden function
120 virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
121
39d2f9a7 122 virtual bool MSWCommand(WXUINT param, WXWORD id);
39d2f9a7
JS
123
124 // Return HMENU for the menu associated with the commandbar
125 WXHMENU GetHMenu();
126
127 // Set the wxMenuBar associated with this commandbar
128 void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
129
130 // Returns the wxMenuBar associated with this commandbar
131 wxMenuBar* GetMenuBar() const { return m_menuBar; }
132
133protected:
134 // common part of all ctors
135 void Init();
136
137 // create the native toolbar control
138 bool MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuBar* menuBar);
139
140 // recreate the control completely
141 void Recreate();
142
143 // implement base class pure virtuals
144 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
145 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
146
39d2f9a7
JS
147 virtual wxToolBarToolBase *CreateTool(int id,
148 const wxString& label,
149 const wxBitmap& bmpNormal,
150 const wxBitmap& bmpDisabled,
151 wxItemKind kind,
152 wxObject *clientData,
153 const wxString& shortHelp,
154 const wxString& longHelp);
155 virtual wxToolBarToolBase *CreateTool(wxControl *control);
156
39d2f9a7
JS
157 // The menubar associated with this toolbar
158 wxMenuBar* m_menuBar;
159
160private:
161 DECLARE_EVENT_TABLE()
a9102b36
JS
162 DECLARE_DYNAMIC_CLASS(wxToolMenuBar)
163 DECLARE_NO_COPY_CLASS(wxToolMenuBar)
39d2f9a7
JS
164};
165
a9102b36
JS
166#endif
167 // __SMARTPHONE__
168
39d2f9a7
JS
169#endif // wxUSE_TOOLBAR
170
171#endif
172 // _WX_BARWCE_H_