1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxListCtrl sample
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation
17 // For compilers that support precompilation, includes "wx/wx.h".
18 #include "wx/wxprec.h"
29 #include "mondrian.xpm"
32 #include "wx/listctrl.h"
33 #include "wx/timer.h" // for wxStopWatch
34 #include "wx/colordlg.h" // for wxGetColourFromUser
38 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
39 EVT_MENU(BUSY_ON
, MyFrame::BusyOn
)
40 EVT_MENU(BUSY_OFF
, MyFrame::BusyOff
)
41 EVT_MENU(LIST_QUIT
, MyFrame::OnQuit
)
42 EVT_MENU(LIST_ABOUT
, MyFrame::OnAbout
)
43 EVT_MENU(LIST_LIST_VIEW
, MyFrame::OnListView
)
44 EVT_MENU(LIST_REPORT_VIEW
, MyFrame::OnReportView
)
45 EVT_MENU(LIST_ICON_VIEW
, MyFrame::OnIconView
)
46 EVT_MENU(LIST_ICON_TEXT_VIEW
, MyFrame::OnIconTextView
)
47 EVT_MENU(LIST_SMALL_ICON_VIEW
, MyFrame::OnSmallIconView
)
48 EVT_MENU(LIST_SMALL_ICON_TEXT_VIEW
, MyFrame::OnSmallIconTextView
)
49 EVT_MENU(LIST_DESELECT_ALL
, MyFrame::OnDeselectAll
)
50 EVT_MENU(LIST_SELECT_ALL
, MyFrame::OnSelectAll
)
51 EVT_MENU(LIST_DELETE_ALL
, MyFrame::OnDeleteAll
)
52 EVT_MENU(LIST_SORT
, MyFrame::OnSort
)
53 EVT_MENU(LIST_SET_FG_COL
, MyFrame::OnSetFgColour
)
54 EVT_MENU(LIST_SET_BG_COL
, MyFrame::OnSetBgColour
)
57 BEGIN_EVENT_TABLE(MyListCtrl
, wxListCtrl
)
58 EVT_LIST_BEGIN_DRAG(LIST_CTRL
, MyListCtrl::OnBeginDrag
)
59 EVT_LIST_BEGIN_RDRAG(LIST_CTRL
, MyListCtrl::OnBeginRDrag
)
60 EVT_LIST_BEGIN_LABEL_EDIT(LIST_CTRL
, MyListCtrl::OnBeginLabelEdit
)
61 EVT_LIST_END_LABEL_EDIT(LIST_CTRL
, MyListCtrl::OnEndLabelEdit
)
62 EVT_LIST_DELETE_ITEM(LIST_CTRL
, MyListCtrl::OnDeleteItem
)
63 EVT_LIST_DELETE_ALL_ITEMS(LIST_CTRL
, MyListCtrl::OnDeleteAllItems
)
64 EVT_LIST_GET_INFO(LIST_CTRL
, MyListCtrl::OnGetInfo
)
65 EVT_LIST_SET_INFO(LIST_CTRL
, MyListCtrl::OnSetInfo
)
66 EVT_LIST_ITEM_SELECTED(LIST_CTRL
, MyListCtrl::OnSelected
)
67 EVT_LIST_ITEM_DESELECTED(LIST_CTRL
, MyListCtrl::OnDeselected
)
68 EVT_LIST_KEY_DOWN(LIST_CTRL
, MyListCtrl::OnListKeyDown
)
69 EVT_LIST_ITEM_ACTIVATED(LIST_CTRL
, MyListCtrl::OnActivated
)
70 EVT_LIST_COL_CLICK(LIST_CTRL
, MyListCtrl::OnColClick
)
75 int wxCALLBACK
MyCompareFunction(long item1
, long item2
, long sortData
)
81 // `Main program' equivalent, creating windows and returning main app frame
84 // Create the main frame window
85 MyFrame
*frame
= new MyFrame((wxFrame
*) NULL
, "wxListCtrl Test", 50, 50, 450, 340);
88 frame
->SetIcon( wxICON(mondrian
) );
90 // Make an image list containing large icons
91 m_imageListNormal
= new wxImageList(32, 32, TRUE
);
92 m_imageListSmall
= new wxImageList(16, 16, TRUE
);
95 m_imageListNormal
->Add( wxIcon("icon1", wxBITMAP_TYPE_ICO_RESOURCE
) );
96 m_imageListNormal
->Add( wxIcon("icon2", wxBITMAP_TYPE_ICO_RESOURCE
) );
97 m_imageListNormal
->Add( wxIcon("icon3", wxBITMAP_TYPE_ICO_RESOURCE
) );
98 m_imageListNormal
->Add( wxIcon("icon4", wxBITMAP_TYPE_ICO_RESOURCE
) );
99 m_imageListNormal
->Add( wxIcon("icon5", wxBITMAP_TYPE_ICO_RESOURCE
) );
100 m_imageListNormal
->Add( wxIcon("icon6", wxBITMAP_TYPE_ICO_RESOURCE
) );
101 m_imageListNormal
->Add( wxIcon("icon7", wxBITMAP_TYPE_ICO_RESOURCE
) );
102 m_imageListNormal
->Add( wxIcon("icon8", wxBITMAP_TYPE_ICO_RESOURCE
) );
103 m_imageListNormal
->Add( wxIcon("icon9", wxBITMAP_TYPE_ICO_RESOURCE
) );
105 m_imageListSmall
->Add( wxIcon("iconsmall", wxBITMAP_TYPE_ICO_RESOURCE
) );
109 #include "bitmaps/toolbrai.xpm"
110 m_imageListNormal
->Add( wxIcon( toolbrai_xpm
) );
111 #include "bitmaps/toolchar.xpm"
112 m_imageListNormal
->Add( wxIcon( toolchar_xpm
) );
113 #include "bitmaps/tooldata.xpm"
114 m_imageListNormal
->Add( wxIcon( tooldata_xpm
) );
115 #include "bitmaps/toolnote.xpm"
116 m_imageListNormal
->Add( wxIcon( toolnote_xpm
) );
117 #include "bitmaps/tooltodo.xpm"
118 m_imageListNormal
->Add( wxIcon( tooltodo_xpm
) );
119 #include "bitmaps/toolchec.xpm"
120 m_imageListNormal
->Add( wxIcon( toolchec_xpm
) );
121 #include "bitmaps/toolgame.xpm"
122 m_imageListNormal
->Add( wxIcon( toolgame_xpm
) );
123 #include "bitmaps/tooltime.xpm"
124 m_imageListNormal
->Add( wxIcon( tooltime_xpm
) );
125 #include "bitmaps/toolword.xpm"
126 m_imageListNormal
->Add( wxIcon( toolword_xpm
) );
128 #include "bitmaps/small1.xpm"
129 m_imageListSmall
->Add( wxIcon( small1_xpm
) );
134 wxMenu
*menuFile
= new wxMenu
;
135 menuFile
->Append(LIST_ABOUT
, "&About");
136 menuFile
->AppendSeparator();
137 #if 0 // what is this for? (VZ)
138 menuFile
->Append(BUSY_ON
, "&Busy cursor on");
139 menuFile
->Append(BUSY_OFF
, "&Busy cursor off");
140 menuFile
->AppendSeparator();
142 menuFile
->Append(LIST_QUIT
, "E&xit\tAlt-X");
144 wxMenu
*menuView
= new wxMenu
;
145 menuView
->Append(LIST_LIST_VIEW
, "&List view\tF1");
146 menuView
->Append(LIST_REPORT_VIEW
, "&Report view\tF2");
147 menuView
->Append(LIST_ICON_VIEW
, "&Icon view\tF3");
148 menuView
->Append(LIST_ICON_TEXT_VIEW
, "Icon view with &text\tF4");
149 menuView
->Append(LIST_SMALL_ICON_VIEW
, "&Small icon view\tF5");
150 menuView
->Append(LIST_SMALL_ICON_TEXT_VIEW
, "Small icon &view with text\tF6");
152 wxMenu
*menuList
= new wxMenu
;
153 menuList
->Append(LIST_DESELECT_ALL
, "&Deselect All\tCtrl-D");
154 menuList
->Append(LIST_SELECT_ALL
, "S&elect All\tCtrl-A");
155 menuList
->AppendSeparator();
156 menuList
->Append(LIST_SORT
, "&Sort\tCtrl-S");
157 menuList
->AppendSeparator();
158 menuList
->Append(LIST_DELETE_ALL
, "Delete &all items");
160 wxMenu
*menuCol
= new wxMenu
;
161 menuCol
->Append(LIST_SET_FG_COL
, "&Foreground colour...");
162 menuCol
->Append(LIST_SET_BG_COL
, "&Background colour...");
164 wxMenuBar
*menubar
= new wxMenuBar
;
165 menubar
->Append(menuFile
, "&File");
166 menubar
->Append(menuView
, "&View");
167 menubar
->Append(menuList
, "&List");
168 menubar
->Append(menuCol
, "&Colour");
169 frame
->SetMenuBar(menubar
);
171 frame
->m_listCtrl
= new MyListCtrl(frame
, LIST_CTRL
, wxPoint(0, 0), wxSize(400, 200),
172 wxLC_LIST
|wxSUNKEN_BORDER
|wxLC_EDIT_LABELS
);
173 // wxLC_LIST|wxLC_USER_TEXT|wxSUNKEN_BORDER); // wxLC_USER_TEXT requires app to supply all text on demand
175 frame
->m_logWindow
= new wxTextCtrl(frame
, -1, "", wxPoint(0, 0), wxSize(400, 200), wxTE_MULTILINE
|wxSUNKEN_BORDER
);
177 wxLayoutConstraints
*c
= new wxLayoutConstraints
;
178 c
->top
.SameAs (frame
, wxTop
);
179 c
->left
.SameAs (frame
, wxLeft
);
180 c
->right
.SameAs (frame
, wxRight
);
181 c
->height
.PercentOf (frame
, wxHeight
, 66);
182 frame
->m_listCtrl
->SetConstraints(c
);
184 c
= new wxLayoutConstraints
;
185 c
->top
.Below (frame
->m_listCtrl
);
186 c
->left
.SameAs (frame
, wxLeft
);
187 c
->right
.SameAs (frame
, wxRight
);
188 c
->bottom
.SameAs (frame
, wxBottom
);
189 frame
->m_logWindow
->SetConstraints(c
);
190 frame
->SetAutoLayout(TRUE
);
193 for ( int i
=0; i
< 30; i
++)
196 wxSprintf(buf
, _T("Item %d"), i
);
197 frame
->m_listCtrl
->InsertItem(i
, buf
);
200 frame
->CreateStatusBar(3);
210 // My frame constructor
211 MyFrame::MyFrame(wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
)
212 : wxFrame(frame
, -1, title
, wxPoint(x
, y
), wxSize(w
, h
))
214 m_listCtrl
= (MyListCtrl
*) NULL
;
215 m_logWindow
= (wxTextCtrl
*) NULL
;
220 delete wxGetApp().m_imageListNormal
;
221 delete wxGetApp().m_imageListSmall
;
224 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
))
229 void MyFrame::BusyOn(wxCommandEvent
& WXUNUSED(event
))
234 void MyFrame::BusyOff(wxCommandEvent
& WXUNUSED(event
))
239 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
))
241 wxMessageDialog
dialog(this, "List test sample\nJulian Smart (c) 1997",
242 "About list test", wxOK
|wxCANCEL
);
247 void MyFrame::OnDeselectAll(wxCommandEvent
& WXUNUSED(event
))
249 int n
= m_listCtrl
->GetItemCount();
250 for (int i
= 0; i
< n
; i
++)
251 m_listCtrl
->SetItemState(i
,0,wxLIST_STATE_SELECTED
);
254 void MyFrame::OnSelectAll(wxCommandEvent
& WXUNUSED(event
))
256 int n
= m_listCtrl
->GetItemCount();
257 for (int i
= 0; i
< n
; i
++)
258 m_listCtrl
->SetItemState(i
,wxLIST_STATE_SELECTED
, wxLIST_STATE_SELECTED
);
261 void MyFrame::OnListView(wxCommandEvent
& WXUNUSED(event
))
263 m_listCtrl
->ClearAll();
264 m_logWindow
->Clear();
266 m_listCtrl
->SetSingleStyle(wxLC_LIST
);
267 m_listCtrl
->SetImageList((wxImageList
*) NULL
, wxIMAGE_LIST_NORMAL
);
268 m_listCtrl
->SetImageList((wxImageList
*) NULL
, wxIMAGE_LIST_SMALL
);
270 for ( int i
=0; i
< 30; i
++)
273 wxSprintf(buf
, _T("Item %d"), i
);
274 m_listCtrl
->InsertItem(i
, buf
);
278 void MyFrame::OnReportView(wxCommandEvent
& WXUNUSED(event
))
280 m_logWindow
->Clear();
281 m_listCtrl
->ClearAll();
283 m_listCtrl
->SetSingleStyle(wxLC_REPORT
);
284 m_listCtrl
->SetImageList((wxImageList
*) NULL
, wxIMAGE_LIST_NORMAL
);
285 m_listCtrl
->SetImageList(wxGetApp().m_imageListSmall
, wxIMAGE_LIST_SMALL
);
287 m_listCtrl
->InsertColumn(0, "Column 1"); // , wxLIST_FORMAT_LEFT, 140);
288 m_listCtrl
->InsertColumn(1, "Column 2"); // , wxLIST_FORMAT_LEFT, 140);
289 m_listCtrl
->InsertColumn(2, "One More Column (2)"); // , wxLIST_FORMAT_LEFT, 140);
291 // to speed up inserting we hide the control temporarily
297 static const int NUM_ITEMS
= 3000;
298 for ( int i
= 0; i
< NUM_ITEMS
; i
++ )
300 buf
.Printf(_T("This is item %d"), i
);
301 long tmp
= m_listCtrl
->InsertItem(i
, buf
, 0);
302 m_listCtrl
->SetItemData(tmp
, i
);
304 buf
.Printf(_T("Col 1, item %d"), i
);
305 tmp
= m_listCtrl
->SetItem(i
, 1, buf
);
307 buf
.Printf(_T("Item %d in column 2"), i
);
308 tmp
= m_listCtrl
->SetItem(i
, 2, buf
);
311 m_logWindow
->WriteText(wxString::Format(_T("%d items inserted in %ldms\n"),
312 NUM_ITEMS
, sw
.Time()));
315 // we leave all mask fields to 0 and only change the colour
318 item
.SetTextColour(*wxRED
);
319 m_listCtrl
->SetItem( item
);
322 item
.SetTextColour(*wxGREEN
);
323 m_listCtrl
->SetItem( item
);
325 item
.SetTextColour(*wxLIGHT_GREY
);
326 item
.SetFont(*wxITALIC_FONT
);
327 item
.SetBackgroundColour(*wxRED
);
328 m_listCtrl
->SetItem( item
);
330 m_listCtrl
->SetTextColour(*wxBLUE
);
331 m_listCtrl
->SetBackgroundColour(*wxLIGHT_GREY
);
333 m_listCtrl
->SetColumnWidth( 0, wxLIST_AUTOSIZE
);
334 m_listCtrl
->SetColumnWidth( 1, wxLIST_AUTOSIZE
);
335 m_listCtrl
->SetColumnWidth( 2, wxLIST_AUTOSIZE
);
338 void MyFrame::OnIconView(wxCommandEvent
& WXUNUSED(event
))
340 m_logWindow
->Clear();
341 m_listCtrl
->ClearAll();
343 m_listCtrl
->SetSingleStyle(wxLC_ICON
);
344 m_listCtrl
->SetImageList(wxGetApp().m_imageListNormal
, wxIMAGE_LIST_NORMAL
);
345 m_listCtrl
->SetImageList(wxGetApp().m_imageListSmall
, wxIMAGE_LIST_SMALL
);
347 for ( int i
=0; i
< 9; i
++)
349 m_listCtrl
->InsertItem(i
, i
);
353 void MyFrame::OnIconTextView(wxCommandEvent
& WXUNUSED(event
))
355 m_logWindow
->Clear();
356 m_listCtrl
->ClearAll();
358 m_listCtrl
->SetSingleStyle(wxLC_ICON
);
359 m_listCtrl
->SetImageList(wxGetApp().m_imageListNormal
, wxIMAGE_LIST_NORMAL
);
360 m_listCtrl
->SetImageList(wxGetApp().m_imageListSmall
, wxIMAGE_LIST_SMALL
);
362 for ( int i
=0; i
< 9; i
++)
365 wxSprintf(buf
, _T("Label %d"), i
);
366 m_listCtrl
->InsertItem(i
, buf
, i
);
370 void MyFrame::OnSmallIconView(wxCommandEvent
& WXUNUSED(event
))
372 m_logWindow
->Clear();
373 m_listCtrl
->ClearAll();
375 m_listCtrl
->SetSingleStyle(wxLC_SMALL_ICON
);
376 m_listCtrl
->SetImageList(wxGetApp().m_imageListNormal
, wxIMAGE_LIST_NORMAL
);
377 m_listCtrl
->SetImageList(wxGetApp().m_imageListSmall
, wxIMAGE_LIST_SMALL
);
379 for ( int i
=0; i
< 9; i
++)
381 m_listCtrl
->InsertItem(i
, 0);
385 void MyFrame::OnSmallIconTextView(wxCommandEvent
& WXUNUSED(event
))
387 m_logWindow
->Clear();
388 m_listCtrl
->ClearAll();
390 m_listCtrl
->SetSingleStyle(wxLC_SMALL_ICON
);
391 m_listCtrl
->SetImageList(wxGetApp().m_imageListNormal
, wxIMAGE_LIST_NORMAL
);
392 m_listCtrl
->SetImageList(wxGetApp().m_imageListSmall
, wxIMAGE_LIST_SMALL
);
394 for ( int i
=0; i
< 9; i
++)
396 m_listCtrl
->InsertItem(i
, "Label", 0);
400 void MyFrame::OnSort(wxCommandEvent
& WXUNUSED(event
))
404 m_listCtrl
->SortItems(MyCompareFunction
, 0);
406 m_logWindow
->WriteText(wxString::Format(_T("Sorting %d items took %ld ms\n"),
407 m_listCtrl
->GetItemCount(),
411 void MyFrame::OnSetFgColour(wxCommandEvent
& WXUNUSED(event
))
413 m_listCtrl
->SetForegroundColour(wxGetColourFromUser(this));
414 m_listCtrl
->Refresh();
417 void MyFrame::OnSetBgColour(wxCommandEvent
& WXUNUSED(event
))
419 m_listCtrl
->SetBackgroundColour(wxGetColourFromUser(this));
420 m_listCtrl
->Refresh();
423 void MyFrame::OnDeleteAll(wxCommandEvent
& WXUNUSED(event
))
427 m_listCtrl
->DeleteAllItems();
429 m_logWindow
->WriteText(wxString::Format(_T("Deleting %d items took %ld ms\n"),
430 m_listCtrl
->GetItemCount(),
436 void MyListCtrl::OnColClick(wxListEvent
& event
)
438 if ( !wxGetApp().GetTopWindow() )
441 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
446 msg
.Printf( "OnColumnClick at %d.\n", event
.GetColumn() );
447 text
->WriteText(msg
);
450 void MyListCtrl::OnBeginDrag(wxListEvent
& event
)
452 if ( !wxGetApp().GetTopWindow() )
455 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
460 msg
.Printf( "OnBeginDrag at %d,%d.\n", event
.m_pointDrag
.x
, event
.m_pointDrag
.y
);
461 text
->WriteText(msg
);
464 void MyListCtrl::OnBeginRDrag(wxListEvent
& event
)
466 if ( !wxGetApp().GetTopWindow() )
469 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
474 msg
.Printf( "OnBeginRDrag at %d,%d.\n", event
.m_pointDrag
.x
, event
.m_pointDrag
.y
);
475 text
->WriteText(msg
);
478 void MyListCtrl::OnBeginLabelEdit(wxListEvent
& event
)
480 if ( !wxGetApp().GetTopWindow() )
483 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
487 text
->WriteText("OnBeginLabelEdit: ");
488 text
->WriteText(event
.m_item
.m_text
);
489 text
->WriteText("\n");
492 void MyListCtrl::OnEndLabelEdit(wxListEvent
& event
)
494 if ( !wxGetApp().GetTopWindow() )
497 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
501 text
->WriteText("OnEndLabelEdit: ");
502 text
->WriteText(event
.m_item
.m_text
);
503 text
->WriteText("\n");
506 void MyListCtrl::OnDeleteItem(wxListEvent
& WXUNUSED(event
))
508 if ( !wxGetApp().GetTopWindow() )
511 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
515 text
->WriteText("OnDeleteItem\n");
518 void MyListCtrl::OnDeleteAllItems(wxListEvent
& WXUNUSED(event
))
520 if ( !wxGetApp().GetTopWindow() )
523 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
527 text
->WriteText("OnDeleteAllItems\n");
530 void MyListCtrl::OnGetInfo(wxListEvent
& event
)
532 if ( !wxGetApp().GetTopWindow() )
535 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
539 text
->WriteText("OnGetInfo\n");
541 (*text
) << "OnGetInfo (" << event
.m_item
.m_itemId
<< ", " << event
.m_item
.m_col
<< ")";
542 if ( event
.m_item
.m_mask
& wxLIST_MASK_STATE
)
543 (*text
) << " wxLIST_MASK_STATE";
544 if ( event
.m_item
.m_mask
& wxLIST_MASK_TEXT
)
545 (*text
) << " wxLIST_MASK_TEXT";
546 if ( event
.m_item
.m_mask
& wxLIST_MASK_IMAGE
)
547 (*text
) << " wxLIST_MASK_IMAGE";
548 if ( event
.m_item
.m_mask
& wxLIST_MASK_DATA
)
549 (*text
) << " wxLIST_MASK_DATA";
550 if ( event
.m_item
.m_mask
& wxLIST_SET_ITEM
)
551 (*text
) << " wxLIST_SET_ITEM";
552 if ( event
.m_item
.m_mask
& wxLIST_MASK_WIDTH
)
553 (*text
) << " wxLIST_MASK_WIDTH";
554 if ( event
.m_item
.m_mask
& wxLIST_MASK_FORMAT
)
555 (*text
) << " wxLIST_MASK_WIDTH";
557 if ( event
.m_item
.m_mask
& wxLIST_MASK_TEXT
)
559 event
.m_item
.m_text
= "My callback text";
564 void MyListCtrl::OnSetInfo(wxListEvent
& WXUNUSED(event
))
566 if ( !wxGetApp().GetTopWindow() )
569 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
573 text
->WriteText("OnSetInfo\n");
576 void MyListCtrl::OnSelected(wxListEvent
& event
)
578 if ( !wxGetApp().GetTopWindow() )
581 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
585 if ( GetWindowStyle() & wxLC_REPORT
)
588 info
.m_itemId
= event
.m_itemIndex
;
590 info
.m_mask
= wxLIST_MASK_TEXT
;
593 *text
<< "Value of the 2nd field of the selected item: "
594 << info
.m_text
<< '\n';
598 wxFAIL_MSG("wxListCtrl::GetItem() failed");
602 text
->WriteText("OnSelected\n");
605 void MyListCtrl::OnDeselected(wxListEvent
& WXUNUSED(event
))
607 if ( !wxGetApp().GetTopWindow() )
610 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
614 text
->WriteText("OnDeselected\n");
617 void MyListCtrl::OnActivated(wxListEvent
& WXUNUSED(event
))
619 if ( !wxGetApp().GetTopWindow() )
622 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
626 text
->WriteText("OnActivated\n");
629 void MyListCtrl::OnListKeyDown(wxListEvent
& event
)
631 if ( !wxGetApp().GetTopWindow() )
634 wxTextCtrl
*text
= ((MyFrame
*)wxGetApp().GetTopWindow())->m_logWindow
;
638 text
->WriteText("OnListKeyDown\n");