// number of items in icon/small icon view
static const int NUM_ICONS = 9;
-int wxCALLBACK MyCompareFunction(long item1, long item2, long sortData)
+int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData))
{
// inverse the order
- if (item1 < item2) return -1;
- if (item1 > item2) return 1;
+ if (item1 < item2)
+ return -1;
+ if (item1 > item2)
+ return 1;
+
return 0;
}
}
void MyFrame::OnSize(wxSizeEvent& event)
+{
+ DoSize();
+
+ event.Skip();
+}
+
+void MyFrame::DoSize()
{
if ( !m_logWindow )
return;
wxCoord y = (2*size.y)/3;
m_listCtrl->SetSize(0, 0, size.x, y);
m_logWindow->SetSize(0, y + 1, size.x, size.y - y);
-
- event.Skip();
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
dialog.ShowModal();
}
-void MyFrame::OnFreeze(wxCommandEvent& event)
+void MyFrame::OnFreeze(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(_T("Freezing the control"));
m_listCtrl->Freeze();
}
-void MyFrame::OnThaw(wxCommandEvent& event)
+void MyFrame::OnThaw(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(_T("Thawing the control"));
void MyFrame::OnToggleFirstSel(wxCommandEvent& WXUNUSED(event))
{
- m_listCtrl->SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
+ m_listCtrl->SetItemState(0, (~m_listCtrl->GetItemState(0, wxLIST_STATE_SELECTED) ) & wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
void MyFrame::OnDeselectAll(wxCommandEvent& WXUNUSED(event))
}
}
-#ifdef __WXMSW__
- SendSizeEvent();
-#endif
+ DoSize();
m_logWindow->Clear();
}
sw.Time()));
}
-void MyFrame::OnShowSelInfo(wxCommandEvent& event)
+void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event))
{
int selCount = m_listCtrl->GetSelectedItemCount();
wxLogMessage(_T("%d items selected:"), selCount);
}
}
-void MyFrame::OnShowColInfo(wxCommandEvent& event)
+void MyFrame::OnShowColInfo(wxCommandEvent& WXUNUSED(event))
{
int count = m_listCtrl->GetColumnCount();
wxLogMessage(wxT("%d columns:"), count);
void MyListCtrl::OnEndLabelEdit(wxListEvent& event)
{
- wxLogMessage( wxT("OnEndLabelEdit: %s"), event.m_item.m_text.c_str());
+ wxLogMessage( wxT("OnEndLabelEdit: %s"),
+ event.IsEditCancelled() ? _T("[cancelled]")
+ : event.m_item.m_text.c_str());
}
void MyListCtrl::OnDeleteItem(wxListEvent& event)
return wxString::Format(_T("Column %ld of item %ld"), column, item);
}
-int MyListCtrl::OnGetItemImage(long item) const
+int MyListCtrl::OnGetItemImage(long WXUNUSED(item)) const
{
return 0;
}