Merge branch 'dvc-misc'

Several bug fixes to (mostly generic, but not only) wxDataViewCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/715
This commit is contained in:
Vadim Zeitlin
2018-02-04 15:11:48 +01:00
13 changed files with 254 additions and 119 deletions

View File

@@ -27,6 +27,7 @@
#include "wx/dataobj.h"
#include "wx/withimages.h"
#include "wx/systhemectrl.h"
#include "wx/vector.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
class wxItemAttr;
@@ -179,8 +180,7 @@ private:
// wxDataViewModel
// ---------------------------------------------------------
WX_DECLARE_LIST_WITH_DECL(wxDataViewModelNotifier, wxDataViewModelNotifiers,
class WXDLLIMPEXP_ADV);
typedef wxVector<wxDataViewModelNotifier*> wxDataViewModelNotifiers;
class WXDLLIMPEXP_ADV wxDataViewModel: public wxRefCounter
{
@@ -273,8 +273,9 @@ public:
virtual bool IsVirtualListModel() const { return false; }
protected:
// the user should not delete this class directly: he should use DecRef() instead!
virtual ~wxDataViewModel() { }
// Dtor is protected because the objects of this class must not be deleted,
// DecRef() must be used instead.
virtual ~wxDataViewModel();
// Helper function used by the default Compare() implementation to compare
// values of types it is not aware about. Can be overridden in the derived
@@ -285,7 +286,7 @@ protected:
return 0;
}
private:
wxDataViewModelNotifiers m_notifiers;
};
@@ -1211,8 +1212,7 @@ private:
wxClientData *m_data;
};
WX_DECLARE_LIST_WITH_DECL(wxDataViewTreeStoreNode, wxDataViewTreeStoreNodeList,
class WXDLLIMPEXP_ADV);
typedef wxVector<wxDataViewTreeStoreNode*> wxDataViewTreeStoreNodes;
class WXDLLIMPEXP_ADV wxDataViewTreeStoreContainerNode: public wxDataViewTreeStoreNode
{
@@ -1222,11 +1222,13 @@ public:
wxClientData *data = NULL );
virtual ~wxDataViewTreeStoreContainerNode();
const wxDataViewTreeStoreNodeList &GetChildren() const
const wxDataViewTreeStoreNodes &GetChildren() const
{ return m_children; }
wxDataViewTreeStoreNodeList &GetChildren()
wxDataViewTreeStoreNodes &GetChildren()
{ return m_children; }
wxDataViewTreeStoreNodes::iterator FindChild(wxDataViewTreeStoreNode* node);
void SetExpandedIcon( const wxIcon &icon )
{ m_iconExpanded = icon; }
const wxIcon &GetExpandedIcon() const
@@ -1240,8 +1242,10 @@ public:
virtual bool IsContainer() wxOVERRIDE
{ return true; }
void DestroyChildren();
private:
wxDataViewTreeStoreNodeList m_children;
wxDataViewTreeStoreNodes m_children;
wxIcon m_iconExpanded;
bool m_isExpanded;
};

View File

@@ -257,10 +257,10 @@ public:
#if wxUSE_ACCESSIBILITY
virtual bool Show(bool show = true) wxOVERRIDE;
virtual bool Enable(bool enable = true) wxOVERRIDE;
virtual void SetName(const wxString &name) wxOVERRIDE;
virtual bool Reparent(wxWindowBase *newParent) wxOVERRIDE;
#endif // wxUSE_ACCESSIBILITY
virtual bool Enable(bool enable = true) wxOVERRIDE;
virtual bool AllowMultiColumnSort(bool allow) wxOVERRIDE;
virtual bool IsMultiColumnSortAllowed() const wxOVERRIDE { return m_allowMultiColumnSort; }

View File

@@ -37,6 +37,9 @@ enum
// right clicking the header
wxHD_ALLOW_HIDE = 0x0002,
// force putting column images on right
wxHD_BITMAP_ON_RIGHT = 0x0004,
// style used by default when creating the control
wxHD_DEFAULT_STYLE = wxHD_ALLOW_REORDER
};