]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/dvrenderers.h
Implement wx-prefixed macros versions of DECLARE/IMPLEMENT_APP_* macros.
[wxWidgets.git] / include / wx / generic / dvrenderers.h
CommitLineData
6eec70b9
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/generic/dvrenderers.h
3// Purpose: All generic wxDataViewCtrl renderer classes
4// Author: Robert Roebling, Vadim Zeitlin
5// Created: 2009-11-07 (extracted from wx/generic/dataview.h)
b1153ed6 6// RCS-ID: $Id$
6eec70b9
VZ
7// Copyright: (c) 2006 Robert Roebling
8// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_GENERIC_DVRENDERERS_H_
13#define _WX_GENERIC_DVRENDERERS_H_
14
15// ---------------------------------------------------------
16// wxDataViewCustomRenderer
17// ---------------------------------------------------------
18
19class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer
20{
21public:
22 wxDataViewCustomRenderer( const wxString &varianttype = wxT("string"),
23 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
24 int align = wxDVR_DEFAULT_ALIGNMENT );
25
26 virtual wxDataViewCustomRenderer *WXGetAsCustom() { return this; }
27
28private:
29 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
30};
31
32
33// ---------------------------------------------------------
34// wxDataViewTextRenderer
35// ---------------------------------------------------------
36
37class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
38{
39public:
40 wxDataViewTextRenderer( const wxString &varianttype = wxT("string"),
41 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
42 int align = wxDVR_DEFAULT_ALIGNMENT );
43
44 bool SetValue( const wxVariant &value );
45 bool GetValue( wxVariant &value ) const;
46
62265c2c
VZ
47 virtual bool Render(wxRect cell, wxDC *dc, int state);
48 virtual wxSize GetSize() const;
6eec70b9
VZ
49
50 // in-place editing
51 virtual bool HasEditorCtrl() const;
52 virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
53 const wxVariant &value );
54 virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
55
56protected:
57 wxString m_text;
58
59protected:
60 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer)
61};
62
63// ---------------------------------------------------------
64// wxDataViewBitmapRenderer
65// ---------------------------------------------------------
66
67class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
68{
69public:
70 wxDataViewBitmapRenderer( const wxString &varianttype = wxT("wxBitmap"),
71 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
72 int align = wxDVR_DEFAULT_ALIGNMENT );
73
74 bool SetValue( const wxVariant &value );
75 bool GetValue( wxVariant &value ) const;
76
77 bool Render( wxRect cell, wxDC *dc, int state );
78 wxSize GetSize() const;
79
80private:
81 wxIcon m_icon;
82 wxBitmap m_bitmap;
83
84protected:
85 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer)
86};
87
88// ---------------------------------------------------------
89// wxDataViewToggleRenderer
90// ---------------------------------------------------------
91
92class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
93{
94public:
95 wxDataViewToggleRenderer( const wxString &varianttype = wxT("bool"),
96 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
97 int align = wxDVR_DEFAULT_ALIGNMENT );
98
99 bool SetValue( const wxVariant &value );
100 bool GetValue( wxVariant &value ) const;
101
102 bool Render( wxRect cell, wxDC *dc, int state );
103 bool Activate( wxRect cell, wxDataViewModel *model, const wxDataViewItem & item,
104 unsigned int col );
105 wxSize GetSize() const;
106
107private:
108 bool m_toggle;
109
110protected:
111 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer)
112};
113
114// ---------------------------------------------------------
115// wxDataViewProgressRenderer
116// ---------------------------------------------------------
117
118class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewRenderer
119{
120public:
121 wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
122 const wxString &varianttype = wxT("long"),
123 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
124 int align = wxDVR_DEFAULT_ALIGNMENT );
125
126 bool SetValue( const wxVariant &value );
127 bool GetValue( wxVariant& value ) const;
128
62265c2c 129 virtual bool Render(wxRect cell, wxDC *dc, int state);
6eec70b9
VZ
130 virtual wxSize GetSize() const;
131
132private:
133 wxString m_label;
134 int m_value;
135
136protected:
137 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer)
138};
139
140// ---------------------------------------------------------
141// wxDataViewIconTextRenderer
142// ---------------------------------------------------------
143
144class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewRenderer
145{
146public:
147 wxDataViewIconTextRenderer( const wxString &varianttype = wxT("wxDataViewIconText"),
148 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
149 int align = wxDVR_DEFAULT_ALIGNMENT );
150
151 bool SetValue( const wxVariant &value );
152 bool GetValue( wxVariant &value ) const;
153
62265c2c 154 virtual bool Render(wxRect cell, wxDC *dc, int state);
6eec70b9
VZ
155 virtual wxSize GetSize() const;
156
157 virtual bool HasEditorCtrl() const { return true; }
158 virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
159 const wxVariant &value );
160 virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
161
162private:
163 wxDataViewIconText m_value;
164
165protected:
166 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
167};
168
169// ---------------------------------------------------------
170// wxDataViewDateRenderer
171// ---------------------------------------------------------
172
173class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewRenderer
174{
175public:
176 wxDataViewDateRenderer( const wxString &varianttype = wxT("datetime"),
177 wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
178 int align = wxDVR_DEFAULT_ALIGNMENT );
179
180 bool SetValue( const wxVariant &value );
181 bool GetValue( wxVariant& value ) const;
182
183 virtual bool Render( wxRect cell, wxDC *dc, int state );
184 virtual wxSize GetSize() const;
185 virtual bool Activate( wxRect cell,
186 wxDataViewModel *model,
187 const wxDataViewItem& item,
188 unsigned int col );
189
190private:
191 wxDateTime m_date;
192
193protected:
194 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
195};
196
197
198#endif // _WX_GENERIC_DVRENDERERS_H_
199