]>
Commit | Line | Data |
---|---|---|
bcd846ea RR |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/dataview.h | |
3 | // Purpose: wxDataViewCtrl base classes | |
4 | // Author: Robert Roebling | |
b7e9f8b1 | 5 | // Modified by: Bo Yang |
bcd846ea RR |
6 | // Created: 08.01.06 |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Robert Roebling | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_DATAVIEW_H_BASE_ | |
13 | #define _WX_DATAVIEW_H_BASE_ | |
14 | ||
15 | #include "wx/defs.h" | |
16 | ||
17 | #if wxUSE_DATAVIEWCTRL | |
18 | ||
239eaa41 RR |
19 | #include "wx/control.h" |
20 | #include "wx/textctrl.h" | |
56873923 | 21 | #include "wx/headercol.h" |
64ffb888 | 22 | #include "wx/variant.h" |
b7e9f8b1 | 23 | #include "wx/dynarray.h" |
89352653 | 24 | #include "wx/icon.h" |
a75124d0 | 25 | #include "wx/imaglist.h" |
c232dfe5 | 26 | #include "wx/weakref.h" |
4ed7af08 | 27 | |
56873923 | 28 | #if !(defined(__WXGTK20__) || defined(__WXMAC__)) || defined(__WXUNIVERSAL__) |
a881f34e | 29 | // #if !(defined(__WXMAC__)) || defined(__WXUNIVERSAL__) |
56873923 VZ |
30 | #define wxHAS_GENERIC_DATAVIEWCTRL |
31 | #endif | |
32 | ||
5e6f8927 PC |
33 | class WXDLLIMPEXP_FWD_CORE wxDataFormat; |
34 | ||
bcd846ea | 35 | // ---------------------------------------------------------------------------- |
f554a14b | 36 | // wxDataViewCtrl flags |
bcd846ea RR |
37 | // ---------------------------------------------------------------------------- |
38 | ||
239eaa41 RR |
39 | // ---------------------------------------------------------------------------- |
40 | // wxDataViewCtrl globals | |
41 | // ---------------------------------------------------------------------------- | |
bcd846ea | 42 | |
b5dbe15d VS |
43 | class WXDLLIMPEXP_FWD_ADV wxDataViewItem; |
44 | class WXDLLIMPEXP_FWD_ADV wxDataViewModel; | |
45 | class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl; | |
46 | class WXDLLIMPEXP_FWD_ADV wxDataViewColumn; | |
47 | class WXDLLIMPEXP_FWD_ADV wxDataViewRenderer; | |
48 | class WXDLLIMPEXP_FWD_ADV wxDataViewModelNotifier; | |
fa28826d | 49 | |
23318a53 | 50 | extern WXDLLIMPEXP_DATA_ADV(const char) wxDataViewCtrlNameStr[]; |
bcd846ea | 51 | |
87f0efe2 RR |
52 | // the default width of new (text) columns: |
53 | #define wxDVC_DEFAULT_WIDTH 80 | |
54 | ||
55 | // the default width of new toggle columns: | |
56 | #define wxDVC_TOGGLE_DEFAULT_WIDTH 30 | |
57 | ||
9861f022 RR |
58 | // the default minimal width of the columns: |
59 | #define wxDVC_DEFAULT_MINWIDTH 30 | |
60 | ||
f2b7492a RR |
61 | // The default alignment of wxDataViewRenderers is to take |
62 | // the alignment from the column it owns. | |
63 | #define wxDVR_DEFAULT_ALIGNMENT -1 | |
9861f022 | 64 | |
87f0efe2 | 65 | |
f554a14b | 66 | // --------------------------------------------------------- |
e0062c04 | 67 | // wxDataViewItem |
f554a14b | 68 | // --------------------------------------------------------- |
239eaa41 | 69 | |
e0062c04 | 70 | class WXDLLIMPEXP_ADV wxDataViewItem |
239eaa41 RR |
71 | { |
72 | public: | |
b5ec7dd6 | 73 | wxDataViewItem( void* id = NULL ) |
9d52aad3 | 74 | { m_id = id; } |
e0062c04 | 75 | wxDataViewItem( const wxDataViewItem &item ) |
9d52aad3 RR |
76 | { m_id = item.m_id; } |
77 | bool IsOk() const { return m_id != NULL; } | |
78 | void* GetID() const { return m_id; } | |
4f1cf94b | 79 | operator const void* () const { return m_id; } |
b5ec7dd6 | 80 | |
e94d0c1e | 81 | #ifdef __WXDEBUG__ |
c3c62822 | 82 | void Print( const wxString &text ) const; |
e94d0c1e | 83 | #endif |
b5ec7dd6 | 84 | |
8f850e28 | 85 | private: |
9d52aad3 | 86 | void* m_id; |
64ffb888 | 87 | }; |
239eaa41 | 88 | |
d5025dc0 | 89 | bool operator == (const wxDataViewItem &left, const wxDataViewItem &right); |
aba9bfd0 | 90 | |
cd722937 RR |
91 | WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray); |
92 | ||
9d8fe14a RR |
93 | // --------------------------------------------------------- |
94 | // wxDataViewModelNotifier | |
95 | // --------------------------------------------------------- | |
96 | ||
97 | class WXDLLIMPEXP_ADV wxDataViewModelNotifier | |
98 | { | |
99 | public: | |
5e6f8927 | 100 | wxDataViewModelNotifier() { m_owner = NULL; } |
9d8fe14a RR |
101 | virtual ~wxDataViewModelNotifier() { m_owner = NULL; } |
102 | ||
103 | virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0; | |
104 | virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0; | |
105 | virtual bool ItemChanged( const wxDataViewItem &item ) = 0; | |
854cdb09 RR |
106 | virtual bool ItemsAdded( const wxDataViewItem &parent, const wxDataViewItemArray &items ); |
107 | virtual bool ItemsDeleted( const wxDataViewItem &parent, const wxDataViewItemArray &items ); | |
108 | virtual bool ItemsChanged( const wxDataViewItemArray &items ); | |
9d8fe14a RR |
109 | virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col ) = 0; |
110 | virtual bool Cleared() = 0; | |
b5ec7dd6 | 111 | |
d3f00f59 | 112 | virtual void Resort() = 0; |
9d8fe14a RR |
113 | |
114 | void SetOwner( wxDataViewModel *owner ) { m_owner = owner; } | |
e51bf699 | 115 | wxDataViewModel *GetOwner() const { return m_owner; } |
9d8fe14a RR |
116 | |
117 | private: | |
118 | wxDataViewModel *m_owner; | |
119 | }; | |
120 | ||
121 | ||
4264606e RR |
122 | |
123 | // ---------------------------------------------------------------------------- | |
124 | // wxDataViewItemAttr: a structure containing the visual attributes of an item | |
125 | // ---------------------------------------------------------------------------- | |
126 | ||
127 | // TODO: this should be renamed to wxItemAttr or something general like this | |
128 | ||
129 | class WXDLLIMPEXP_ADV wxDataViewItemAttr | |
130 | { | |
131 | public: | |
132 | // ctors | |
c058cafa VZ |
133 | wxDataViewItemAttr() |
134 | { | |
4264606e RR |
135 | m_bold = false; |
136 | m_italic = false; | |
137 | } | |
138 | ||
139 | // setters | |
140 | void SetColour(const wxColour& colour) { m_colour = colour; } | |
141 | void SetBold( bool set ) { m_bold = set; } | |
142 | void SetItalic( bool set ) { m_italic = set; } | |
c058cafa | 143 | |
4264606e RR |
144 | // accessors |
145 | bool HasColour() const { return m_colour.Ok(); } | |
146 | const wxColour& GetColour() const { return m_colour; } | |
c058cafa | 147 | |
4264606e RR |
148 | bool GetBold() const { return m_bold; } |
149 | bool GetItalic() const { return m_italic; } | |
150 | ||
151 | private: | |
152 | wxColour m_colour; | |
153 | bool m_bold; | |
154 | bool m_italic; | |
155 | }; | |
156 | ||
157 | ||
f554a14b | 158 | // --------------------------------------------------------- |
e0062c04 | 159 | // wxDataViewModel |
f554a14b | 160 | // --------------------------------------------------------- |
239eaa41 | 161 | |
d350fbec VS |
162 | WX_DECLARE_LIST_WITH_DECL(wxDataViewModelNotifier, wxDataViewModelNotifiers, |
163 | class WXDLLIMPEXP_ADV); | |
9d8fe14a | 164 | |
e0062c04 | 165 | class WXDLLIMPEXP_ADV wxDataViewModel: public wxObjectRefData |
239eaa41 RR |
166 | { |
167 | public: | |
e0062c04 | 168 | wxDataViewModel(); |
239eaa41 | 169 | |
9861f022 | 170 | virtual unsigned int GetColumnCount() const = 0; |
87f0efe2 | 171 | |
a7f61f76 | 172 | // return type as reported by wxVariant |
9861f022 | 173 | virtual wxString GetColumnType( unsigned int col ) const = 0; |
87f0efe2 | 174 | |
a7f61f76 | 175 | // get value into a wxVariant |
b5ec7dd6 | 176 | virtual void GetValue( wxVariant &variant, |
e0062c04 | 177 | const wxDataViewItem &item, unsigned int col ) const = 0; |
87f0efe2 | 178 | |
a7f61f76 | 179 | // set value, call ValueChanged() afterwards! |
b5ec7dd6 | 180 | virtual bool SetValue( const wxVariant &variant, |
e0062c04 | 181 | const wxDataViewItem &item, unsigned int col ) = 0; |
239eaa41 | 182 | |
4264606e RR |
183 | // Get text attribute, return false of default attributes should be used |
184 | virtual bool GetAttr( const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col), wxDataViewItemAttr &WXUNUSED(attr) ) | |
185 | { return false; } | |
186 | ||
e0062c04 | 187 | // define hierachy |
ed903e42 RR |
188 | virtual wxDataViewItem GetParent( const wxDataViewItem &item ) const = 0; |
189 | virtual bool IsContainer( const wxDataViewItem &item ) const = 0; | |
1e40f667 | 190 | // Is the container just a header or an item with all columns |
b5ec7dd6 VZ |
191 | virtual bool HasContainerColumns(const wxDataViewItem& WXUNUSED(item)) const |
192 | { return false; } | |
74fe973b | 193 | virtual unsigned int GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const = 0; |
b9b8b59c | 194 | |
f6f0ef85 RR |
195 | // define DnD capabilities |
196 | virtual bool IsDraggable( const wxDataViewItem &WXUNUSED(item) ) | |
197 | { return false; } | |
198 | virtual size_t GetDragDataSize( const wxDataViewItem &WXUNUSED(item), const wxDataFormat &WXUNUSED(format) ) | |
199 | { return 0; } | |
c058cafa | 200 | virtual bool GetDragData( const wxDataViewItem &WXUNUSED(item), const wxDataFormat &WXUNUSED(format), |
f6f0ef85 RR |
201 | void* WXUNUSED(data), size_t WXUNUSED(size) ) |
202 | { return FALSE; } | |
203 | ||
239eaa41 | 204 | // delegated notifiers |
e0062c04 | 205 | virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ); |
854cdb09 | 206 | virtual bool ItemsAdded( const wxDataViewItem &parent, const wxDataViewItemArray &items ); |
469d3e9b | 207 | virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item ); |
854cdb09 | 208 | virtual bool ItemsDeleted( const wxDataViewItem &parent, const wxDataViewItemArray &items ); |
e0062c04 | 209 | virtual bool ItemChanged( const wxDataViewItem &item ); |
854cdb09 | 210 | virtual bool ItemsChanged( const wxDataViewItemArray &items ); |
e0062c04 | 211 | virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col ); |
8981608c | 212 | virtual bool Cleared(); |
b5d777c7 | 213 | |
ef427989 RR |
214 | // delegatd action |
215 | virtual void Resort(); | |
216 | ||
e0062c04 RR |
217 | void AddNotifier( wxDataViewModelNotifier *notifier ); |
218 | void RemoveNotifier( wxDataViewModelNotifier *notifier ); | |
b5ec7dd6 | 219 | |
ef427989 | 220 | // default compare function |
b5ec7dd6 | 221 | virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2, |
7ee7191c | 222 | unsigned int column, bool ascending ); |
09711964 | 223 | virtual bool HasDefaultCompare() const { return false; } |
c058cafa | 224 | |
2056dede | 225 | // internal |
e39de702 | 226 | virtual bool IsVirtualListModel() const { return false; } |
66e09788 | 227 | |
87f0efe2 RR |
228 | protected: |
229 | // the user should not delete this class directly: he should use DecRef() instead! | |
5debbdcf | 230 | virtual ~wxDataViewModel() { } |
87f0efe2 | 231 | |
9d8fe14a | 232 | wxDataViewModelNotifiers m_notifiers; |
ef427989 RR |
233 | }; |
234 | ||
235 | // --------------------------------------------------------- | |
c534e696 | 236 | // wxDataViewIndexListModel |
ef427989 RR |
237 | // --------------------------------------------------------- |
238 | ||
d350fbec | 239 | class WXDLLIMPEXP_ADV wxDataViewIndexListModel: public wxDataViewModel |
ef427989 RR |
240 | { |
241 | public: | |
c534e696 | 242 | wxDataViewIndexListModel( unsigned int initial_size = 0 ); |
ef427989 | 243 | ~wxDataViewIndexListModel(); |
b5ec7dd6 | 244 | |
b5ec7dd6 | 245 | virtual void GetValue( wxVariant &variant, |
ef427989 RR |
246 | unsigned int row, unsigned int col ) const = 0; |
247 | ||
b5ec7dd6 | 248 | virtual bool SetValue( const wxVariant &variant, |
ef427989 | 249 | unsigned int row, unsigned int col ) = 0; |
b5ec7dd6 | 250 | |
4264606e RR |
251 | virtual bool GetAttr( unsigned int WXUNUSED(row), unsigned int WXUNUSED(col), wxDataViewItemAttr &WXUNUSED(attr) ) |
252 | { return false; } | |
c058cafa | 253 | |
c534e696 RR |
254 | void RowPrepended(); |
255 | void RowInserted( unsigned int before ); | |
256 | void RowAppended(); | |
257 | void RowDeleted( unsigned int row ); | |
8b6cf9bf | 258 | void RowsDeleted( const wxArrayInt &rows ); |
c534e696 RR |
259 | void RowChanged( unsigned int row ); |
260 | void RowValueChanged( unsigned int row, unsigned int col ); | |
33ba5a05 | 261 | void Reset( unsigned int new_size ); |
b5ec7dd6 | 262 | |
c534e696 | 263 | // convert to/from row/wxDataViewItem |
b5ec7dd6 | 264 | |
c534e696 RR |
265 | unsigned int GetRow( const wxDataViewItem &item ) const; |
266 | wxDataViewItem GetItem( unsigned int row ) const; | |
b5ec7dd6 | 267 | |
c534e696 | 268 | // compare based on index |
b5ec7dd6 VZ |
269 | |
270 | virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2, | |
7ee7191c | 271 | unsigned int column, bool ascending ); |
517166e6 | 272 | virtual bool HasDefaultCompare() const; |
c534e696 RR |
273 | |
274 | // implement base methods | |
275 | ||
b5ec7dd6 | 276 | virtual void GetValue( wxVariant &variant, |
c534e696 | 277 | const wxDataViewItem &item, unsigned int col ) const; |
b5ec7dd6 | 278 | virtual bool SetValue( const wxVariant &variant, |
c534e696 | 279 | const wxDataViewItem &item, unsigned int col ); |
4264606e | 280 | virtual bool GetAttr( const wxDataViewItem &item, unsigned int col, wxDataViewItemAttr &attr ); |
c534e696 RR |
281 | virtual wxDataViewItem GetParent( const wxDataViewItem &item ) const; |
282 | virtual bool IsContainer( const wxDataViewItem &item ) const; | |
74fe973b | 283 | virtual unsigned int GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const; |
b5ec7dd6 | 284 | |
2056dede | 285 | // internal |
e39de702 | 286 | virtual bool IsVirtualListModel() const { return false; } |
2056dede | 287 | unsigned int GetLastIndex() const { return m_lastIndex; } |
c058cafa | 288 | |
c534e696 | 289 | private: |
cd722937 | 290 | wxDataViewItemArray m_hash; |
c534e696 | 291 | unsigned int m_lastIndex; |
517166e6 | 292 | bool m_ordered; |
239eaa41 RR |
293 | }; |
294 | ||
e39de702 RR |
295 | // --------------------------------------------------------- |
296 | // wxDataViewVirtualListModel | |
297 | // --------------------------------------------------------- | |
298 | ||
299 | #ifdef __WXMAC__ | |
300 | // better than nothing | |
f1399150 | 301 | typedef wxDataViewIndexListModel wxDataViewVirtualListModel; |
e39de702 RR |
302 | #else |
303 | ||
304 | class WXDLLIMPEXP_ADV wxDataViewVirtualListModel: public wxDataViewModel | |
305 | { | |
306 | public: | |
307 | wxDataViewVirtualListModel( unsigned int initial_size = 0 ); | |
308 | ~wxDataViewVirtualListModel(); | |
309 | ||
310 | virtual void GetValue( wxVariant &variant, | |
311 | unsigned int row, unsigned int col ) const = 0; | |
312 | ||
313 | virtual bool SetValue( const wxVariant &variant, | |
314 | unsigned int row, unsigned int col ) = 0; | |
315 | ||
316 | virtual bool GetAttr( unsigned int WXUNUSED(row), unsigned int WXUNUSED(col), wxDataViewItemAttr &WXUNUSED(attr) ) | |
317 | { return false; } | |
318 | ||
319 | void RowPrepended(); | |
320 | void RowInserted( unsigned int before ); | |
321 | void RowAppended(); | |
322 | void RowDeleted( unsigned int row ); | |
323 | void RowsDeleted( const wxArrayInt &rows ); | |
324 | void RowChanged( unsigned int row ); | |
325 | void RowValueChanged( unsigned int row, unsigned int col ); | |
326 | void Reset( unsigned int new_size ); | |
327 | ||
328 | // convert to/from row/wxDataViewItem | |
329 | ||
330 | unsigned int GetRow( const wxDataViewItem &item ) const; | |
331 | wxDataViewItem GetItem( unsigned int row ) const; | |
332 | ||
333 | // compare based on index | |
334 | ||
335 | virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2, | |
336 | unsigned int column, bool ascending ); | |
337 | virtual bool HasDefaultCompare() const; | |
338 | ||
339 | // implement base methods | |
340 | ||
341 | virtual void GetValue( wxVariant &variant, | |
342 | const wxDataViewItem &item, unsigned int col ) const; | |
343 | virtual bool SetValue( const wxVariant &variant, | |
344 | const wxDataViewItem &item, unsigned int col ); | |
345 | virtual bool GetAttr( const wxDataViewItem &item, unsigned int col, wxDataViewItemAttr &attr ); | |
346 | virtual wxDataViewItem GetParent( const wxDataViewItem &item ) const; | |
347 | virtual bool IsContainer( const wxDataViewItem &item ) const; | |
348 | virtual unsigned int GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const; | |
349 | ||
350 | // internal | |
351 | virtual bool IsVirtualListModel() const { return true; } | |
352 | unsigned int GetLastIndex() const { return m_lastIndex; } | |
353 | ||
354 | private: | |
355 | wxDataViewItemArray m_hash; | |
356 | unsigned int m_lastIndex; | |
357 | bool m_ordered; | |
358 | }; | |
359 | #endif | |
c33edc08 | 360 | |
1e510b1e RR |
361 | //----------------------------------------------------------------------------- |
362 | // wxDataViewEditorCtrlEvtHandler | |
363 | //----------------------------------------------------------------------------- | |
364 | ||
365 | class wxDataViewEditorCtrlEvtHandler: public wxEvtHandler | |
366 | { | |
367 | public: | |
368 | wxDataViewEditorCtrlEvtHandler( wxControl *editor, wxDataViewRenderer *owner ); | |
b5ec7dd6 | 369 | |
1e510b1e | 370 | void AcceptChangesAndFinish(); |
30715fa1 | 371 | void SetFocusOnIdle( bool focus = true ) { m_focusOnIdle = focus; } |
1e510b1e RR |
372 | |
373 | protected: | |
374 | void OnChar( wxKeyEvent &event ); | |
724852da | 375 | void OnTextEnter( wxCommandEvent &event ); |
1e510b1e | 376 | void OnKillFocus( wxFocusEvent &event ); |
30715fa1 | 377 | void OnIdle( wxIdleEvent &event ); |
1e510b1e RR |
378 | |
379 | private: | |
380 | wxDataViewRenderer *m_owner; | |
381 | wxControl *m_editorCtrl; | |
382 | bool m_finished; | |
30715fa1 | 383 | bool m_focusOnIdle; |
1e510b1e RR |
384 | |
385 | private: | |
386 | DECLARE_EVENT_TABLE() | |
387 | }; | |
388 | ||
f554a14b | 389 | // --------------------------------------------------------- |
baa9ebc4 | 390 | // wxDataViewRendererBase |
f554a14b | 391 | // --------------------------------------------------------- |
fa28826d | 392 | |
6842a71a | 393 | enum wxDataViewCellMode |
fa28826d | 394 | { |
6842a71a RR |
395 | wxDATAVIEW_CELL_INERT, |
396 | wxDATAVIEW_CELL_ACTIVATABLE, | |
397 | wxDATAVIEW_CELL_EDITABLE | |
fa28826d RR |
398 | }; |
399 | ||
6842a71a RR |
400 | enum wxDataViewCellRenderState |
401 | { | |
402 | wxDATAVIEW_CELL_SELECTED = 1, | |
403 | wxDATAVIEW_CELL_PRELIT = 2, | |
404 | wxDATAVIEW_CELL_INSENSITIVE = 4, | |
405 | wxDATAVIEW_CELL_FOCUSED = 8 | |
406 | }; | |
407 | ||
baa9ebc4 | 408 | class WXDLLIMPEXP_ADV wxDataViewRendererBase: public wxObject |
6842a71a RR |
409 | { |
410 | public: | |
b5ec7dd6 | 411 | wxDataViewRendererBase( const wxString &varianttype, |
9861f022 RR |
412 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, |
413 | int alignment = wxDVR_DEFAULT_ALIGNMENT ); | |
c232dfe5 | 414 | ~wxDataViewRendererBase(); |
6842a71a | 415 | |
9861f022 RR |
416 | virtual bool Validate( wxVariant& WXUNUSED(value) ) |
417 | { return true; } | |
f554a14b | 418 | |
6842a71a | 419 | void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; } |
e51bf699 | 420 | wxDataViewColumn* GetOwner() const { return m_owner; } |
f554a14b | 421 | |
9861f022 RR |
422 | // renderer properties: |
423 | ||
424 | virtual bool SetValue( const wxVariant& WXUNUSED(value) ) = 0; | |
425 | virtual bool GetValue( wxVariant& WXUNUSED(value) ) const = 0; | |
426 | ||
427 | wxString GetVariantType() const { return m_variantType; } | |
428 | ||
429 | virtual void SetMode( wxDataViewCellMode mode ) = 0; | |
430 | virtual wxDataViewCellMode GetMode() const = 0; | |
431 | ||
432 | // NOTE: Set/GetAlignment do not take/return a wxAlignment enum but | |
433 | // rather an "int"; that's because for rendering cells it's allowed | |
434 | // to combine alignment flags (e.g. wxALIGN_LEFT|wxALIGN_BOTTOM) | |
435 | virtual void SetAlignment( int align ) = 0; | |
436 | virtual int GetAlignment() const = 0; | |
b5ec7dd6 | 437 | |
1e510b1e RR |
438 | // in-place editing |
439 | virtual bool HasEditorCtrl() | |
440 | { return false; } | |
96c2a0dd VZ |
441 | virtual wxControl* CreateEditorCtrl(wxWindow * WXUNUSED(parent), |
442 | wxRect WXUNUSED(labelRect), | |
443 | const wxVariant& WXUNUSED(value)) | |
1e510b1e | 444 | { return NULL; } |
96c2a0dd VZ |
445 | virtual bool GetValueFromEditorCtrl(wxControl * WXUNUSED(editor), |
446 | wxVariant& WXUNUSED(value)) | |
1e510b1e RR |
447 | { return false; } |
448 | ||
e0062c04 | 449 | virtual bool StartEditing( const wxDataViewItem &item, wxRect labelRect ); |
1e510b1e RR |
450 | virtual void CancelEditing(); |
451 | virtual bool FinishEditing(); | |
b5ec7dd6 | 452 | |
1e510b1e | 453 | wxControl *GetEditorCtrl() { return m_editorCtrl; } |
b5ec7dd6 | 454 | |
a7f61f76 | 455 | protected: |
6842a71a RR |
456 | wxString m_variantType; |
457 | wxDataViewColumn *m_owner; | |
c232dfe5 | 458 | wxWeakRef<wxControl> m_editorCtrl; |
e0062c04 | 459 | wxDataViewItem m_item; // for m_editorCtrl |
6842a71a | 460 | |
9861f022 RR |
461 | // internal utility: |
462 | const wxDataViewCtrl* GetView() const; | |
463 | ||
6842a71a | 464 | protected: |
baa9ebc4 | 465 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase) |
6842a71a RR |
466 | }; |
467 | ||
89352653 RR |
468 | //----------------------------------------------------------------------------- |
469 | // wxDataViewIconText | |
470 | //----------------------------------------------------------------------------- | |
471 | ||
d350fbec | 472 | class WXDLLIMPEXP_ADV wxDataViewIconText: public wxObject |
89352653 RR |
473 | { |
474 | public: | |
475 | wxDataViewIconText( const wxString &text = wxEmptyString, const wxIcon& icon = wxNullIcon ) | |
5e6f8927 PC |
476 | : m_text(text), m_icon(icon) |
477 | { } | |
89352653 | 478 | wxDataViewIconText( const wxDataViewIconText &other ) |
4f271814 | 479 | : wxObject() |
344ed1f3 | 480 | { m_icon = other.m_icon; m_text = other.m_text; } |
89352653 RR |
481 | |
482 | void SetText( const wxString &text ) { m_text = text; } | |
483 | wxString GetText() const { return m_text; } | |
484 | void SetIcon( const wxIcon &icon ) { m_icon = icon; } | |
485 | const wxIcon &GetIcon() const { return m_icon; } | |
486 | ||
487 | private: | |
488 | wxString m_text; | |
489 | wxIcon m_icon; | |
490 | ||
491 | private: | |
492 | DECLARE_DYNAMIC_CLASS(wxDataViewIconText) | |
493 | }; | |
494 | ||
495 | bool operator == (const wxDataViewIconText &one, const wxDataViewIconText &two); | |
496 | ||
d350fbec | 497 | DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_ADV) |
89352653 | 498 | |
f554a14b | 499 | // --------------------------------------------------------- |
6842a71a | 500 | // wxDataViewColumnBase |
f554a14b | 501 | // --------------------------------------------------------- |
6842a71a | 502 | |
56873923 | 503 | // for compatibility only, do not use |
fa28826d RR |
504 | enum wxDataViewColumnFlags |
505 | { | |
56873923 VZ |
506 | wxDATAVIEW_COL_RESIZABLE = wxCOL_RESIZABLE, |
507 | wxDATAVIEW_COL_SORTABLE = wxCOL_SORTABLE, | |
508 | wxDATAVIEW_COL_REORDERABLE = wxCOL_REORDERABLE, | |
509 | wxDATAVIEW_COL_HIDDEN = wxCOL_HIDDEN | |
fa28826d RR |
510 | }; |
511 | ||
dcb6cbec | 512 | class WXDLLIMPEXP_ADV wxDataViewColumnBase : public wxSettableHeaderColumn |
fa28826d RR |
513 | { |
514 | public: | |
e2bfe673 VZ |
515 | // ctor for the text columns: takes ownership of renderer |
516 | wxDataViewColumnBase(wxDataViewRenderer *renderer, | |
517 | unsigned int model_column) | |
518 | { | |
519 | Init(renderer, model_column); | |
520 | } | |
521 | ||
522 | // ctor for the bitmap columns | |
523 | wxDataViewColumnBase(const wxBitmap& bitmap, | |
524 | wxDataViewRenderer *renderer, | |
525 | unsigned int model_column) | |
526 | : m_bitmap(bitmap) | |
527 | { | |
528 | Init(renderer, model_column); | |
529 | } | |
530 | ||
d3c7fc99 | 531 | virtual ~wxDataViewColumnBase(); |
fa28826d | 532 | |
9861f022 | 533 | // setters: |
b5ec7dd6 | 534 | virtual void SetOwner( wxDataViewCtrl *owner ) |
9861f022 | 535 | { m_owner = owner; } |
f554a14b | 536 | |
9861f022 | 537 | // getters: |
56873923 | 538 | unsigned int GetModelColumn() const { return static_cast<unsigned int>(m_model_column); } |
594d5596 RR |
539 | wxDataViewCtrl *GetOwner() const { return m_owner; } |
540 | wxDataViewRenderer* GetRenderer() const { return m_renderer; } | |
9861f022 | 541 | |
56873923 VZ |
542 | // implement some of base class pure virtuals (the rest is port-dependent |
543 | // and done differently in generic and native versions) | |
544 | virtual void SetBitmap( const wxBitmap& bitmap ) { m_bitmap = bitmap; } | |
545 | virtual wxBitmap GetBitmap() const { return m_bitmap; } | |
56873923 | 546 | |
9861f022 | 547 | protected: |
baa9ebc4 | 548 | wxDataViewRenderer *m_renderer; |
6842a71a | 549 | int m_model_column; |
07a84e7b | 550 | wxBitmap m_bitmap; |
6842a71a | 551 | wxDataViewCtrl *m_owner; |
fa28826d | 552 | |
e2bfe673 VZ |
553 | private: |
554 | // common part of all ctors | |
555 | void Init(wxDataViewRenderer *renderer, unsigned int model_column); | |
fa28826d RR |
556 | }; |
557 | ||
f554a14b | 558 | // --------------------------------------------------------- |
239eaa41 | 559 | // wxDataViewCtrlBase |
f554a14b | 560 | // --------------------------------------------------------- |
239eaa41 | 561 | |
c21f7aa1 | 562 | #define wxDV_SINGLE 0x0000 // for convenience |
9861f022 RR |
563 | #define wxDV_MULTIPLE 0x0001 // can select multiple items |
564 | ||
565 | #define wxDV_NO_HEADER 0x0002 // column titles not visible | |
566 | #define wxDV_HORIZ_RULES 0x0004 // light horizontal rules between rows | |
567 | #define wxDV_VERT_RULES 0x0008 // light vertical rules between columns | |
c21f7aa1 | 568 | |
1a07a730 | 569 | #define wxDV_ROW_LINES 0x0010 // alternating colour in rows |
344ed1f3 | 570 | #define wxDV_VARIABLE_LINE_HEIGHT 0x0020 // variable line height |
1a07a730 | 571 | |
f460c29d | 572 | class WXDLLIMPEXP_ADV wxDataViewCtrlBase: public wxControl |
239eaa41 RR |
573 | { |
574 | public: | |
575 | wxDataViewCtrlBase(); | |
d3c7fc99 | 576 | virtual ~wxDataViewCtrlBase(); |
f554a14b | 577 | |
e0062c04 RR |
578 | virtual bool AssociateModel( wxDataViewModel *model ); |
579 | wxDataViewModel* GetModel(); | |
a75124d0 | 580 | const wxDataViewModel* GetModel() const; |
f554a14b | 581 | |
07a84e7b | 582 | // short cuts |
b5ec7dd6 | 583 | wxDataViewColumn *PrependTextColumn( const wxString &label, unsigned int model_column, |
736fe67c | 584 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, |
56873923 | 585 | wxAlignment align = wxALIGN_NOT, |
736fe67c | 586 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
b5ec7dd6 | 587 | wxDataViewColumn *PrependIconTextColumn( const wxString &label, unsigned int model_column, |
736fe67c | 588 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, |
56873923 | 589 | wxAlignment align = wxALIGN_NOT, |
736fe67c RR |
590 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
591 | wxDataViewColumn *PrependToggleColumn( const wxString &label, unsigned int model_column, | |
592 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH, | |
593 | wxAlignment align = wxALIGN_CENTER, | |
594 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
b5ec7dd6 | 595 | wxDataViewColumn *PrependProgressColumn( const wxString &label, unsigned int model_column, |
736fe67c RR |
596 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH, |
597 | wxAlignment align = wxALIGN_CENTER, | |
598 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
599 | wxDataViewColumn *PrependDateColumn( const wxString &label, unsigned int model_column, | |
600 | wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1, | |
56873923 | 601 | wxAlignment align = wxALIGN_NOT, |
736fe67c RR |
602 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
603 | wxDataViewColumn *PrependBitmapColumn( const wxString &label, unsigned int model_column, | |
604 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, | |
605 | wxAlignment align = wxALIGN_CENTER, | |
606 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
607 | wxDataViewColumn *PrependTextColumn( const wxBitmap &label, unsigned int model_column, | |
608 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, | |
56873923 | 609 | wxAlignment align = wxALIGN_NOT, |
736fe67c RR |
610 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
611 | wxDataViewColumn *PrependIconTextColumn( const wxBitmap &label, unsigned int model_column, | |
612 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, | |
56873923 | 613 | wxAlignment align = wxALIGN_NOT, |
736fe67c RR |
614 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
615 | wxDataViewColumn *PrependToggleColumn( const wxBitmap &label, unsigned int model_column, | |
616 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH, | |
617 | wxAlignment align = wxALIGN_CENTER, | |
618 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
619 | wxDataViewColumn *PrependProgressColumn( const wxBitmap &label, unsigned int model_column, | |
620 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH, | |
621 | wxAlignment align = wxALIGN_CENTER, | |
622 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
623 | wxDataViewColumn *PrependDateColumn( const wxBitmap &label, unsigned int model_column, | |
624 | wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1, | |
56873923 | 625 | wxAlignment align = wxALIGN_NOT, |
736fe67c RR |
626 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
627 | wxDataViewColumn *PrependBitmapColumn( const wxBitmap &label, unsigned int model_column, | |
628 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, | |
629 | wxAlignment align = wxALIGN_CENTER, | |
630 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
b5ec7dd6 VZ |
631 | |
632 | wxDataViewColumn *AppendTextColumn( const wxString &label, unsigned int model_column, | |
87f0efe2 | 633 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, |
56873923 | 634 | wxAlignment align = wxALIGN_NOT, |
87f0efe2 | 635 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
b5ec7dd6 | 636 | wxDataViewColumn *AppendIconTextColumn( const wxString &label, unsigned int model_column, |
b04fcede | 637 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, |
56873923 | 638 | wxAlignment align = wxALIGN_NOT, |
b04fcede | 639 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
c7074d44 | 640 | wxDataViewColumn *AppendToggleColumn( const wxString &label, unsigned int model_column, |
87f0efe2 RR |
641 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH, |
642 | wxAlignment align = wxALIGN_CENTER, | |
643 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
b5ec7dd6 | 644 | wxDataViewColumn *AppendProgressColumn( const wxString &label, unsigned int model_column, |
87f0efe2 RR |
645 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH, |
646 | wxAlignment align = wxALIGN_CENTER, | |
647 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
c7074d44 | 648 | wxDataViewColumn *AppendDateColumn( const wxString &label, unsigned int model_column, |
87f0efe2 | 649 | wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1, |
56873923 | 650 | wxAlignment align = wxALIGN_NOT, |
87f0efe2 | 651 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
c7074d44 | 652 | wxDataViewColumn *AppendBitmapColumn( const wxString &label, unsigned int model_column, |
87f0efe2 RR |
653 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, |
654 | wxAlignment align = wxALIGN_CENTER, | |
655 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
c7074d44 | 656 | wxDataViewColumn *AppendTextColumn( const wxBitmap &label, unsigned int model_column, |
87f0efe2 | 657 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, |
56873923 | 658 | wxAlignment align = wxALIGN_NOT, |
87f0efe2 | 659 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
b04fcede RR |
660 | wxDataViewColumn *AppendIconTextColumn( const wxBitmap &label, unsigned int model_column, |
661 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, | |
56873923 | 662 | wxAlignment align = wxALIGN_NOT, |
b04fcede | 663 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
c7074d44 | 664 | wxDataViewColumn *AppendToggleColumn( const wxBitmap &label, unsigned int model_column, |
87f0efe2 RR |
665 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH, |
666 | wxAlignment align = wxALIGN_CENTER, | |
667 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
c7074d44 | 668 | wxDataViewColumn *AppendProgressColumn( const wxBitmap &label, unsigned int model_column, |
87f0efe2 RR |
669 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH, |
670 | wxAlignment align = wxALIGN_CENTER, | |
671 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
c7074d44 | 672 | wxDataViewColumn *AppendDateColumn( const wxBitmap &label, unsigned int model_column, |
87f0efe2 | 673 | wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1, |
56873923 | 674 | wxAlignment align = wxALIGN_NOT, |
87f0efe2 | 675 | int flags = wxDATAVIEW_COL_RESIZABLE ); |
c7074d44 | 676 | wxDataViewColumn *AppendBitmapColumn( const wxBitmap &label, unsigned int model_column, |
87f0efe2 RR |
677 | wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1, |
678 | wxAlignment align = wxALIGN_CENTER, | |
679 | int flags = wxDATAVIEW_COL_RESIZABLE ); | |
736fe67c RR |
680 | |
681 | ||
682 | virtual bool PrependColumn( wxDataViewColumn *col ); | |
19723525 | 683 | virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col ); |
f554a14b | 684 | virtual bool AppendColumn( wxDataViewColumn *col ); |
9861f022 | 685 | |
91a6c655 RR |
686 | virtual unsigned int GetColumnCount() const = 0; |
687 | virtual wxDataViewColumn* GetColumn( unsigned int pos ) const = 0; | |
453091c2 | 688 | virtual int GetColumnPosition( const wxDataViewColumn *column ) const = 0; |
b5ec7dd6 | 689 | |
91a6c655 RR |
690 | virtual bool DeleteColumn( wxDataViewColumn *column ) = 0; |
691 | virtual bool ClearColumns() = 0; | |
b5ec7dd6 | 692 | |
1b27b2bd | 693 | void SetExpanderColumn( wxDataViewColumn *col ) |
3b6280be | 694 | { m_expander_column = col ; DoSetExpanderColumn(); } |
b5ec7dd6 | 695 | wxDataViewColumn *GetExpanderColumn() const |
3b6280be | 696 | { return m_expander_column; } |
b5ec7dd6 | 697 | |
21f47fb9 | 698 | virtual wxDataViewColumn *GetSortingColumn() const = 0; |
23318a53 | 699 | |
3b6280be RR |
700 | void SetIndent( int indent ) |
701 | { m_indent = indent ; DoSetIndent(); } | |
b5ec7dd6 VZ |
702 | int GetIndent() const |
703 | { return m_indent; } | |
3b6280be | 704 | |
fbda518c | 705 | virtual wxDataViewItem GetSelection() const = 0; |
b7e9f8b1 RR |
706 | virtual int GetSelections( wxDataViewItemArray & sel ) const = 0; |
707 | virtual void SetSelections( const wxDataViewItemArray & sel ) = 0; | |
708 | virtual void Select( const wxDataViewItem & item ) = 0; | |
709 | virtual void Unselect( const wxDataViewItem & item ) = 0; | |
710 | virtual bool IsSelected( const wxDataViewItem & item ) const = 0; | |
711 | ||
b7e9f8b1 RR |
712 | virtual void SelectAll() = 0; |
713 | virtual void UnselectAll() = 0; | |
714 | ||
f71d3ba4 | 715 | virtual void Expand( const wxDataViewItem & item ) = 0; |
4219d8b0 | 716 | virtual void ExpandAncestors( const wxDataViewItem & item ); |
f71d3ba4 | 717 | virtual void Collapse( const wxDataViewItem & item ) = 0; |
739a8399 | 718 | virtual bool IsExpanded( const wxDataViewItem & item ) const = 0; |
f71d3ba4 | 719 | |
6154212e | 720 | virtual void EnsureVisible( const wxDataViewItem & item, |
4219d8b0 | 721 | const wxDataViewColumn *column = NULL ) = 0; |
a87b466d | 722 | virtual void HitTest( const wxPoint & point, wxDataViewItem &item, wxDataViewColumn* &column ) const = 0; |
fbda518c | 723 | virtual wxRect GetItemRect( const wxDataViewItem & item, const wxDataViewColumn *column = NULL ) const = 0; |
b7e9f8b1 | 724 | |
3b6280be RR |
725 | protected: |
726 | virtual void DoSetExpanderColumn() = 0 ; | |
727 | virtual void DoSetIndent() = 0; | |
728 | ||
239eaa41 | 729 | private: |
e0062c04 | 730 | wxDataViewModel *m_model; |
1b27b2bd | 731 | wxDataViewColumn *m_expander_column; |
3b6280be | 732 | int m_indent ; |
b5ec7dd6 | 733 | |
239eaa41 | 734 | protected: |
260b9be7 | 735 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase) |
239eaa41 | 736 | }; |
bcd846ea | 737 | |
eb7f97f8 RR |
738 | // ---------------------------------------------------------------------------- |
739 | // wxDataViewEvent - the event class for the wxDataViewCtrl notifications | |
740 | // ---------------------------------------------------------------------------- | |
741 | ||
2f799ae8 | 742 | class WXDLLIMPEXP_ADV wxDataViewEvent : public wxNotifyEvent |
eb7f97f8 RR |
743 | { |
744 | public: | |
745 | wxDataViewEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) | |
746 | : wxNotifyEvent(commandType, winid), | |
e0062c04 | 747 | m_item(0), |
eb7f97f8 | 748 | m_col(-1), |
eb7f97f8 RR |
749 | m_model(NULL), |
750 | m_value(wxNullVariant), | |
6af3eec2 RR |
751 | m_column(NULL), |
752 | m_pos(-1,-1) | |
eb7f97f8 RR |
753 | { } |
754 | ||
755 | wxDataViewEvent(const wxDataViewEvent& event) | |
756 | : wxNotifyEvent(event), | |
e0062c04 | 757 | m_item(event.m_item), |
eb7f97f8 | 758 | m_col(event.m_col), |
eb7f97f8 RR |
759 | m_model(event.m_model), |
760 | m_value(event.m_value), | |
6af3eec2 RR |
761 | m_column(event.m_column), |
762 | m_pos(m_pos) | |
eb7f97f8 RR |
763 | { } |
764 | ||
e0062c04 RR |
765 | wxDataViewItem GetItem() const { return m_item; } |
766 | void SetItem( const wxDataViewItem &item ) { m_item = item; } | |
767 | ||
eb7f97f8 RR |
768 | int GetColumn() const { return m_col; } |
769 | void SetColumn( int col ) { m_col = col; } | |
9861f022 | 770 | |
eb7f97f8 RR |
771 | wxDataViewModel* GetModel() const { return m_model; } |
772 | void SetModel( wxDataViewModel *model ) { m_model = model; } | |
9861f022 | 773 | |
eb7f97f8 RR |
774 | const wxVariant &GetValue() const { return m_value; } |
775 | void SetValue( const wxVariant &value ) { m_value = value; } | |
776 | ||
31fb32e1 RR |
777 | // for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only |
778 | void SetDataViewColumn( wxDataViewColumn *col ) { m_column = col; } | |
9861f022 | 779 | wxDataViewColumn *GetDataViewColumn() const { return m_column; } |
c058cafa | 780 | |
6af3eec2 | 781 | // for wxEVT_DATAVIEW_CONTEXT_MENU only |
5cfb6fee | 782 | wxPoint GetPosition() const { return m_pos; } |
6af3eec2 | 783 | void SetPosition( int x, int y ) { m_pos.x = x; m_pos.y = y; } |
31fb32e1 | 784 | |
eb7f97f8 RR |
785 | virtual wxEvent *Clone() const { return new wxDataViewEvent(*this); } |
786 | ||
787 | protected: | |
e0062c04 | 788 | wxDataViewItem m_item; |
eb7f97f8 | 789 | int m_col; |
eb7f97f8 RR |
790 | wxDataViewModel *m_model; |
791 | wxVariant m_value; | |
31fb32e1 | 792 | wxDataViewColumn *m_column; |
6af3eec2 | 793 | wxPoint m_pos; |
eb7f97f8 RR |
794 | |
795 | private: | |
796 | DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent) | |
797 | }; | |
798 | ||
3c778901 | 799 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEvent ) |
c058cafa | 800 | |
3c778901 VZ |
801 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEvent ) |
802 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, wxDataViewEvent ) | |
803 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, wxDataViewEvent ) | |
804 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, wxDataViewEvent ) | |
805 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, wxDataViewEvent ) | |
806 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED, wxDataViewEvent ) | |
807 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, wxDataViewEvent ) | |
808 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEvent ) | |
c058cafa | 809 | |
3c778901 | 810 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEvent ) |
c058cafa | 811 | |
3c778901 VZ |
812 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, wxDataViewEvent ) |
813 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, wxDataViewEvent ) | |
814 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, wxDataViewEvent ) | |
815 | wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED, wxDataViewEvent ) | |
eb7f97f8 RR |
816 | |
817 | typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&); | |
818 | ||
819 | #define wxDataViewEventHandler(func) \ | |
3c778901 | 820 | wxEVENT_HANDLER_CAST(wxDataViewEventFunction, func) |
eb7f97f8 RR |
821 | |
822 | #define wx__DECLARE_DATAVIEWEVT(evt, id, fn) \ | |
823 | wx__DECLARE_EVT1(wxEVT_COMMAND_DATAVIEW_ ## evt, id, wxDataViewEventHandler(fn)) | |
824 | ||
d86c1870 RR |
825 | #define EVT_DATAVIEW_SELECTION_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(SELECTION_CHANGED, id, fn) |
826 | ||
e0062c04 | 827 | #define EVT_DATAVIEW_ITEM_ACTIVATED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_ACTIVATED, id, fn) |
6977c3bf | 828 | #define EVT_DATAVIEW_ITEM_COLLAPSING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSING, id, fn) |
3ecb8a53 | 829 | #define EVT_DATAVIEW_ITEM_COLLAPSED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSED, id, fn) |
6977c3bf | 830 | #define EVT_DATAVIEW_ITEM_EXPANDING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDING, id, fn) |
3ecb8a53 | 831 | #define EVT_DATAVIEW_ITEM_EXPANDED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDED, id, fn) |
e0000f94 RR |
832 | #define EVT_DATAVIEW_ITEM_EDITING_STARTED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_STARTED, id, fn) |
833 | #define EVT_DATAVIEW_ITEM_EDITING_DONE(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_DONE, id, fn) | |
6608fdab | 834 | #define EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_VALUE_CHANGED, id, fn) |
e0000f94 | 835 | |
6af3eec2 RR |
836 | #define EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_CONTEXT_MENU, id, fn) |
837 | ||
31fb32e1 RR |
838 | #define EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_CLICK, id, fn) |
839 | #define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_RIGHT_CLICK, id, fn) | |
c0a66d92 | 840 | #define EVT_DATAVIEW_COLUMN_SORTED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_SORTED, id, fn) |
e483dfcb | 841 | #define EVT_DATAVIEW_COLUMN_REORDERED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_REORDERED, id, fn) |
eb7f97f8 | 842 | |
fe9fb970 | 843 | |
56873923 VZ |
844 | #ifdef wxHAS_GENERIC_DATAVIEWCTRL |
845 | // this symbol doesn't follow the convention for wxUSE_XXX symbols which | |
846 | // are normally always defined as either 0 or 1, so its use is deprecated | |
847 | // and it only exists for backwards compatibility, don't use it any more | |
848 | // and use wxHAS_GENERIC_DATAVIEWCTRL instead | |
849 | #define wxUSE_GENERICDATAVIEWCTRL | |
850 | ||
851 | #include "wx/generic/dataview.h" | |
852 | #elif defined(__WXGTK20__) | |
bcd846ea | 853 | #include "wx/gtk/dataview.h" |
56873923 | 854 | #elif defined(__WXMAC__) |
ef0e9220 | 855 | #include "wx/osx/dataview.h" |
bcd846ea | 856 | #else |
56873923 | 857 | #error "unknown native wxDataViewCtrl implementation" |
bcd846ea RR |
858 | #endif |
859 | ||
52e750fc RR |
860 | // ------------------------------------- |
861 | // wxDataViewSpinRenderer | |
862 | // ------------------------------------- | |
863 | ||
4660b556 | 864 | class WXDLLIMPEXP_ADV wxDataViewSpinRenderer: public wxDataViewCustomRenderer |
52e750fc RR |
865 | { |
866 | public: | |
867 | wxDataViewSpinRenderer( int min, int max, | |
868 | wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE, | |
869 | int alignment = wxDVR_DEFAULT_ALIGNMENT ); | |
870 | virtual bool HasEditorCtrl() { return true; } | |
871 | virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value ); | |
872 | virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value ); | |
873 | virtual bool Render( wxRect rect, wxDC *dc, int state ); | |
874 | virtual wxSize GetSize() const; | |
875 | virtual bool SetValue( const wxVariant &value ); | |
876 | virtual bool GetValue( wxVariant &value ) const; | |
b5ec7dd6 | 877 | |
52e750fc RR |
878 | private: |
879 | long m_data; | |
880 | long m_min,m_max; | |
881 | }; | |
882 | ||
a881f34e | 883 | #if defined(wxHAS_GENERIC_DATAVIEWCTRL) || defined(__WXMAC__) |
7448d67c RR |
884 | |
885 | // ------------------------------------- | |
886 | // wxDataViewChoiceRenderer | |
887 | // ------------------------------------- | |
888 | ||
889 | class WXDLLIMPEXP_ADV wxDataViewChoiceRenderer: public wxDataViewCustomRenderer | |
890 | { | |
891 | public: | |
892 | wxDataViewChoiceRenderer( const wxArrayString &choices, | |
893 | wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE, | |
894 | int alignment = wxDVR_DEFAULT_ALIGNMENT ); | |
895 | virtual bool HasEditorCtrl() { return true; } | |
896 | virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value ); | |
897 | virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value ); | |
898 | virtual bool Render( wxRect rect, wxDC *dc, int state ); | |
899 | virtual wxSize GetSize() const; | |
900 | virtual bool SetValue( const wxVariant &value ); | |
901 | virtual bool GetValue( wxVariant &value ) const; | |
902 | ||
903 | private: | |
904 | wxArrayString m_choices; | |
905 | wxString m_data; | |
906 | }; | |
907 | ||
908 | #endif | |
909 | ||
e94d0c1e RR |
910 | //----------------------------------------------------------------------------- |
911 | // wxDataViewTreeStore | |
912 | //----------------------------------------------------------------------------- | |
913 | ||
914 | class WXDLLIMPEXP_ADV wxDataViewTreeStoreNode | |
915 | { | |
916 | public: | |
917 | wxDataViewTreeStoreNode( wxDataViewTreeStoreNode *parent, | |
918 | const wxString &text, const wxIcon &icon = wxNullIcon, wxClientData *data = NULL ); | |
919 | virtual ~wxDataViewTreeStoreNode(); | |
b5ec7dd6 VZ |
920 | |
921 | void SetText( const wxString &text ) | |
e94d0c1e RR |
922 | { m_text = text; } |
923 | wxString GetText() const | |
924 | { return m_text; } | |
925 | void SetIcon( const wxIcon &icon ) | |
926 | { m_icon = icon; } | |
927 | const wxIcon &GetIcon() const | |
928 | { return m_icon; } | |
929 | void SetData( wxClientData *data ) | |
930 | { if (m_data) delete m_data; m_data = data; } | |
931 | wxClientData *GetData() const | |
932 | { return m_data; } | |
b5ec7dd6 | 933 | |
e94d0c1e RR |
934 | wxDataViewItem GetItem() const |
935 | { return wxDataViewItem( (void*) this ); } | |
b5ec7dd6 | 936 | |
e94d0c1e RR |
937 | virtual bool IsContainer() |
938 | { return false; } | |
b5ec7dd6 | 939 | |
e94d0c1e RR |
940 | wxDataViewTreeStoreNode *GetParent() |
941 | { return m_parent; } | |
b5ec7dd6 | 942 | |
e94d0c1e RR |
943 | private: |
944 | wxDataViewTreeStoreNode *m_parent; | |
945 | wxString m_text; | |
946 | wxIcon m_icon; | |
947 | wxClientData *m_data; | |
948 | }; | |
949 | ||
950 | WX_DECLARE_LIST_WITH_DECL(wxDataViewTreeStoreNode, wxDataViewTreeStoreNodeList, | |
951 | class WXDLLIMPEXP_ADV); | |
952 | ||
953 | class WXDLLIMPEXP_ADV wxDataViewTreeStoreContainerNode: public wxDataViewTreeStoreNode | |
954 | { | |
955 | public: | |
b5ec7dd6 VZ |
956 | wxDataViewTreeStoreContainerNode( wxDataViewTreeStoreNode *parent, |
957 | const wxString &text, const wxIcon &icon = wxNullIcon, const wxIcon &expanded = wxNullIcon, | |
e94d0c1e RR |
958 | wxClientData *data = NULL ); |
959 | virtual ~wxDataViewTreeStoreContainerNode(); | |
960 | ||
b5ec7dd6 | 961 | const wxDataViewTreeStoreNodeList &GetChildren() const |
e94d0c1e | 962 | { return m_children; } |
b5ec7dd6 | 963 | wxDataViewTreeStoreNodeList &GetChildren() |
e94d0c1e RR |
964 | { return m_children; } |
965 | ||
966 | void SetExpandedIcon( const wxIcon &icon ) | |
967 | { m_iconExpanded = icon; } | |
968 | const wxIcon &GetExpandedIcon() const | |
969 | { return m_iconExpanded; } | |
b5ec7dd6 | 970 | |
a75124d0 RR |
971 | void SetExpanded( bool expanded = true ) |
972 | { m_isExpanded = expanded; } | |
973 | bool IsExpanded() const | |
974 | { return m_isExpanded; } | |
975 | ||
e94d0c1e RR |
976 | virtual bool IsContainer() |
977 | { return true; } | |
b5ec7dd6 | 978 | |
e94d0c1e RR |
979 | private: |
980 | wxDataViewTreeStoreNodeList m_children; | |
981 | wxIcon m_iconExpanded; | |
a75124d0 | 982 | bool m_isExpanded; |
e94d0c1e RR |
983 | }; |
984 | ||
985 | //----------------------------------------------------------------------------- | |
986 | ||
987 | class WXDLLIMPEXP_ADV wxDataViewTreeStore: public wxDataViewModel | |
988 | { | |
989 | public: | |
990 | wxDataViewTreeStore(); | |
991 | ~wxDataViewTreeStore(); | |
992 | ||
b5ec7dd6 | 993 | wxDataViewItem AppendItem( const wxDataViewItem& parent, |
e94d0c1e RR |
994 | const wxString &text, const wxIcon &icon = wxNullIcon, wxClientData *data = NULL ); |
995 | wxDataViewItem PrependItem( const wxDataViewItem& parent, | |
996 | const wxString &text, const wxIcon &icon = wxNullIcon, wxClientData *data = NULL ); | |
997 | wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous, | |
998 | const wxString &text, const wxIcon &icon = wxNullIcon, wxClientData *data = NULL ); | |
b5ec7dd6 VZ |
999 | |
1000 | wxDataViewItem PrependContainer( const wxDataViewItem& parent, | |
1001 | const wxString &text, const wxIcon &icon = wxNullIcon, const wxIcon &expanded = wxNullIcon, | |
e94d0c1e RR |
1002 | wxClientData *data = NULL ); |
1003 | wxDataViewItem AppendContainer( const wxDataViewItem& parent, | |
b5ec7dd6 | 1004 | const wxString &text, const wxIcon &icon = wxNullIcon, const wxIcon &expanded = wxNullIcon, |
e94d0c1e RR |
1005 | wxClientData *data = NULL ); |
1006 | wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous, | |
b5ec7dd6 | 1007 | const wxString &text, const wxIcon &icon = wxNullIcon, const wxIcon &expanded = wxNullIcon, |
e94d0c1e RR |
1008 | wxClientData *data = NULL ); |
1009 | ||
1010 | wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const; | |
1011 | int GetChildCount( const wxDataViewItem& parent ) const; | |
b5ec7dd6 | 1012 | |
e94d0c1e RR |
1013 | void SetItemText( const wxDataViewItem& item, const wxString &text ); |
1014 | wxString GetItemText( const wxDataViewItem& item ) const; | |
b5ec7dd6 | 1015 | void SetItemIcon( const wxDataViewItem& item, const wxIcon &icon ); |
e94d0c1e RR |
1016 | const wxIcon &GetItemIcon( const wxDataViewItem& item ) const; |
1017 | void SetItemExpandedIcon( const wxDataViewItem& item, const wxIcon &icon ); | |
1018 | const wxIcon &GetItemExpandedIcon( const wxDataViewItem& item ) const; | |
1019 | void SetItemData( const wxDataViewItem& item, wxClientData *data ); | |
1020 | wxClientData *GetItemData( const wxDataViewItem& item ) const; | |
1021 | ||
1022 | void DeleteItem( const wxDataViewItem& item ); | |
1023 | void DeleteChildren( const wxDataViewItem& item ); | |
1024 | void DeleteAllItems(); | |
b5ec7dd6 | 1025 | |
e94d0c1e RR |
1026 | // implement base methods |
1027 | ||
b5ec7dd6 | 1028 | virtual void GetValue( wxVariant &variant, |
e94d0c1e | 1029 | const wxDataViewItem &item, unsigned int col ) const; |
b5ec7dd6 | 1030 | virtual bool SetValue( const wxVariant &variant, |
e94d0c1e RR |
1031 | const wxDataViewItem &item, unsigned int col ); |
1032 | virtual wxDataViewItem GetParent( const wxDataViewItem &item ) const; | |
1033 | virtual bool IsContainer( const wxDataViewItem &item ) const; | |
1034 | virtual unsigned int GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const; | |
1035 | ||
b5ec7dd6 | 1036 | virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2, |
e94d0c1e | 1037 | unsigned int column, bool ascending ); |
b5ec7dd6 VZ |
1038 | |
1039 | virtual bool HasDefaultCompare() const | |
e94d0c1e | 1040 | { return true; } |
b5ec7dd6 | 1041 | virtual unsigned int GetColumnCount() const |
e94d0c1e | 1042 | { return 1; }; |
b5ec7dd6 | 1043 | virtual wxString GetColumnType( unsigned int WXUNUSED(col) ) const |
594d5596 | 1044 | { return wxT("wxDataViewIconText"); } |
b5ec7dd6 | 1045 | |
e94d0c1e RR |
1046 | wxDataViewTreeStoreNode *FindNode( const wxDataViewItem &item ) const; |
1047 | wxDataViewTreeStoreContainerNode *FindContainerNode( const wxDataViewItem &item ) const; | |
1048 | wxDataViewTreeStoreNode *GetRoot() const { return m_root; } | |
b5ec7dd6 | 1049 | |
e94d0c1e RR |
1050 | public: |
1051 | wxDataViewTreeStoreNode *m_root; | |
1052 | }; | |
1053 | ||
e94d0c1e RR |
1054 | class WXDLLIMPEXP_ADV wxDataViewTreeCtrl: public wxDataViewCtrl |
1055 | { | |
1056 | public: | |
a75124d0 RR |
1057 | wxDataViewTreeCtrl(); |
1058 | wxDataViewTreeCtrl( wxWindow *parent, wxWindowID id, | |
e94d0c1e | 1059 | const wxPoint& pos = wxDefaultPosition, |
1a07a730 | 1060 | const wxSize& size = wxDefaultSize, long style = wxDV_NO_HEADER | wxDV_ROW_LINES, |
e94d0c1e | 1061 | const wxValidator& validator = wxDefaultValidator ); |
a75124d0 | 1062 | ~wxDataViewTreeCtrl(); |
e94d0c1e RR |
1063 | |
1064 | bool Create( wxWindow *parent, wxWindowID id, | |
1065 | const wxPoint& pos = wxDefaultPosition, | |
1a07a730 | 1066 | const wxSize& size = wxDefaultSize, long style = wxDV_NO_HEADER | wxDV_ROW_LINES, |
e94d0c1e RR |
1067 | const wxValidator& validator = wxDefaultValidator ); |
1068 | ||
1069 | wxDataViewTreeStore *GetStore() | |
1070 | { return (wxDataViewTreeStore*) GetModel(); } | |
a75124d0 RR |
1071 | const wxDataViewTreeStore *GetStore() const |
1072 | { return (const wxDataViewTreeStore*) GetModel(); } | |
b5ec7dd6 | 1073 | |
a75124d0 RR |
1074 | void SetImageList( wxImageList *imagelist ); |
1075 | wxImageList* GetImageList() { return m_imageList; } | |
c058cafa | 1076 | |
a75124d0 RR |
1077 | wxDataViewItem AppendItem( const wxDataViewItem& parent, |
1078 | const wxString &text, int icon = -1, wxClientData *data = NULL ); | |
1079 | wxDataViewItem PrependItem( const wxDataViewItem& parent, | |
1080 | const wxString &text, int icon = -1, wxClientData *data = NULL ); | |
1081 | wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous, | |
1082 | const wxString &text, int icon = -1, wxClientData *data = NULL ); | |
1083 | ||
1084 | wxDataViewItem PrependContainer( const wxDataViewItem& parent, | |
1085 | const wxString &text, int icon = -1, int expanded = -1, | |
1086 | wxClientData *data = NULL ); | |
1087 | wxDataViewItem AppendContainer( const wxDataViewItem& parent, | |
1088 | const wxString &text, int icon = -1, int expanded = -1, | |
1089 | wxClientData *data = NULL ); | |
1090 | wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous, | |
1091 | const wxString &text, int icon = -1, int expanded = -1, | |
1092 | wxClientData *data = NULL ); | |
1093 | ||
1094 | wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const | |
1095 | { return GetStore()->GetNthChild(parent, pos); } | |
1096 | int GetChildCount( const wxDataViewItem& parent ) const | |
1097 | { return GetStore()->GetChildCount(parent); } | |
1098 | ||
1099 | void SetItemText( const wxDataViewItem& item, const wxString &text ) | |
1100 | { GetStore()->SetItemText(item,text); } | |
1101 | wxString GetItemText( const wxDataViewItem& item ) const | |
1102 | { return GetStore()->GetItemText(item); } | |
1103 | void SetItemIcon( const wxDataViewItem& item, const wxIcon &icon ) | |
1104 | { GetStore()->SetItemIcon(item,icon); } | |
1105 | const wxIcon &GetItemIcon( const wxDataViewItem& item ) const | |
1106 | { return GetStore()->GetItemIcon(item); } | |
1107 | void SetItemExpandedIcon( const wxDataViewItem& item, const wxIcon &icon ) | |
1108 | { GetStore()->SetItemExpandedIcon(item,icon); } | |
1109 | const wxIcon &GetItemExpandedIcon( const wxDataViewItem& item ) const | |
1110 | { return GetStore()->GetItemExpandedIcon(item); } | |
1111 | void SetItemData( const wxDataViewItem& item, wxClientData *data ) | |
1112 | { GetStore()->SetItemData(item,data); } | |
1113 | wxClientData *GetItemData( const wxDataViewItem& item ) const | |
1114 | { return GetStore()->GetItemData(item); } | |
1115 | ||
1116 | void DeleteItem( const wxDataViewItem& item ) | |
1117 | { GetStore()->DeleteItem(item); } | |
1118 | void DeleteChildren( const wxDataViewItem& item ) | |
1119 | { GetStore()->DeleteChildren(item); } | |
1120 | void DeleteAllItems() | |
1121 | { GetStore()->DeleteAllItems(); } | |
1122 | ||
1123 | void OnExpanded( wxDataViewEvent &event ); | |
1124 | void OnCollapsed( wxDataViewEvent &event ); | |
1a07a730 | 1125 | void OnSize( wxSizeEvent &event ); |
b5ec7dd6 | 1126 | |
e94d0c1e | 1127 | private: |
a75124d0 RR |
1128 | wxImageList *m_imageList; |
1129 | ||
1130 | private: | |
1131 | DECLARE_EVENT_TABLE() | |
e94d0c1e RR |
1132 | DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewTreeCtrl) |
1133 | }; | |
e94d0c1e | 1134 | |
bcd846ea RR |
1135 | #endif // wxUSE_DATAVIEWCTRL |
1136 | ||
1137 | #endif | |
1138 | // _WX_DATAVIEW_H_BASE_ |