]>
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 | wxImageList *m_imageListNormal; | |
19 | wxImageList *m_imageListSmall; | |
20 | }; | |
21 | ||
22 | class MyListCtrl: public wxListCtrl | |
23 | { | |
24 | public: | |
5ea47806 VZ |
25 | MyListCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, |
26 | const wxSize& size, long style): | |
457814b5 | 27 | wxListCtrl(parent, id, pos, size, style) |
5ea47806 VZ |
28 | { |
29 | } | |
fa5f6926 | 30 | |
8636aed8 | 31 | void OnColClick(wxListEvent& event); |
5ea47806 VZ |
32 | void OnBeginDrag(wxListEvent& event); |
33 | void OnBeginRDrag(wxListEvent& event); | |
34 | void OnBeginLabelEdit(wxListEvent& event); | |
35 | void OnEndLabelEdit(wxListEvent& event); | |
36 | void OnDeleteItem(wxListEvent& event); | |
12c1b46a | 37 | void OnDeleteAllItems(wxListEvent& event); |
5ea47806 VZ |
38 | void OnGetInfo(wxListEvent& event); |
39 | void OnSetInfo(wxListEvent& event); | |
40 | void OnSelected(wxListEvent& event); | |
41 | void OnDeselected(wxListEvent& event); | |
42 | void OnListKeyDown(wxListEvent& event); | |
43 | void OnActivated(wxListEvent& event); | |
457814b5 | 44 | |
88ac883a VZ |
45 | void OnChar(wxKeyEvent& event); |
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 | ||
57 | MyFrame(wxFrame *frame, char *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); | |
c4771147 KB |
69 | void OnDeselectAll(wxCommandEvent& event); |
70 | void OnSelectAll(wxCommandEvent& event); | |
5ea47806 | 71 | void OnDeleteAll(wxCommandEvent& event); |
fa5f6926 | 72 | void OnSort(wxCommandEvent& event); |
11f26ea0 VZ |
73 | void OnSetFgColour(wxCommandEvent& event); |
74 | void OnSetBgColour(wxCommandEvent& event); | |
7b848b0d | 75 | void OnToggleMultiSel(wxCommandEvent& event); |
5ea47806 | 76 | |
57246713 KB |
77 | void BusyOn(wxCommandEvent& event); |
78 | void BusyOff(wxCommandEvent& event); | |
5ea47806 VZ |
79 | |
80 | DECLARE_EVENT_TABLE() | |
457814b5 JS |
81 | }; |
82 | ||
83 | ||
84 | // ID for the menu quit command | |
fa5f6926 VZ |
85 | enum |
86 | { | |
87 | LIST_QUIT = 1, | |
88 | LIST_LIST_VIEW = 2, | |
89 | LIST_ICON_VIEW = 3, | |
90 | LIST_ICON_TEXT_VIEW = 4, | |
91 | LIST_SMALL_ICON_VIEW = 5, | |
92 | LIST_SMALL_ICON_TEXT_VIEW = 6, | |
93 | LIST_REPORT_VIEW = 7, | |
94 | LIST_DESELECT_ALL = 8, | |
95 | LIST_SELECT_ALL = 9, | |
96 | LIST_ABOUT = 102, | |
97 | BUSY_ON = 10, | |
98 | BUSY_OFF = 11, | |
99 | LIST_DELETE_ALL = 12, | |
100 | LIST_SORT, | |
11f26ea0 VZ |
101 | LIST_SET_FG_COL, |
102 | LIST_SET_BG_COL, | |
7b848b0d | 103 | LIST_TOGGLE_MULTI_SEL, |
457814b5 | 104 | |
fa5f6926 VZ |
105 | LIST_CTRL = 1000 |
106 | }; | |
457814b5 | 107 |