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