]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/dvrenderers.h
using Run of base class
[wxWidgets.git] / include / wx / osx / dvrenderers.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/dvrenderers.h
3 // Purpose: All OS X wxDataViewCtrl renderer classes
4 // Author: Vadim Zeitlin
5 // Created: 2009-11-07 (extracted from wx/osx/dataview.h)
6 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_OSX_DVRENDERERS_H_
11 #define _WX_OSX_DVRENDERERS_H_
12
13 // ---------------------------------------------------------
14 // wxDataViewCustomRenderer
15 // ---------------------------------------------------------
16
17 class WXDLLIMPEXP_ADV wxDataViewCustomRenderer : public wxDataViewCustomRendererBase
18 {
19 public:
20 wxDataViewCustomRenderer(const wxString& varianttype = "string",
21 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
22 int align = wxDVR_DEFAULT_ALIGNMENT);
23
24 virtual ~wxDataViewCustomRenderer();
25
26
27 // implementation only
28 // -------------------
29
30 virtual bool MacRender();
31
32 #if wxOSX_USE_COCOA
33 virtual void OSXApplyAttr(const wxDataViewItemAttr& attr);
34 #endif // Cocoa
35
36 virtual wxDC* GetDC(); // creates a device context and keeps it
37 void SetDC(wxDC* newDCPtr); // this method takes ownership of the pointer
38
39 private:
40 wxControl* m_editorCtrlPtr; // pointer to an in-place editor control
41
42 wxDC* m_DCPtr;
43
44 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
45 };
46
47 // ---------------------------------------------------------
48 // wxDataViewTextRenderer
49 // ---------------------------------------------------------
50
51 class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
52 {
53 public:
54 wxDataViewTextRenderer(const wxString& varianttype = "string",
55 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
56 int align = wxDVR_DEFAULT_ALIGNMENT);
57
58 virtual bool MacRender();
59
60 #if wxOSX_USE_COCOA
61 virtual void OSXOnCellChanged(NSObject *value,
62 const wxDataViewItem& item,
63 unsigned col);
64 #endif // Cocoa
65
66 private:
67 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer)
68 };
69
70 // ---------------------------------------------------------
71 // wxDataViewBitmapRenderer
72 // ---------------------------------------------------------
73
74 class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
75 {
76 public:
77 wxDataViewBitmapRenderer(const wxString& varianttype = "wxBitmap",
78 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
79 int align = wxDVR_DEFAULT_ALIGNMENT);
80
81 virtual bool MacRender();
82
83 private:
84 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer)
85 };
86
87 #if wxOSX_USE_COCOA
88
89 // -------------------------------------
90 // wxDataViewChoiceRenderer
91 // -------------------------------------
92
93 class WXDLLIMPEXP_ADV wxDataViewChoiceRenderer: public wxDataViewRenderer
94 {
95 public:
96 wxDataViewChoiceRenderer(const wxArrayString& choices,
97 wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
98 int alignment = wxDVR_DEFAULT_ALIGNMENT );
99
100 virtual bool MacRender();
101
102 wxString GetChoice(size_t index) const { return m_choices[index]; }
103 const wxArrayString& GetChoices() const { return m_choices; }
104
105 #if wxOSX_USE_COCOA
106 virtual void OSXOnCellChanged(NSObject *value,
107 const wxDataViewItem& item,
108 unsigned col);
109 #endif // Cocoa
110
111 private:
112 wxArrayString m_choices;
113
114 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewChoiceRenderer)
115 };
116
117 #endif // wxOSX_USE_COCOA
118
119 // ---------------------------------------------------------
120 // wxDataViewIconTextRenderer
121 // ---------------------------------------------------------
122 class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewRenderer
123 {
124 public:
125 wxDataViewIconTextRenderer(const wxString& varianttype = "wxDataViewIconText",
126 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
127 int align = wxDVR_DEFAULT_ALIGNMENT);
128
129 virtual bool MacRender();
130
131 #if wxOSX_USE_COCOA
132 virtual void OSXOnCellChanged(NSObject *value,
133 const wxDataViewItem& item,
134 unsigned col);
135 #endif // Cocoa
136
137 private:
138 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
139 };
140
141 // ---------------------------------------------------------
142 // wxDataViewToggleRenderer
143 // ---------------------------------------------------------
144
145 class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
146 {
147 public:
148 wxDataViewToggleRenderer(const wxString& varianttype = "bool",
149 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
150 int align = wxDVR_DEFAULT_ALIGNMENT);
151
152 virtual bool MacRender();
153
154 #if wxOSX_USE_COCOA
155 virtual void OSXOnCellChanged(NSObject *value,
156 const wxDataViewItem& item,
157 unsigned col);
158 #endif // Cocoa
159
160 private:
161 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer)
162 };
163
164 // ---------------------------------------------------------
165 // wxDataViewProgressRenderer
166 // ---------------------------------------------------------
167
168 class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewRenderer
169 {
170 public:
171 wxDataViewProgressRenderer(const wxString& label = wxEmptyString,
172 const wxString& varianttype = "long",
173 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
174 int align = wxDVR_DEFAULT_ALIGNMENT);
175
176 virtual bool MacRender();
177
178 #if wxOSX_USE_COCOA
179 virtual void OSXOnCellChanged(NSObject *value,
180 const wxDataViewItem& item,
181 unsigned col);
182 #endif // Cocoa
183
184 private:
185 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer)
186 };
187
188 // ---------------------------------------------------------
189 // wxDataViewDateRenderer
190 // ---------------------------------------------------------
191
192 class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewRenderer
193 {
194 public:
195 wxDataViewDateRenderer(const wxString& varianttype = "datetime",
196 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
197 int align = wxDVR_DEFAULT_ALIGNMENT);
198
199 virtual bool MacRender();
200
201 #if wxOSX_USE_COCOA
202 virtual void OSXOnCellChanged(NSObject *value,
203 const wxDataViewItem& item,
204 unsigned col);
205 #endif // Cocoa
206
207 private:
208 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
209 };
210
211 #endif // _WX_OSX_DVRENDERERS_H_
212