]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/dataview.h
1131a7430adef7a084315facd2b25db134dafb8a
[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 protected:
55 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextCell)
56 };
57
58 // ---------------------------------------------------------
59 // wxDataViewColumn
60 // ---------------------------------------------------------
61
62 class WXDLLIMPEXP_CORE wxDataViewColumn: public wxDataViewColumnBase
63 {
64 public:
65 wxDataViewColumn( const wxString &title, wxDataViewCell *cell, size_t model_column, int flags = 0 );
66 virtual ~wxDataViewColumn();
67
68 virtual void SetTitle( const wxString &title );
69
70 // implementation
71 void* GetGtkHandle() { return m_column; }
72
73 private:
74 // holds the GTK handle
75 void* m_column;
76
77 protected:
78 DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumn)
79 };
80
81 // ---------------------------------------------------------
82 // wxDataViewCtrl
83 // ---------------------------------------------------------
84
85 class WXDLLIMPEXP_CORE wxDataViewCtrl: public wxDataViewCtrlBase
86 {
87 public:
88 wxDataViewCtrl()
89 {
90 Init();
91 }
92
93 wxDataViewCtrl( wxWindow *parent, wxWindowID id,
94 const wxPoint& pos = wxDefaultPosition,
95 const wxSize& size = wxDefaultSize, long style = 0,
96 const wxValidator& validator = wxDefaultValidator )
97 {
98 Create(parent, id, pos, size, style, validator );
99 }
100
101 virtual ~wxDataViewCtrl();
102
103 void Init();
104
105 bool Create(wxWindow *parent, wxWindowID id,
106 const wxPoint& pos = wxDefaultPosition,
107 const wxSize& size = wxDefaultSize, long style = 0,
108 const wxValidator& validator = wxDefaultValidator );
109
110 virtual bool AssociateModel( wxDataViewListModel *model );
111 virtual bool AppendColumn( wxDataViewColumn *col );
112
113 private:
114 DECLARE_DYNAMIC_CLASS(wxDataViewCtrl)
115 DECLARE_NO_COPY_CLASS(wxDataViewCtrl)
116 };
117
118
119 #endif // __GTKDATAVIEWCTRLH__