Add the possibility to disable invisible wxDataViewCtrl items.
Add new wxDataViewModel::IsEnabled() and wxDataViewListStore::IsEnabledByRow() methods and implement support for actually disabling the items in wxOSX/Cocoa native implementation of wxDataViewCtrl and limited support for it in the generic version. We need to implement this in wxGTK using GtkCellRenderer "sensitive" propriety later. Closes #12686. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -116,6 +116,8 @@ public:
|
||||
|
||||
virtual void SetAttr(const wxDataViewItemAttr& WXUNUSED(attr)) { }
|
||||
|
||||
virtual void SetEnabled(bool WXUNUSED(enabled)) { }
|
||||
|
||||
wxString GetVariantType() const { return m_variantType; }
|
||||
|
||||
// helper that calls SetValue and SetAttr:
|
||||
@@ -261,6 +263,11 @@ public:
|
||||
virtual void SetAttr(const wxDataViewItemAttr& attr) { m_attr = attr; }
|
||||
const wxDataViewItemAttr& GetAttr() const { return m_attr; }
|
||||
|
||||
// Store the enabled state of the item so that it can be accessed from
|
||||
// Render() via GetEnabled() if needed.
|
||||
virtual void SetEnabled(bool enabled) { m_enabled = enabled; }
|
||||
bool GetEnabled() const { return m_enabled; }
|
||||
|
||||
|
||||
// Implementation only from now on
|
||||
|
||||
@@ -277,6 +284,7 @@ protected:
|
||||
|
||||
private:
|
||||
wxDataViewItemAttr m_attr;
|
||||
bool m_enabled;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxDataViewCustomRendererBase);
|
||||
};
|
||||
|
Reference in New Issue
Block a user