]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/dataview.h
e1e1fab2cc6a1d565570bf67a1701cbfce68e305
[wxWidgets.git] / include / wx / gtk / dataview.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/dataview.h
3 // Purpose: wxDataViewCtrl GTK+2 implementation header
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef __GTKDATAVIEWCTRLH__
11 #define __GTKDATAVIEWCTRLH__
12
13 #include "wx/defs.h"
14 #include "wx/object.h"
15 #include "wx/list.h"
16 #include "wx/control.h"
17
18 // ---------------------------------------------------------
19 // classes
20 // ---------------------------------------------------------
21
22 class WXDLLIMPEXP_CORE wxDataViewCtrl;
23
24 // ---------------------------------------------------------
25 // wxDataViewCell
26 // ---------------------------------------------------------
27
28 class wxDataViewCell: public wxDataViewCellBase
29 {
30 public:
31 wxDataViewCell( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
32
33 // implementation
34 void* GetGtkHandle() { return m_renderer; }
35
36 protected:
37 // holds the GTK handle
38 void* m_renderer;
39
40 protected:
41 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCell)
42 };
43
44 // ---------------------------------------------------------
45 // wxDataViewTextCell
46 // ---------------------------------------------------------
47
48 class wxDataViewTextCell: public wxDataViewCell
49 {
50 public:
51 wxDataViewTextCell( const wxString &varianttype = wxT("string"),
52 wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
53
54 bool SetValue( const wxVariant &value );
55 bool GetValue( wxVariant &value );
56
57 protected:
58 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextCell)
59 };
60
61 // ---------------------------------------------------------
62 // wxDataViewColumn
63 // ---------------------------------------------------------
64
65 class WXDLLIMPEXP_CORE wxDataViewColumn: public wxDataViewColumnBase
66 {
67 public:
68 wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column, int flags = 0 );
69 virtual ~wxDataViewColumn();
70
71 virtual void SetTitle( const wxString &title );
72
73 // implementation
74 void* GetGtkHandle() { return m_column; }
75
76 private:
77 // holds the GTK handle
78 void* m_column;
79
80 protected:
81 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumn)
82 };
83
84 // ---------------------------------------------------------
85 // wxDataViewCtrl
86 // ---------------------------------------------------------
87
88 class WXDLLIMPEXP_CORE wxDataViewCtrl: public wxDataViewCtrlBase
89 {
90 public:
91 wxDataViewCtrl()
92 {
93 Init();
94 }
95
96 wxDataViewCtrl( wxWindow *parent, wxWindowID id,
97 const wxPoint& pos = wxDefaultPosition,
98 const wxSize& size = wxDefaultSize, long style = 0,
99 const wxValidator& validator = wxDefaultValidator )
100 {
101 Create(parent, id, pos, size, style, validator );
102 }
103
104 virtual ~wxDataViewCtrl();
105
106 void Init();
107
108 bool Create(wxWindow *parent, wxWindowID id,
109 const wxPoint& pos = wxDefaultPosition,
110 const wxSize& size = wxDefaultSize, long style = 0,
111 const wxValidator& validator = wxDefaultValidator );
112
113 virtual bool AssociateModel( wxDataViewListModel *model );
114 virtual bool AppendColumn( wxDataViewColumn *col );
115
116 private:
117 DECLARE_DYNAMIC_CLASS(wxDataViewCtrl)
118 DECLARE_NO_COPY_CLASS(wxDataViewCtrl)
119 };
120
121
122 #endif // __GTKDATAVIEWCTRLH__