]>
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); | |
37 | void OnGetInfo(wxListEvent& event); | |
38 | void OnSetInfo(wxListEvent& event); | |
39 | void OnSelected(wxListEvent& event); | |
40 | void OnDeselected(wxListEvent& event); | |
41 | void OnListKeyDown(wxListEvent& event); | |
42 | void OnActivated(wxListEvent& event); | |
457814b5 | 43 | |
88ac883a VZ |
44 | void OnChar(wxKeyEvent& event); |
45 | ||
5ea47806 | 46 | DECLARE_EVENT_TABLE() |
457814b5 JS |
47 | }; |
48 | ||
49 | // Define a new frame type | |
50 | class MyFrame: public wxFrame | |
5ea47806 VZ |
51 | { |
52 | public: | |
457814b5 JS |
53 | MyListCtrl *m_listCtrl; |
54 | wxTextCtrl *m_logWindow; | |
55 | ||
56 | MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h); | |
5ea47806 VZ |
57 | ~MyFrame(); |
58 | ||
59 | public: | |
457814b5 JS |
60 | void OnQuit(wxCommandEvent& event); |
61 | void OnAbout(wxCommandEvent& event); | |
62 | void OnListView(wxCommandEvent& event); | |
63 | void OnReportView(wxCommandEvent& event); | |
64 | void OnIconView(wxCommandEvent& event); | |
65 | void OnIconTextView(wxCommandEvent& event); | |
66 | void OnSmallIconView(wxCommandEvent& event); | |
67 | void OnSmallIconTextView(wxCommandEvent& event); | |
c4771147 KB |
68 | void OnDeselectAll(wxCommandEvent& event); |
69 | void OnSelectAll(wxCommandEvent& event); | |
5ea47806 | 70 | void OnDeleteAll(wxCommandEvent& event); |
fa5f6926 | 71 | void OnSort(wxCommandEvent& event); |
5ea47806 | 72 | |
57246713 KB |
73 | void BusyOn(wxCommandEvent& event); |
74 | void BusyOff(wxCommandEvent& event); | |
5ea47806 VZ |
75 | |
76 | DECLARE_EVENT_TABLE() | |
457814b5 JS |
77 | }; |
78 | ||
79 | ||
80 | // ID for the menu quit command | |
fa5f6926 VZ |
81 | enum |
82 | { | |
83 | LIST_QUIT = 1, | |
84 | LIST_LIST_VIEW = 2, | |
85 | LIST_ICON_VIEW = 3, | |
86 | LIST_ICON_TEXT_VIEW = 4, | |
87 | LIST_SMALL_ICON_VIEW = 5, | |
88 | LIST_SMALL_ICON_TEXT_VIEW = 6, | |
89 | LIST_REPORT_VIEW = 7, | |
90 | LIST_DESELECT_ALL = 8, | |
91 | LIST_SELECT_ALL = 9, | |
92 | LIST_ABOUT = 102, | |
93 | BUSY_ON = 10, | |
94 | BUSY_OFF = 11, | |
95 | LIST_DELETE_ALL = 12, | |
96 | LIST_SORT, | |
457814b5 | 97 | |
fa5f6926 VZ |
98 | LIST_CTRL = 1000 |
99 | }; | |
457814b5 | 100 |