]>
Commit | Line | Data |
---|---|---|
457814b5 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: listctrl.h | |
3 | // Purpose: wxListCtrl sample | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 04/01/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart and Markus Holzem | |
5ea47806 | 9 | // Licence: wxWindows license |
457814b5 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | // Define a new application type | |
13 | class MyApp: public wxApp | |
fa5f6926 VZ |
14 | { |
15 | public: | |
16 | virtual bool OnInit(); | |
457814b5 JS |
17 | }; |
18 | ||
19 | class MyListCtrl: public wxListCtrl | |
20 | { | |
21 | public: | |
5ea47806 VZ |
22 | MyListCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, |
23 | const wxSize& size, long style): | |
457814b5 | 24 | wxListCtrl(parent, id, pos, size, style) |
5ea47806 VZ |
25 | { |
26 | } | |
fa5f6926 | 27 | |
8636aed8 | 28 | void OnColClick(wxListEvent& event); |
5ea47806 VZ |
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); | |
12c1b46a | 34 | void OnDeleteAllItems(wxListEvent& event); |
5ea47806 VZ |
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); | |
457814b5 | 41 | |
88ac883a VZ |
42 | void OnChar(wxKeyEvent& event); |
43 | ||
c41ea66a VZ |
44 | private: |
45 | void LogEvent(const wxListEvent& event, const wxChar *eventName); | |
46 | ||
5ea47806 | 47 | DECLARE_EVENT_TABLE() |
457814b5 JS |
48 | }; |
49 | ||
50 | // Define a new frame type | |
51 | class MyFrame: public wxFrame | |
5ea47806 VZ |
52 | { |
53 | public: | |
457814b5 JS |
54 | MyListCtrl *m_listCtrl; |
55 | wxTextCtrl *m_logWindow; | |
56 | ||
c41ea66a | 57 | MyFrame(const wxChar *title, int x, int y, int w, int h); |
5ea47806 VZ |
58 | ~MyFrame(); |
59 | ||
60 | public: | |
457814b5 JS |
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); | |
58b3bdc9 | 69 | void OnToggleFirstSel(wxCommandEvent& event); |
c4771147 KB |
70 | void OnDeselectAll(wxCommandEvent& event); |
71 | void OnSelectAll(wxCommandEvent& event); | |
bec0a261 | 72 | void OnDelete(wxCommandEvent& event); |
5ea47806 | 73 | void OnDeleteAll(wxCommandEvent& event); |
fa5f6926 | 74 | void OnSort(wxCommandEvent& event); |
11f26ea0 VZ |
75 | void OnSetFgColour(wxCommandEvent& event); |
76 | void OnSetBgColour(wxCommandEvent& event); | |
7b848b0d | 77 | void OnToggleMultiSel(wxCommandEvent& event); |
f6bcfd97 BP |
78 | void OnShowColInfo(wxCommandEvent& event); |
79 | void OnUpdateShowColInfo(wxUpdateUIEvent& event); | |
5ea47806 | 80 | |
57246713 KB |
81 | void BusyOn(wxCommandEvent& event); |
82 | void BusyOff(wxCommandEvent& event); | |
5ea47806 | 83 | |
c41ea66a VZ |
84 | wxImageList *m_imageListNormal; |
85 | wxImageList *m_imageListSmall; | |
86 | ||
87 | private: | |
88 | wxLog *m_logOld; | |
89 | ||
5ea47806 | 90 | DECLARE_EVENT_TABLE() |
457814b5 JS |
91 | }; |
92 | ||
93 | ||
94 | // ID for the menu quit command | |
fa5f6926 VZ |
95 | enum |
96 | { | |
97 | LIST_QUIT = 1, | |
98 | LIST_LIST_VIEW = 2, | |
99 | LIST_ICON_VIEW = 3, | |
100 | LIST_ICON_TEXT_VIEW = 4, | |
101 | LIST_SMALL_ICON_VIEW = 5, | |
102 | LIST_SMALL_ICON_TEXT_VIEW = 6, | |
103 | LIST_REPORT_VIEW = 7, | |
104 | LIST_DESELECT_ALL = 8, | |
105 | LIST_SELECT_ALL = 9, | |
106 | LIST_ABOUT = 102, | |
107 | BUSY_ON = 10, | |
108 | BUSY_OFF = 11, | |
109 | LIST_DELETE_ALL = 12, | |
bec0a261 | 110 | LIST_DELETE, |
fa5f6926 | 111 | LIST_SORT, |
11f26ea0 VZ |
112 | LIST_SET_FG_COL, |
113 | LIST_SET_BG_COL, | |
7b848b0d | 114 | LIST_TOGGLE_MULTI_SEL, |
58b3bdc9 | 115 | LIST_TOGGLE_FIRST, |
f6bcfd97 | 116 | LIST_SHOW_COL_INFO, |
457814b5 | 117 | |
fa5f6926 VZ |
118 | LIST_CTRL = 1000 |
119 | }; | |
457814b5 | 120 |