Implement wxDataViewColumn::UnsetAsSortKey() in macOS version

It was impossible to stop sorting the control if it had been sorted
before, so implement UnsetAsSortKey() to allow doing it by destroying
the current sort descriptor.

Closes #18176.
This commit is contained in:
Daniel Kulp 2018-07-28 02:29:29 +02:00 committed by Vadim Zeitlin
parent a3f6456f55
commit 2a59c1fb20
3 changed files with 9 additions and 0 deletions

View File

@ -128,6 +128,7 @@ wxMSW:
wxOSX:
- Fix dispatching pending events (and CallAfter()) in console applications.
- Implement wxDataViewColumn::UnsetAsSortKey() (Daniel Kulp).
wxQt:

View File

@ -60,6 +60,7 @@ public:
virtual void SetMinWidth (int minWidth);
virtual void SetReorderable(bool reorderable);
virtual void SetResizeable (bool resizable);
virtual void UnsetAsSortKey();
virtual void SetSortable (bool sortable);
virtual void SetSortOrder (bool ascending);
virtual void SetTitle (wxString const& title);

View File

@ -3465,6 +3465,13 @@ void wxDataViewColumn::SetResizeable(bool resizable)
[m_NativeDataPtr->GetNativeColumnPtr() setResizingMask:NSTableColumnNoResizing];
}
void wxDataViewColumn::UnsetAsSortKey()
{
NSTableColumn* const tableColumn = m_NativeDataPtr->GetNativeColumnPtr();
if ( tableColumn )
[tableColumn setSortDescriptorPrototype:nil];
}
void wxDataViewColumn::SetSortable(bool sortable)
{
// wxDataViewColumnBase::SetSortable(sortable);