From 140a119ad2c5697bef8910783bb8a16bf293fa54 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 7 Dec 2008 16:16:21 +0000 Subject: [PATCH] restore sorting functionality broken by r57161 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dataview.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 52b0a5e05d..ae58e36199 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -2686,7 +2686,16 @@ void wxDataViewColumn::SetSortable( bool sortable ) { GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column); - gtk_tree_view_column_set_clickable( column, sortable ); + if ( sortable ) + { + gtk_tree_view_column_set_sort_column_id( column, GetModelColumn() ); + } + else + { + gtk_tree_view_column_set_sort_column_id( column, -1 ); + gtk_tree_view_column_set_sort_indicator( column, FALSE ); + gtk_tree_view_column_set_clickable( column, FALSE ); + } } bool wxDataViewColumn::IsSortable() const @@ -2695,25 +2704,18 @@ bool wxDataViewColumn::IsSortable() const return gtk_tree_view_column_get_clickable( column ); } -void wxDataViewColumn::SetAsSortKey( bool sort ) +void wxDataViewColumn::SetAsSortKey( bool WXUNUSED(sort) ) { - GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column); - - if (sort) - { - gtk_tree_view_column_set_sort_column_id( column, GetModelColumn() ); - } - else - { - gtk_tree_view_column_set_sort_column_id( column, -1 ); - gtk_tree_view_column_set_sort_indicator( column, FALSE ); - } + // it might not make sense to have this function in wxHeaderColumnBase at + // all in fact, changing of the sort order should only be done using the + // associated control API + wxFAIL_MSG( "not implemented" ); } bool wxDataViewColumn::IsSortKey() const { GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column); - return (gtk_tree_view_column_get_sort_column_id( column ) != -1); + return gtk_tree_view_column_get_sort_indicator( column ); } bool wxDataViewColumn::IsResizeable() const -- 2.50.0