]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/dataviewindexlistmodel.tex
fix LaTeX error (escape underscores); don't abuse bold face
[wxWidgets.git] / docs / latex / wx / dataviewindexlistmodel.tex
CommitLineData
1ab4aff2
RR
1
2\section{\class{wxDataViewIndexListModel}}\label{wxdataviewindexlistmodel}
3
4wxDataViewIndexListModel is a specialized data model which lets
5you address an item by its position (row) rather than its
6wxDataViewItem (which you can obtain from this class).
7This model also provides its own
8\helpref{Compare}{wxdataviewindexlistmodelcompare} method
9which sorts the model's data by the index.
10
5c04afea
RR
11This model is special in the it is implemented differently under OS X
12and other platforms. Under OS X a wxDataViewItem is always persistent
13and this is also the case for this class. Under other platforms, the
14meaning of a wxDataViewItem is changed to reflect a row number for
15wxDataViewIndexListModel. The consequence of this is that
16wxDataViewIndexListModel can be used as a virtual model with an
17almost infinate number of items on platforms other than OS X.
1ab4aff2
RR
18
19\wxheading{Derived from}
20
21\helpref{wxDataViewModel}{wxdataviewmodel}
22
23\wxheading{Include files}
24
25<dataview.h>
26
27\latexignore{\rtfignore{\wxheading{Members}}}
28
29
30\membersection{wxDataViewIndexListModel::wxDataViewIndexListModel}\label{wxdataviewindexlistmodelwxdataviewindexlistmodel}
31
32\func{}{wxDataViewIndexListModel}{\param{unsigned int }{initial\_size = 0}}
33
34Constructor.
35
36\membersection{wxDataViewIndexListModel::\destruct{wxDataViewIndexListModel}}\label{wxdataviewindexlistmodeldtor}
37
38\func{}{\destruct{wxDataViewIndexListModel}}{\void}
39
40Destructor.
41
42\membersection{wxDataViewIndexListModel::Compare}\label{wxdataviewindexlistmodelcompare}
43
44\func{int}{Compare}{\param{const wxDataViewItem\& }{item1}, \param{const wxDataViewItem\& }{item2}, \param{unsigned int }{column}, \param{bool }{ascending}}
45
46Compare method that sorts the items by their index.
47
f4647740
RR
48\membersection{wxDataViewIndexListModel::GetAttr}\label{wxdataviewindexlistmodelgetattr}
49
50\func{bool}{GetAttr}{\param{unsigned int }{row}, \param{unsigned int }{col}, \param{wxDataViewItemAttr\& }{attr}}
51
52Oberride this to indicate that the row has special font attributes.
53This only affects the
54\helpref{wxDataViewTextRendererText}{wxdataviewtextrendererattr} renderer.
55
56See also \helpref{wxDataViewItemAttr}{wxdataviewitemattr}.
57
1ab4aff2
RR
58\membersection{wxDataViewIndexListModel::GetItem}\label{wxdataviewindexlistmodelgetitem}
59
60\constfunc{wxDataViewItem}{GetItem}{\param{unsigned int }{row}}
61
62Returns the wxDataViewItem at the given {\it row}.
63
64\membersection{wxDataViewIndexListModel::GetRow}\label{wxdataviewindexlistmodelgetrow}
65
66\constfunc{unsigned int}{GetRow}{\param{const wxDataViewItem\& }{item}}
67
68Returns the position of given {\it item}.
69
1ab4aff2
RR
70\membersection{wxDataViewIndexListModel::GetValue}\label{wxdataviewindexlistmodelgetvalue}
71
72\constfunc{void}{GetValue}{\param{wxVariant\& }{variant}, \param{unsigned int }{row}, \param{unsigned int }{col}}
73
74Override this to allow getting values from the model.
75
33ba5a05
RR
76
77\membersection{wxDataViewIndexListModel::Reset}\label{wxdataviewindexlistmodelreset}
78
79\func{void}{Reset}{\param{unsigned int }{new\_size}}
80
81Call this after if the data has to be read again from
82the model. This is useful after major changes when
83calling the methods below (possibly thousands of times)
84doesn't make sense.
85
1ab4aff2
RR
86\membersection{wxDataViewIndexListModel::RowAppended}\label{wxdataviewindexlistmodelrowappended}
87
88\func{void}{RowAppended}{\void}
89
90Call this after a row has been appended to the model.
91
92\membersection{wxDataViewIndexListModel::RowChanged}\label{wxdataviewindexlistmodelrowchanged}
93
94\func{void}{RowChanged}{\param{unsigned int }{row}}
95
96Call this after a row has been changed.
97
98\membersection{wxDataViewIndexListModel::RowDeleted}\label{wxdataviewindexlistmodelrowdeleted}
99
100\func{void}{RowDeleted}{\param{unsigned int }{row}}
101
102Call this after a row has been deleted.
103
8b6cf9bf
RR
104\membersection{wxDataViewIndexListModel::RowsDeleted}\label{wxdataviewindexlistmodelrowdeleted}
105
106\func{void}{RowsDeleted}{\param{const wxArrayInt &}{rows}}
107
108Call this after rows have been deleted. The array will internally
109get copied and sorted in descending order so that the rows with
110the highest position will be deleted first.
111
1ab4aff2
RR
112\membersection{wxDataViewIndexListModel::RowInserted}\label{wxdataviewindexlistmodelrowinserted}
113
114\func{void}{RowInserted}{\param{unsigned int }{before}}
115
116Call this after a row has been inserted at the given position.
117
118\membersection{wxDataViewIndexListModel::RowPrepended}\label{wxdataviewindexlistmodelrowprepended}
119
120\func{void}{RowPrepended}{\void}
121
122Call this after a row has been prepended to the model.
123
124\membersection{wxDataViewIndexListModel::RowValueChanged}\label{wxdataviewindexlistmodelrowvaluechanged}
125
126\func{void}{RowValueChanged}{\param{unsigned int }{row}, \param{unsigned int }{col}}
127
128Call this after a value has been changed.
129
130\membersection{wxDataViewIndexListModel::SetValue}\label{wxdataviewindexlistmodelsetvalue}
131
132\func{bool}{SetValue}{\param{const wxVariant\& }{variant}, \param{unsigned int }{row}, \param{unsigned int }{col}}
133
8cb475f1 134Called in order to set a value in the model.