Also implement wxDataViewColumn::UnsetAsSortKey() for wxGTK

Allow to reset the sort order in native GTK+ implementation too.

See #18176.
This commit is contained in:
Vadim Zeitlin
2018-07-28 02:54:44 +02:00
parent 2a59c1fb20
commit 4af7d4e0d5
3 changed files with 13 additions and 0 deletions

View File

@@ -111,6 +111,7 @@ All (GUI):
wxGTK: wxGTK:
- Implement wxTextCtrl::HitTest() for single line controls. - Implement wxTextCtrl::HitTest() for single line controls.
- Implement wxDataViewColumn::UnsetAsSortKey().
- Fix not showing wxInfoBar with GTK+ 3 < 3.22.29. - Fix not showing wxInfoBar with GTK+ 3 < 3.22.29.
- Fix the build with glib < 2.32 (e.g. CentOS 6). - Fix the build with glib < 2.32 (e.g. CentOS 6).

View File

@@ -43,6 +43,7 @@ public:
virtual void SetSortable( bool sortable ) wxOVERRIDE; virtual void SetSortable( bool sortable ) wxOVERRIDE;
virtual void SetSortOrder( bool ascending ) wxOVERRIDE; virtual void SetSortOrder( bool ascending ) wxOVERRIDE;
virtual void UnsetAsSortKey() wxOVERRIDE;
virtual void SetResizeable( bool resizable ) wxOVERRIDE; virtual void SetResizeable( bool resizable ) wxOVERRIDE;
virtual void SetHidden( bool hidden ) wxOVERRIDE; virtual void SetHidden( bool hidden ) wxOVERRIDE;

View File

@@ -3345,6 +3345,17 @@ void wxDataViewColumn::SetSortOrder( bool ascending )
internal->SetDataViewSortColumn(this); internal->SetDataViewSortColumn(this);
} }
void wxDataViewColumn::UnsetAsSortKey()
{
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
gtk_tree_view_column_set_sort_indicator( column, FALSE );
wxDataViewCtrlInternal* internal = m_owner->GtkGetInternal();
internal->SetSortColumn(-1);
internal->SetDataViewSortColumn(NULL);
}
bool wxDataViewColumn::IsSortOrderAscending() const bool wxDataViewColumn::IsSortOrderAscending() const
{ {
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column); GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);