+MySortingFrame::~MySortingFrame()
+{
+ delete wxLog::SetActiveTarget(m_logOld);
+}
+
+void MySortingFrame::OnSelectedUnsorted(wxDataViewEvent &event)
+{
+ int row = event.GetRow();
+ wxLogMessage( wxT("OnSelected from unsorted list, selected %d"), row );
+ if (row >= 0)
+ wxLogMessage( wxT("wxDataViewCtrl::IsSelected( %d ): %d (as int)"),
+ row, (int) dataview_right->IsSelected( row ) );
+}
+
+void MySortingFrame::OnSelectedSorted(wxDataViewEvent &event)
+{
+ wxLogMessage( wxT("OnSelected from sorted list, selected %d"), (int) event.GetRow() );
+}
+
+void MySortingFrame::OnActivatedUnsorted(wxDataViewEvent &event)
+{
+ wxLogMessage( wxT("OnActivated from unsorted list, activated %d"), (int) event.GetRow() );
+}
+
+void MySortingFrame::OnHeaderClickSorted(wxDataViewEvent &event)
+{
+ wxDataViewColumn *col = event.GetDataViewColumn();
+ wxLogMessage( wxT("OnHeaderClick from sorted list, column %s"), col->GetTitle().c_str() );
+
+ if (col->GetTitle() == wxT("editable"))
+ {
+ // this is the sorting column
+ if (col->IsSortOrderAscending())
+ {
+ col->SetSortOrder( false );
+ m_sorted_model->SetAscending( false );
+ m_sorted_model->Resort();
+ }
+ else
+ {
+ col->SetSortOrder( true );
+ m_sorted_model->SetAscending( true );
+ m_sorted_model->Resort();
+ }
+ }
+}
+
+void MySortingFrame::OnHeaderClickUnsorted(wxDataViewEvent &event)
+{
+ wxLogMessage( wxT("OnHeaderClick from unsorted list, column %s"), event.GetDataViewColumn()->GetTitle().c_str() );
+}
+