]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/dvrenderers.h
proper default for iphone
[wxWidgets.git] / include / wx / osx / dvrenderers.h
CommitLineData
6eec70b9
VZ
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)
6eec70b9
VZ
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
17class WXDLLIMPEXP_ADV wxDataViewCustomRenderer : public wxDataViewCustomRendererBase
18{
19public:
20 wxDataViewCustomRenderer(const wxString& varianttype = "string",
21 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
22 int align = wxDVR_DEFAULT_ALIGNMENT);
23
24 virtual ~wxDataViewCustomRenderer();
25
6eec70b9
VZ
26
27 // implementation only
28 // -------------------
29
30 virtual bool MacRender();
31
061a5c21 32#if wxOSX_USE_COCOA
b0607dd2 33 virtual void OSXApplyAttr(const wxDataViewItemAttr& attr);
061a5c21 34#endif // Cocoa
b0607dd2 35
6eec70b9
VZ
36 virtual wxDC* GetDC(); // creates a device context and keeps it
37 void SetDC(wxDC* newDCPtr); // this method takes ownership of the pointer
38
39private:
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
51class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
52{
53public:
54 wxDataViewTextRenderer(const wxString& varianttype = "string",
55 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
56 int align = wxDVR_DEFAULT_ALIGNMENT);
57
58 virtual bool MacRender();
59
aaedb44c 60#if wxOSX_USE_COCOA
6eec70b9
VZ
61 virtual void OSXOnCellChanged(NSObject *value,
62 const wxDataViewItem& item,
63 unsigned col);
aaedb44c 64#endif // Cocoa
6eec70b9
VZ
65
66private:
67 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer)
68};
69
70// ---------------------------------------------------------
71// wxDataViewBitmapRenderer
72// ---------------------------------------------------------
73
74class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
75{
76public:
77 wxDataViewBitmapRenderer(const wxString& varianttype = "wxBitmap",
78 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
79 int align = wxDVR_DEFAULT_ALIGNMENT);
80
81 virtual bool MacRender();
82
83private:
84 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer)
85};
86
aaedb44c
VZ
87#if wxOSX_USE_COCOA
88
6eec70b9
VZ
89// -------------------------------------
90// wxDataViewChoiceRenderer
91// -------------------------------------
92
93class WXDLLIMPEXP_ADV wxDataViewChoiceRenderer: public wxDataViewRenderer
94{
95public:
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
119e862c
VZ
105#if wxOSX_USE_COCOA
106 virtual void OSXOnCellChanged(NSObject *value,
107 const wxDataViewItem& item,
108 unsigned col);
109#endif // Cocoa
110
6eec70b9
VZ
111private:
112 wxArrayString m_choices;
113
114 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewChoiceRenderer)
115};
116
aaedb44c
VZ
117#endif // wxOSX_USE_COCOA
118
6eec70b9
VZ
119// ---------------------------------------------------------
120// wxDataViewIconTextRenderer
121// ---------------------------------------------------------
122class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewRenderer
123{
124public:
125 wxDataViewIconTextRenderer(const wxString& varianttype = "wxDataViewIconText",
126 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
127 int align = wxDVR_DEFAULT_ALIGNMENT);
128
129 virtual bool MacRender();
130
aaedb44c 131#if wxOSX_USE_COCOA
6eec70b9
VZ
132 virtual void OSXOnCellChanged(NSObject *value,
133 const wxDataViewItem& item,
134 unsigned col);
aaedb44c 135#endif // Cocoa
6eec70b9
VZ
136
137private:
138 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
139};
140
141// ---------------------------------------------------------
142// wxDataViewToggleRenderer
143// ---------------------------------------------------------
144
145class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
146{
147public:
148 wxDataViewToggleRenderer(const wxString& varianttype = "bool",
149 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
150 int align = wxDVR_DEFAULT_ALIGNMENT);
151
152 virtual bool MacRender();
153
aaedb44c 154#if wxOSX_USE_COCOA
6eec70b9
VZ
155 virtual void OSXOnCellChanged(NSObject *value,
156 const wxDataViewItem& item,
157 unsigned col);
aaedb44c 158#endif // Cocoa
6eec70b9
VZ
159
160private:
161 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer)
162};
163
164// ---------------------------------------------------------
165// wxDataViewProgressRenderer
166// ---------------------------------------------------------
167
168class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewRenderer
169{
170public:
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
aaedb44c 178#if wxOSX_USE_COCOA
6eec70b9
VZ
179 virtual void OSXOnCellChanged(NSObject *value,
180 const wxDataViewItem& item,
181 unsigned col);
aaedb44c 182#endif // Cocoa
6eec70b9
VZ
183
184private:
185 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer)
186};
187
188// ---------------------------------------------------------
189// wxDataViewDateRenderer
190// ---------------------------------------------------------
191
192class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewRenderer
193{
194public:
195 wxDataViewDateRenderer(const wxString& varianttype = "datetime",
196 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
197 int align = wxDVR_DEFAULT_ALIGNMENT);
198
199 virtual bool MacRender();
200
aaedb44c 201#if wxOSX_USE_COCOA
6eec70b9
VZ
202 virtual void OSXOnCellChanged(NSObject *value,
203 const wxDataViewItem& item,
204 unsigned col);
aaedb44c 205#endif // Cocoa
6eec70b9
VZ
206
207private:
208 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
209};
210
211#endif // _WX_OSX_DVRENDERERS_H_
212