Version: 2.9.4
Public Member Functions
wxDataViewListModel Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/dataview.h>

Inheritance diagram for wxDataViewListModel:

Detailed Description

Base class with abstract API for wxDataViewIndexListModel and wxDataViewVirtualListModel.

Library:  wxAdvanced
Category:  wxDataViewCtrl Related Classes

Public Member Functions

virtual ~wxDataViewIndexListModel ()
 Destructor.
int Compare (const wxDataViewItem &item1, const wxDataViewItem &item2, unsigned int column, bool ascending) const
 Compare method that sorts the items by their index.
virtual bool GetAttrByRow (unsigned int row, unsigned int col, wxDataViewItemAttr &attr) const
 Override this to indicate that the row has special font attributes.
virtual bool IsEnabledByRow (unsigned int row, unsigned int col) const
 Override this if you want to disable specific items.
unsigned int GetCount () const
 Returns the number of items (or rows) in the list.
wxDataViewItem GetItem (unsigned int row) const
 Returns the wxDataViewItem at the given row.
unsigned int GetRow (const wxDataViewItem &item) const
 Returns the position of given item.
virtual void GetValueByRow (wxVariant &variant, unsigned int row, unsigned int col) const =0
 Override this to allow getting values from the model.
void Reset (unsigned int new_size)
 Call this after if the data has to be read again from the model.
void RowAppended ()
 Call this after a row has been appended to the model.
void RowChanged (unsigned int row)
 Call this after a row has been changed.
void RowDeleted (unsigned int row)
 Call this after a row has been deleted.
void RowInserted (unsigned int before)
 Call this after a row has been inserted at the given position.
void RowPrepended ()
 Call this after a row has been prepended to the model.
void RowValueChanged (unsigned int row, unsigned int col)
 Call this after a value has been changed.
void RowsDeleted (const wxArrayInt &rows)
 Call this after rows have been deleted.
virtual bool SetValueByRow (const wxVariant &variant, unsigned int row, unsigned int col)=0
 Called in order to set a value in the model.

List of all members.


Constructor & Destructor Documentation

virtual wxDataViewListModel::~wxDataViewIndexListModel ( ) [virtual]

Destructor.


Member Function Documentation

int wxDataViewListModel::Compare ( const wxDataViewItem item1,
const wxDataViewItem item2,
unsigned int  column,
bool  ascending 
) const [virtual]

Compare method that sorts the items by their index.

Reimplemented from wxDataViewModel.

virtual bool wxDataViewListModel::GetAttrByRow ( unsigned int  row,
unsigned int  col,
wxDataViewItemAttr attr 
) const [virtual]

Override this to indicate that the row has special font attributes.

This only affects the wxDataViewTextRendererText() renderer.

The base class version always simply returns false.

参照:
wxDataViewItemAttr.
Parameters:
rowThe row for which the attribute is requested.
colThe column for which the attribute is requested.
attrThe attribute to be filled in if the function returns true.
Returns:
true if this item has an attribute or false otherwise.
unsigned int wxDataViewListModel::GetCount ( ) const

Returns the number of items (or rows) in the list.

wxDataViewItem wxDataViewListModel::GetItem ( unsigned int  row) const

Returns the wxDataViewItem at the given row.

unsigned int wxDataViewListModel::GetRow ( const wxDataViewItem item) const

Returns the position of given item.

virtual void wxDataViewListModel::GetValueByRow ( wxVariant variant,
unsigned int  row,
unsigned int  col 
) const [pure virtual]

Override this to allow getting values from the model.

Implemented in wxDataViewListStore.

virtual bool wxDataViewListModel::IsEnabledByRow ( unsigned int  row,
unsigned int  col 
) const [virtual]

Override this if you want to disable specific items.

The base class version always returns true, thus making all items enabled by default.

Parameters:
rowThe row of the item whose enabled status is requested.
colThe column of the item whose enabled status is requested.
Returns:
true if the item at this row and column should be enabled, false otherwise.
注:
See wxDataViewModel::IsEnabled() for the current status of support for disabling the items under different platforms.
Since:
2.9.2
void wxDataViewListModel::Reset ( unsigned int  new_size)

Call this after if the data has to be read again from the model.

This is useful after major changes when calling the methods below (possibly thousands of times) doesn't make sense.

void wxDataViewListModel::RowAppended ( )

Call this after a row has been appended to the model.

void wxDataViewListModel::RowChanged ( unsigned int  row)

Call this after a row has been changed.

void wxDataViewListModel::RowDeleted ( unsigned int  row)

Call this after a row has been deleted.

void wxDataViewListModel::RowInserted ( unsigned int  before)

Call this after a row has been inserted at the given position.

void wxDataViewListModel::RowPrepended ( )

Call this after a row has been prepended to the model.

void wxDataViewListModel::RowsDeleted ( const wxArrayInt rows)

Call this after rows have been deleted.

The array will internally get copied and sorted in descending order so that the rows with the highest position will be deleted first.

void wxDataViewListModel::RowValueChanged ( unsigned int  row,
unsigned int  col 
)

Call this after a value has been changed.

virtual bool wxDataViewListModel::SetValueByRow ( const wxVariant variant,
unsigned int  row,
unsigned int  col 
) [pure virtual]

Called in order to set a value in the model.

Implemented in wxDataViewListStore.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines