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 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_OSX_DVRENDERERS_H_
12 #define _WX_OSX_DVRENDERERS_H_
14 // ---------------------------------------------------------
15 // wxDataViewCustomRenderer
16 // ---------------------------------------------------------
18 class WXDLLIMPEXP_ADV wxDataViewCustomRenderer
: public wxDataViewCustomRendererBase
21 wxDataViewCustomRenderer(const wxString
& varianttype
= "string",
22 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
23 int align
= wxDVR_DEFAULT_ALIGNMENT
);
25 virtual ~wxDataViewCustomRenderer();
28 // implementation only
29 // -------------------
31 virtual bool MacRender();
34 virtual void OSXApplyAttr(const wxDataViewItemAttr
& attr
);
37 virtual wxDC
* GetDC(); // creates a device context and keeps it
38 void SetDC(wxDC
* newDCPtr
); // this method takes ownership of the pointer
41 wxControl
* m_editorCtrlPtr
; // pointer to an in-place editor control
45 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer
)
48 // ---------------------------------------------------------
49 // wxDataViewTextRenderer
50 // ---------------------------------------------------------
52 class WXDLLIMPEXP_ADV wxDataViewTextRenderer
: public wxDataViewRenderer
55 wxDataViewTextRenderer(const wxString
& varianttype
= "string",
56 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
57 int align
= wxDVR_DEFAULT_ALIGNMENT
);
59 virtual bool MacRender();
62 virtual void OSXOnCellChanged(NSObject
*value
,
63 const wxDataViewItem
& item
,
68 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer
)
71 // ---------------------------------------------------------
72 // wxDataViewBitmapRenderer
73 // ---------------------------------------------------------
75 class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer
: public wxDataViewRenderer
78 wxDataViewBitmapRenderer(const wxString
& varianttype
= "wxBitmap",
79 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
80 int align
= wxDVR_DEFAULT_ALIGNMENT
);
82 virtual bool MacRender();
85 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer
)
90 // -------------------------------------
91 // wxDataViewChoiceRenderer
92 // -------------------------------------
94 class WXDLLIMPEXP_ADV wxDataViewChoiceRenderer
: public wxDataViewRenderer
97 wxDataViewChoiceRenderer(const wxArrayString
& choices
,
98 wxDataViewCellMode mode
= wxDATAVIEW_CELL_EDITABLE
,
99 int alignment
= wxDVR_DEFAULT_ALIGNMENT
);
101 virtual bool MacRender();
103 wxString
GetChoice(size_t index
) const { return m_choices
[index
]; }
104 const wxArrayString
& GetChoices() const { return m_choices
; }
107 wxArrayString m_choices
;
109 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewChoiceRenderer
)
112 #endif // wxOSX_USE_COCOA
114 // ---------------------------------------------------------
115 // wxDataViewIconTextRenderer
116 // ---------------------------------------------------------
117 class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer
: public wxDataViewRenderer
120 wxDataViewIconTextRenderer(const wxString
& varianttype
= "wxDataViewIconText",
121 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
122 int align
= wxDVR_DEFAULT_ALIGNMENT
);
124 virtual bool MacRender();
127 virtual void OSXOnCellChanged(NSObject
*value
,
128 const wxDataViewItem
& item
,
133 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer
)
136 // ---------------------------------------------------------
137 // wxDataViewToggleRenderer
138 // ---------------------------------------------------------
140 class WXDLLIMPEXP_ADV wxDataViewToggleRenderer
: public wxDataViewRenderer
143 wxDataViewToggleRenderer(const wxString
& varianttype
= "bool",
144 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
145 int align
= wxDVR_DEFAULT_ALIGNMENT
);
147 virtual bool MacRender();
150 virtual void OSXOnCellChanged(NSObject
*value
,
151 const wxDataViewItem
& item
,
156 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer
)
159 // ---------------------------------------------------------
160 // wxDataViewProgressRenderer
161 // ---------------------------------------------------------
163 class WXDLLIMPEXP_ADV wxDataViewProgressRenderer
: public wxDataViewRenderer
166 wxDataViewProgressRenderer(const wxString
& label
= wxEmptyString
,
167 const wxString
& varianttype
= "long",
168 wxDataViewCellMode mode
= wxDATAVIEW_CELL_INERT
,
169 int align
= wxDVR_DEFAULT_ALIGNMENT
);
171 virtual bool MacRender();
174 virtual void OSXOnCellChanged(NSObject
*value
,
175 const wxDataViewItem
& item
,
180 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer
)
183 // ---------------------------------------------------------
184 // wxDataViewDateRenderer
185 // ---------------------------------------------------------
187 class WXDLLIMPEXP_ADV wxDataViewDateRenderer
: public wxDataViewRenderer
190 wxDataViewDateRenderer(const wxString
& varianttype
= "datetime",
191 wxDataViewCellMode mode
= wxDATAVIEW_CELL_ACTIVATABLE
,
192 int align
= wxDVR_DEFAULT_ALIGNMENT
);
194 virtual bool MacRender();
197 virtual void OSXOnCellChanged(NSObject
*value
,
198 const wxDataViewItem
& item
,
203 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer
)
206 #endif // _WX_OSX_DVRENDERERS_H_