virtual bool GetAttr(const wxDataViewItem& item, unsigned int col,
wxDataViewItemAttr& attr) const;
+ /**
+ Override this to indicate that the item should be disabled.
+
+ Disabled items are displayed differently (e.g. grayed out) and cannot
+ be interacted with.
+
+ The base class version always returns @true, thus making all items
+ enabled by default.
+
+ @param item
+ The item whose enabled status is requested.
+ @param col
+ The column of the item whose enabled status is requested.
+ @return
+ @true if this item should be enabled, @false otherwise.
+
+ @note Currently disabling items is fully implemented only for the
+ native control implementation in wxOSX/Cocoa and wxGTK.
+ This feature is only partially supported in the generic
+ version (used by wxMSW) and not supported by the wxOSX/Carbon
+ implementation.
+
+ @since 2.9.2
+ */
+ virtual bool IsEnabled(const wxDataViewItem &item,
+ unsigned int col) const;
+
/**
Override this so the control can query the child items of an item.
Returns the number of items.
/**
Call this to inform the model that an item has changed.
- This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
+ This will eventually emit a @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
event (in which the column fields will not be set) to the user.
*/
bool ItemChanged(const wxDataViewItem& item);
/**
Call this to inform the model that several items have changed.
- This will eventually emit wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
+ This will eventually emit @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
events (in which the column fields will not be set) to the user.
*/
bool ItemsChanged(const wxDataViewItemArray& items);
This is also called from wxDataViewCtrl's internal editing code, e.g. when
editing a text field in the control.
- This will eventually emit a wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
+ This will eventually emit a @c wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
event to the user.
*/
virtual bool ValueChanged(const wxDataViewItem& item,
/**
- @class wxDataViewIndexListModel
-
- wxDataViewIndexListModel is a specialized data model which lets you address
- an item by its position (row) rather than its wxDataViewItem (which you can
- obtain from this class).
- This model also provides its own wxDataViewIndexListModel::Compare
- method which sorts the model's data by the index.
+ @class wxDataViewListModel
- This model is not a virtual model since the control stores each wxDataViewItem.
- Use wxDataViewVirtualListModel if you need to display millions of items or
- have other reason to use a virtual control.
+ Base class with abstract API for wxDataViewIndexListModel and
+ wxDataViewVirtualListModel.
@library{wxadv}
@category{dvc}
*/
-class wxDataViewIndexListModel : public wxDataViewModel
+class wxDataViewListModel : public wxDataViewModel
{
public:
- /**
- Constructor.
- */
- wxDataViewIndexListModel(unsigned int initial_size = 0);
/**
Destructor.
virtual bool GetAttrByRow(unsigned int row, unsigned int col,
wxDataViewItemAttr& attr) const;
+ /**
+ Override this if you want to disable specific items.
+
+ The base class version always returns @true, thus making all items
+ enabled by default.
+
+ @param row
+ The row of the item whose enabled status is requested.
+ @param col
+ The column of the item whose enabled status is requested.
+ @return
+ @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
+ */
+ virtual bool IsEnabledByRow(unsigned int row,
+ unsigned int col) const;
+
/**
Returns the number of items (i.e. rows) in the list.
*/
};
+/**
+ @class wxDataViewIndexListModel
+
+ wxDataViewIndexListModel is a specialized data model which lets you address
+ an item by its position (row) rather than its wxDataViewItem (which you can
+ obtain from this class).
+ This model also provides its own wxDataViewIndexListModel::Compare
+ method which sorts the model's data by the index.
+
+ This model is not a virtual model since the control stores each wxDataViewItem.
+ Use wxDataViewVirtualListModel if you need to display millions of items or
+ have other reason to use a virtual control.
+
+ @see wxDataViewListModel for the API.
+
+ @library{wxadv}
+ @category{dvc}
+*/
+
+class wxDataViewIndexListModel : public wxDataViewListModel
+{
+public:
+ /**
+ Constructor.
+ */
+ wxDataViewIndexListModel(unsigned int initial_size = 0);
+
+};
/**
@class wxDataViewVirtualListModel
the exact same interface as wxDataViewIndexListModel.
The important difference is that under platforms other than OS X, using this
model will result in a truly virtual control able to handle millions of items
- as the control doesn't store any item (a feature not supported by the
- Carbon API under OS X).
+ as the control doesn't store any item (a feature not supported by OS X).
- @see wxDataViewIndexListModel for the API.
+ @see wxDataViewListModel for the API.
@library{wxadv}
@category{dvc}
*/
-class wxDataViewVirtualListModel : public wxDataViewModel
+
+class wxDataViewVirtualListModel : public wxDataViewListModel
{
public:
/**
*/
wxDataViewVirtualListModel(unsigned int initial_size = 0);
- /**
- Returns the number of virtual items (i.e. rows) in the list.
- */
- unsigned int GetCount() const;
};
Multiple selection mode.
@style{wxDV_ROW_LINES}
Use alternating colours for rows if supported by platform and theme.
+ Currently only supported by the native GTK and OS X implementations
+ but not by the generic one.
@style{wxDV_HORIZ_RULES}
Display fine rules between row if supported.
@style{wxDV_VERT_RULES}
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
- const wxValidator& validator = wxDefaultValidator);
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxDataViewCtrlNameStr);
/**
Destructor.
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
- const wxValidator& validator = wxDefaultValidator);
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxDataViewCtrlNameStr);
/**
Deletes given column.
void SetColumn(int col);
/**
- For wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
+ For @c wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only.
*/
void SetDataViewColumn(wxDataViewColumn* col);