2 \section{\class{wxDataViewIndexListModel
}}\label{wxdataviewindexlistmodel
}
4 wxDataViewIndexListModel is a specialized data model which lets
5 you address an item by its position (row) rather than its
6 wxDataViewItem (which you can obtain from this class).
7 This model also provides its own
8 \helpref{Compare
}{wxdataviewindexlistmodelcompare
} method
9 which sorts the model's data by the index.
11 This model is special in the it is implemented differently under OS X
12 and other platforms. Under OS X a wxDataViewItem is always persistent
13 and this is also the case for this class. Under other platforms, the
14 meaning of a wxDataViewItem is changed to reflect a row number for
15 wxDataViewIndexListModel. The consequence of this is that
16 wxDataViewIndexListModel can be used as a virtual model with an
17 almost infinate number of items on platforms other than OS X.
19 \wxheading{Derived from
}
21 \helpref{wxDataViewModel
}{wxdataviewmodel
}
23 \wxheading{Include files
}
27 \latexignore{\rtfignore{\wxheading{Members
}}}
30 \membersection{wxDataViewIndexListModel::wxDataViewIndexListModel
}\label{wxdataviewindexlistmodelwxdataviewindexlistmodel
}
32 \func{}{wxDataViewIndexListModel
}{\param{unsigned int
}{initial
\_size =
0}}
36 \membersection{wxDataViewIndexListModel::
\destruct{wxDataViewIndexListModel
}}\label{wxdataviewindexlistmodeldtor
}
38 \func{}{\destruct{wxDataViewIndexListModel
}}{\void}
42 \membersection{wxDataViewIndexListModel::Compare
}\label{wxdataviewindexlistmodelcompare
}
44 \func{int
}{Compare
}{\param{const wxDataViewItem\&
}{item1
},
\param{const wxDataViewItem\&
}{item2
},
\param{unsigned int
}{column
},
\param{bool
}{ascending
}}
46 Compare method that sorts the items by their index.
48 \membersection{wxDataViewIndexListModel::GetAttr
}\label{wxdataviewindexlistmodelgetattr
}
50 \func{bool
}{GetAttr
}{\param{unsigned int
}{row
},
\param{unsigned int
}{col
},
\param{wxDataViewItemAttr\&
}{attr
}}
52 Oberride this to indicate that the row has special font attributes.
54 \helpref{wxDataViewTextRendererText
}{wxdataviewtextrendererattr
} renderer.
56 See also
\helpref{wxDataViewItemAttr
}{wxdataviewitemattr
}.
58 \membersection{wxDataViewIndexListModel::GetItem
}\label{wxdataviewindexlistmodelgetitem
}
60 \constfunc{wxDataViewItem
}{GetItem
}{\param{unsigned int
}{row
}}
62 Returns the wxDataViewItem at the given
{\it row
}.
64 \membersection{wxDataViewIndexListModel::GetRow
}\label{wxdataviewindexlistmodelgetrow
}
66 \constfunc{unsigned int
}{GetRow
}{\param{const wxDataViewItem\&
}{item
}}
68 Returns the position of given
{\it item
}.
70 \membersection{wxDataViewIndexListModel::GetValue
}\label{wxdataviewindexlistmodelgetvalue
}
72 \constfunc{void
}{GetValue
}{\param{wxVariant\&
}{variant
},
\param{unsigned int
}{row
},
\param{unsigned int
}{col
}}
74 Override this to allow getting values from the model.
77 \membersection{wxDataViewIndexListModel::Reset
}\label{wxdataviewindexlistmodelreset
}
79 \func{void
}{Reset
}{\param{unsigned int
}{new
\_size}}
81 Call this after if the data has to be read again from
82 the model. This is useful after major changes when
83 calling the methods below (possibly thousands of times)
86 \membersection{wxDataViewIndexListModel::RowAppended
}\label{wxdataviewindexlistmodelrowappended
}
88 \func{void
}{RowAppended
}{\void}
90 Call this after a row has been appended to the model.
92 \membersection{wxDataViewIndexListModel::RowChanged
}\label{wxdataviewindexlistmodelrowchanged
}
94 \func{void
}{RowChanged
}{\param{unsigned int
}{row
}}
96 Call this after a row has been changed.
98 \membersection{wxDataViewIndexListModel::RowDeleted
}\label{wxdataviewindexlistmodelrowdeleted
}
100 \func{void
}{RowDeleted
}{\param{unsigned int
}{row
}}
102 Call this after a row has been deleted.
104 \membersection{wxDataViewIndexListModel::RowsDeleted
}\label{wxdataviewindexlistmodelrowdeleted
}
106 \func{void
}{RowsDeleted
}{\param{const wxArrayInt &
}{rows
}}
108 Call this after rows have been deleted. The array will internally
109 get copied and sorted in descending order so that the rows with
110 the highest position will be deleted first.
112 \membersection{wxDataViewIndexListModel::RowInserted
}\label{wxdataviewindexlistmodelrowinserted
}
114 \func{void
}{RowInserted
}{\param{unsigned int
}{before
}}
116 Call this after a row has been inserted at the given position.
118 \membersection{wxDataViewIndexListModel::RowPrepended
}\label{wxdataviewindexlistmodelrowprepended
}
120 \func{void
}{RowPrepended
}{\void}
122 Call this after a row has been prepended to the model.
124 \membersection{wxDataViewIndexListModel::RowValueChanged
}\label{wxdataviewindexlistmodelrowvaluechanged
}
126 \func{void
}{RowValueChanged
}{\param{unsigned int
}{row
},
\param{unsigned int
}{col
}}
128 Call this after a value has been changed.
130 \membersection{wxDataViewIndexListModel::SetValue
}\label{wxdataviewindexlistmodelsetvalue
}
132 \func{bool
}{SetValue
}{\param{const wxVariant\&
}{variant
},
\param{unsigned int
}{row
},
\param{unsigned int
}{col
}}
134 Called in order to set a value in the model.