Add compare function to wxDataViewModel
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
aba9bfd00a
commit
5732efaa91
@ -83,12 +83,15 @@ private:
|
||||
wxUint32 m_id;
|
||||
};
|
||||
|
||||
bool operator == ( const wxDataViewItem & left, const wxDataViewItem & right );
|
||||
bool operator == ( const wxDataViewItem& left, const wxDataViewItem& right );
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewModel
|
||||
// ---------------------------------------------------------
|
||||
|
||||
typedef int (wxCALLBACK *wxDataViewModelCompare)
|
||||
(const wxDataViewItem& item1, const wxDataViewItem& item2, unsigned int col, unsigned int option );
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewModel: public wxObjectRefData
|
||||
{
|
||||
public:
|
||||
@ -125,11 +128,15 @@ public:
|
||||
void AddNotifier( wxDataViewModelNotifier *notifier );
|
||||
void RemoveNotifier( wxDataViewModelNotifier *notifier );
|
||||
|
||||
void SetCompareFunction( wxDataViewModelCompare func ) { m_cmpFunc = func; }
|
||||
wxDataViewModelCompare GetCompareFunction() { return m_cmpFunc; }
|
||||
|
||||
protected:
|
||||
// the user should not delete this class directly: he should use DecRef() instead!
|
||||
virtual ~wxDataViewModel() { }
|
||||
|
||||
wxList m_notifiers;
|
||||
wxList m_notifiers;
|
||||
wxDataViewModelCompare m_cmpFunc;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
@ -33,6 +33,7 @@ const wxChar wxDataViewCtrlNameStr[] = wxT("dataviewCtrl");
|
||||
wxDataViewModel::wxDataViewModel()
|
||||
{
|
||||
m_notifiers.DeleteContents( true );
|
||||
m_cmpFunc = NULL;
|
||||
}
|
||||
|
||||
bool wxDataViewModel::ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item )
|
||||
|
Loading…
Reference in New Issue
Block a user