1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxListCtrl sample
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // Define a new application type
13 class MyApp
: public wxApp
16 virtual bool OnInit();
19 class MyListCtrl
: public wxListCtrl
22 MyListCtrl(wxWindow
*parent
, const wxWindowID id
, const wxPoint
& pos
,
23 const wxSize
& size
, long style
):
24 wxListCtrl(parent
, id
, pos
, size
, style
)
28 void OnColClick(wxListEvent
& event
);
29 void OnBeginDrag(wxListEvent
& event
);
30 void OnBeginRDrag(wxListEvent
& event
);
31 void OnBeginLabelEdit(wxListEvent
& event
);
32 void OnEndLabelEdit(wxListEvent
& event
);
33 void OnDeleteItem(wxListEvent
& event
);
34 void OnDeleteAllItems(wxListEvent
& event
);
35 void OnGetInfo(wxListEvent
& event
);
36 void OnSetInfo(wxListEvent
& event
);
37 void OnSelected(wxListEvent
& event
);
38 void OnDeselected(wxListEvent
& event
);
39 void OnListKeyDown(wxListEvent
& event
);
40 void OnActivated(wxListEvent
& event
);
42 void OnChar(wxKeyEvent
& event
);
45 void LogEvent(const wxListEvent
& event
, const wxChar
*eventName
);
50 // Define a new frame type
51 class MyFrame
: public wxFrame
54 MyListCtrl
*m_listCtrl
;
55 wxTextCtrl
*m_logWindow
;
57 MyFrame(const wxChar
*title
, int x
, int y
, int w
, int h
);
61 void OnQuit(wxCommandEvent
& event
);
62 void OnAbout(wxCommandEvent
& event
);
63 void OnListView(wxCommandEvent
& event
);
64 void OnReportView(wxCommandEvent
& event
);
65 void OnIconView(wxCommandEvent
& event
);
66 void OnIconTextView(wxCommandEvent
& event
);
67 void OnSmallIconView(wxCommandEvent
& event
);
68 void OnSmallIconTextView(wxCommandEvent
& event
);
69 void OnDeselectAll(wxCommandEvent
& event
);
70 void OnSelectAll(wxCommandEvent
& event
);
71 void OnDeleteAll(wxCommandEvent
& event
);
72 void OnSort(wxCommandEvent
& event
);
73 void OnSetFgColour(wxCommandEvent
& event
);
74 void OnSetBgColour(wxCommandEvent
& event
);
75 void OnToggleMultiSel(wxCommandEvent
& event
);
77 void BusyOn(wxCommandEvent
& event
);
78 void BusyOff(wxCommandEvent
& event
);
80 wxImageList
*m_imageListNormal
;
81 wxImageList
*m_imageListSmall
;
90 // ID for the menu quit command
96 LIST_ICON_TEXT_VIEW
= 4,
97 LIST_SMALL_ICON_VIEW
= 5,
98 LIST_SMALL_ICON_TEXT_VIEW
= 6,
100 LIST_DESELECT_ALL
= 8,
105 LIST_DELETE_ALL
= 12,
109 LIST_TOGGLE_MULTI_SEL
,