X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/100f649f944be51ddbcc55216a3938186f8f0770..6ba5438dda164146bf36ca729f8328332fae36b7:/samples/listctrl/listtest.cpp diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 99013eec8f..bfef9f62ab 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -25,9 +25,11 @@ #include "wx/wx.h" #endif -#ifndef __WXMSW__ +#if !defined(__WXMSW__) && !defined(__WXPM__) #include "mondrian.xpm" +#endif +#ifndef __WXMSW__ #include "bitmaps/toolbrai.xpm" #include "bitmaps/toolchar.xpm" #include "bitmaps/tooldata.xpm" @@ -95,7 +97,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(LIST_TOGGLE_LINES, MyFrame::OnToggleLines) EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateShowColInfo) - EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel) + EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel) END_EVENT_TABLE() BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl) @@ -494,6 +496,9 @@ void MyFrame::InitWithReportItems() m_listCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE ); m_listCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE ); m_listCtrl->SetColumnWidth( 2, wxLIST_AUTOSIZE ); + + // test SetItemFont too + m_listCtrl->SetItemFont(0, *wxITALIC_FONT); } void MyFrame::InitWithIconItems(bool withText, bool sameIcon) @@ -717,7 +722,11 @@ void MyListCtrl::SetColumnImage(int col, int image) void MyListCtrl::OnColClick(wxListEvent& event) { int col = event.GetColumn(); - SetColumnImage(col, 0); + + // set or unset image + static bool x = false; + x = !x; + SetColumnImage(col, x ? 0 : -1); wxLogMessage( wxT("OnColumnClick at %d."), col ); } @@ -733,7 +742,7 @@ void MyListCtrl::OnColRightClick(wxListEvent& event) // Show popupmenu at position wxMenu menu(wxT("Test")); menu.Append(LIST_ABOUT, _T("&About")); - PopupMenu(&menu, event.GetPoint()); + PopupMenu(&menu, event.GetPoint()); wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() ); } @@ -1032,4 +1041,3 @@ void MyListCtrl::InsertItemInReportView(int i) buf.Printf(_T("Item %d in column 2"), i); SetItem(i, 2, buf); } -