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