wxWidgets: wxDataViewListModel Class Reference

| Version: 3.1.7

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxDataViewListModel Class Referenceabstract
Class List by Category » wxDataViewCtrl Related Classes

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.7-1.x86_64/src/wxWidgets-3.1.7/interface/wx/dataview.h>`

Inheritance diagram for wxDataViewListModel:
[legend]

## Detailed Description

Base class with abstract API for wxDataViewIndexListModel and wxDataViewVirtualListModel.

##

Library: wxCore
Category: wxDataViewCtrl Related Classes

## Public Member Functions
virtual | ~wxDataViewListModel ()
| 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 =0
| Returns the number of items (or rows) in the list.
unsigned int | GetRow (const wxDataViewItem &item) const =0
| 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.
virtual bool | SetValueByRow (const wxVariant &variant, unsigned int row, unsigned int col)=0
| Called in order to set a value in the model.
Public Member Functions inherited from wxDataViewModel
| wxDataViewModel ()
| Constructor.
void | AddNotifier (wxDataViewModelNotifier *notifier)
| Adds a wxDataViewModelNotifier to the model.
bool | ChangeValue (const wxVariant &variant, const wxDataViewItem &item, unsigned int col)
| Change the value of the given item and update the control to reflect it.
bool | Cleared ()
| Called to inform the model that all of its data has been changed.
virtual bool | GetAttr (const wxDataViewItem &item, unsigned int col, wxDataViewItemAttr &attr) const
| Override this to indicate that the item has special font attributes.
virtual bool | IsEnabled (const wxDataViewItem &item, unsigned int col) const
| Override this to indicate that the item should be disabled.
virtual unsigned int | GetChildren (const wxDataViewItem &item, wxDataViewItemArray &children) const =0
| Override this so the control can query the child items of an item.
virtual unsigned int | GetColumnCount () const =0
| Override this to indicate the number of columns in the model.
virtual wxString | GetColumnType (unsigned int col) const =0
| Override this to indicate what type of data is stored in the column specified by col.
virtual wxDataViewItem | GetParent (const wxDataViewItem &item) const =0
| Override this to indicate which wxDataViewItem representing the parent of item or an invalid wxDataViewItem if the root item is the parent item.
virtual void | GetValue (wxVariant &variant, const wxDataViewItem &item, unsigned int col) const =0
| Override this to indicate the value of item.
virtual bool | HasContainerColumns (const wxDataViewItem &item) const
| Override this method to indicate if a container item merely acts as a headline (or for categorisation) or if it also acts a normal item with entries for further columns.
virtual bool | HasDefaultCompare () const
| Override this to indicate that the model provides a default compare function that the control should use if no wxDataViewColumn has been chosen for sorting.
virtual bool | HasValue (const wxDataViewItem &item, unsigned col) const
| Return true if there is a value in the given column of this item.
virtual bool | IsContainer (const wxDataViewItem &item) const =0
| Override this to indicate if item is a container, i.e. if it can have child items.
bool | ItemAdded (const wxDataViewItem &parent, const wxDataViewItem &item)
| Call this to inform the model that an item has been added to the data.
bool | ItemChanged (const wxDataViewItem &item)
| Call this to inform the model that an item has changed.
bool | ItemDeleted (const wxDataViewItem &parent, const wxDataViewItem &item)
| Call this to inform the model that an item has been deleted from the data.
bool | ItemsAdded (const wxDataViewItem &parent, const wxDataViewItemArray &items)
| Call this to inform the model that several items have been added to the data.
bool | ItemsChanged (const wxDataViewItemArray &items)
| Call this to inform the model that several items have changed.
bool | ItemsDeleted (const wxDataViewItem &parent, const wxDataViewItemArray &items)
| Call this to inform the model that several items have been deleted.
void | RemoveNotifier (wxDataViewModelNotifier *notifier)
| Remove the notifier from the list of notifiers.
virtual void | Resort ()
| Call this to initiate a resort after the sort function has been changed.
virtual bool | SetValue (const wxVariant &variant, const wxDataViewItem &item, unsigned int col)=0
| This gets called in order to set a value in the data model.
bool | ValueChanged (const wxDataViewItem &item, unsigned int col)
| Call this to inform this model that a value in the model has been changed.
virtual bool | IsListModel () const
virtual bool | IsVirtualListModel () const
Public Member Functions inherited from wxRefCounter
| wxRefCounter ()
| Default constructor.
void | DecRef ()
| Decrements the reference count associated with this shared data and, if it reaches zero, destroys this instance of wxRefCounter releasing its memory.
int | GetRefCount () const
| Returns the reference count associated with this shared data.
void | IncRef ()
| Increments the reference count associated with this shared data.

## Additional Inherited Members
Protected Member Functions inherited from wxDataViewModel
virtual | ~wxDataViewModel ()
| Destructor.
virtual int | DoCompareValues (const wxVariant &value1, const wxVariant &value2) const
| Virtual method that can be overridden to define comparison for values of non-standard types.
Protected Member Functions inherited from wxRefCounter
virtual | ~wxRefCounter ()
| Destructor.

## Constructor & Destructor Documentation

## ◆ ~wxDataViewListModel()

virtual wxDataViewListModel::~wxDataViewListModel | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ Compare()

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.

## ◆ GetAttrByRow()

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.

See also
  wxDataViewItemAttr.

Parameters

  row | The row for which the attribute is requested.
  col | The column for which the attribute is requested.
  attr | The attribute to be filled in if the function returns true.

Returns
  true if this item has an attribute or false otherwise.

## ◆ GetCount()

unsigned int wxDataViewListModel::GetCount | ( |  | ) | const
| pure virtual

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

## ◆ GetRow()

unsigned int wxDataViewListModel::GetRow | ( | const wxDataViewItem & | item | ) | const
| pure virtual

Returns the position of given item.

## ◆ GetValueByRow()

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.

## ◆ IsEnabledByRow()

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

  row | The row of the item whose enabled status is requested.
  col | The column of the item whose enabled status is requested.

Returns
  true if the item at this row and column should be enabled, false otherwise.

Note
  See wxDataViewModel::IsEnabled() for the current status of support for disabling the items under different platforms.

Since
  2.9.2

## ◆ SetValueByRow()

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.