Added logic, API and docs for wxDataViewModel::HasDefaultCompare indicating a compare function usable without and column (header)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-08-22 21:18:06 +00:00
parent 04e7692af1
commit 0bd2681966
5 changed files with 57 additions and 12 deletions

View File

@@ -157,28 +157,28 @@ public:
void *id = child->GetItem().GetID();
m_children.Add( id );
#if 0
if (m_internal->IsSorted())
if (m_internal->IsSorted() || m_internal->GetDataViewModel()->HasDefaultCompare())
{
g_internal = m_internal;
m_children.Sort( &wxGtkTreeModelChildCmp );
return m_children.Index( id );
}
#endif
return m_children.GetCount()-1;
}
unsigned int AddLeave( void* id )
{
m_children.Add( id );
#if 0
if (m_internal->IsSorted())
if (m_internal->IsSorted() || m_internal->GetDataViewModel()->HasDefaultCompare())
{
g_internal = m_internal;
m_children.Sort( &wxGtkTreeModelChildCmp );
return m_children.Index( id );
}
#endif
return m_children.GetCount()-1;
}
@@ -2097,9 +2097,14 @@ void wxDataViewColumn::SetSortable( bool sortable )
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column);
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 );
}
}
bool wxDataViewColumn::IsSortable() const
@@ -2128,6 +2133,8 @@ void wxDataViewColumn::SetSortOrder( bool ascending )
gtk_tree_view_column_set_sort_order( column, GTK_SORT_ASCENDING );
else
gtk_tree_view_column_set_sort_order( column, GTK_SORT_DESCENDING );
gtk_tree_view_column_set_sort_indicator( column, TRUE );
}
bool wxDataViewColumn::IsSortOrderAscending() const