]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: checklst.h | |
e54c96f1 | 3 | // Purpose: interface of wxCheckListBox |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxCheckListBox | |
7c913512 | 11 | |
bfac6166 BP |
12 | A wxCheckListBox is like a wxListBox, but allows items to be checked or |
13 | unchecked. | |
7c913512 | 14 | |
23324ae1 | 15 | When using this class under Windows wxWidgets must be compiled with |
bfac6166 | 16 | wxUSE_OWNER_DRAWN set to 1. |
7c913512 | 17 | |
23324ae1 | 18 | Only the new functions for this class are documented; see also wxListBox. |
7c913512 | 19 | |
23324ae1 FM |
20 | Please note that wxCheckListBox uses client data in its implementation, |
21 | and therefore this is not available to the application. | |
7c913512 | 22 | |
1f1d2182 | 23 | @beginEventTable{wxCommandEvent} |
8c6791e4 | 24 | @event{EVT_CHECKLISTBOX(id, func)} |
23324ae1 FM |
25 | Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in |
26 | the check list box is checked or unchecked. | |
27 | @endEventTable | |
7c913512 | 28 | |
23324ae1 FM |
29 | @library{wxcore} |
30 | @category{ctrl} | |
bfac6166 | 31 | <!-- @appearance{checklistbox.png} --> |
7c913512 | 32 | |
e54c96f1 | 33 | @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent |
23324ae1 FM |
34 | */ |
35 | class wxCheckListBox : public wxListBox | |
36 | { | |
37 | public: | |
bfac6166 BP |
38 | /** |
39 | Default constructor. | |
40 | */ | |
41 | wxCheckListBox(); | |
42 | ||
23324ae1 FM |
43 | //@{ |
44 | /** | |
45 | Constructor, creating and showing a list box. | |
3c4f71cc | 46 | |
7c913512 | 47 | @param parent |
4cc4bfaf | 48 | Parent window. Must not be @NULL. |
7c913512 | 49 | @param id |
4cc4bfaf | 50 | Window identifier. The value wxID_ANY indicates a default value. |
7c913512 | 51 | @param pos |
4cc4bfaf | 52 | Window position. |
7c913512 | 53 | @param size |
bfac6166 | 54 | Window size. If wxDefaultSize is specified then the window is sized |
4cc4bfaf | 55 | appropriately. |
7c913512 | 56 | @param n |
4cc4bfaf | 57 | Number of strings with which to initialise the control. |
7c913512 | 58 | @param choices |
4cc4bfaf | 59 | An array of strings with which to initialise the control. |
7c913512 | 60 | @param style |
4cc4bfaf | 61 | Window style. See wxCheckListBox. |
7c913512 | 62 | @param validator |
4cc4bfaf | 63 | Window validator. |
7c913512 | 64 | @param name |
4cc4bfaf | 65 | Window name. |
23324ae1 | 66 | */ |
7c913512 FM |
67 | wxCheckListBox(wxWindow* parent, wxWindowID id, |
68 | const wxPoint& pos = wxDefaultPosition, | |
69 | const wxSize& size = wxDefaultSize, | |
792255cc | 70 | int n = 0, |
4cc4bfaf | 71 | const wxString choices[] = NULL, |
7c913512 FM |
72 | long style = 0, |
73 | const wxValidator& validator = wxDefaultValidator, | |
74 | const wxString& name = "listBox"); | |
792255cc VZ |
75 | /** |
76 | Constructor, creating and showing a list box. | |
77 | ||
78 | @param parent | |
79 | Parent window. Must not be @NULL. | |
80 | @param id | |
81 | Window identifier. The value wxID_ANY indicates a default value. | |
82 | @param pos | |
83 | Window position. | |
84 | @param size | |
85 | Window size. If wxDefaultSize is specified then the window is sized | |
86 | appropriately. | |
87 | @param choices | |
88 | An array of strings with which to initialise the control. | |
89 | @param style | |
90 | Window style. See wxCheckListBox. | |
91 | @param validator | |
92 | Window validator. | |
93 | @param name | |
94 | Window name. | |
95 | */ | |
7c913512 FM |
96 | wxCheckListBox(wxWindow* parent, wxWindowID id, |
97 | const wxPoint& pos, | |
98 | const wxSize& size, | |
99 | const wxArrayString& choices, | |
100 | long style = 0, | |
101 | const wxValidator& validator = wxDefaultValidator, | |
102 | const wxString& name = "listBox"); | |
23324ae1 FM |
103 | //@} |
104 | ||
105 | /** | |
106 | Destructor, destroying the list box. | |
107 | */ | |
62a7da75 | 108 | virtual ~wxCheckListBox(); |
23324ae1 FM |
109 | |
110 | /** | |
bfac6166 BP |
111 | Checks the given item. Note that calling this method does not result in |
112 | a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted. | |
3c4f71cc | 113 | |
7c913512 | 114 | @param item |
4cc4bfaf | 115 | Index of item to check. |
7c913512 | 116 | @param check |
4cc4bfaf | 117 | @true if the item is to be checked, @false otherwise. |
23324ae1 | 118 | */ |
62a7da75 | 119 | void Check(unsigned int item, bool check = true); |
bfac6166 BP |
120 | |
121 | /** | |
122 | Returns @true if the given item is checked, @false otherwise. | |
123 | ||
124 | @param item | |
125 | Index of item whose check status is to be returned. | |
126 | */ | |
127 | bool IsChecked(unsigned int item) const; | |
23324ae1 | 128 | }; |
e54c96f1 | 129 |