]>
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 | |
1f1d2182 | 18 | @beginEventTable{wxCommandEvent} |
8c6791e4 | 19 | @event{EVT_CHECKLISTBOX(id, func)} |
23324ae1 FM |
20 | Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in |
21 | the check list box is checked or unchecked. | |
22 | @endEventTable | |
7c913512 | 23 | |
23324ae1 FM |
24 | @library{wxcore} |
25 | @category{ctrl} | |
7e59b885 | 26 | @appearance{checklistbox.png} |
7c913512 | 27 | |
e54c96f1 | 28 | @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent |
23324ae1 FM |
29 | */ |
30 | class wxCheckListBox : public wxListBox | |
31 | { | |
32 | public: | |
bfac6166 BP |
33 | /** |
34 | Default constructor. | |
35 | */ | |
36 | wxCheckListBox(); | |
37 | ||
23324ae1 FM |
38 | //@{ |
39 | /** | |
40 | Constructor, creating and showing a list box. | |
3c4f71cc | 41 | |
7c913512 | 42 | @param parent |
4cc4bfaf | 43 | Parent window. Must not be @NULL. |
7c913512 | 44 | @param id |
4cc4bfaf | 45 | Window identifier. The value wxID_ANY indicates a default value. |
7c913512 | 46 | @param pos |
4cc4bfaf | 47 | Window position. |
7c913512 | 48 | @param size |
bfac6166 | 49 | Window size. If wxDefaultSize is specified then the window is sized |
4cc4bfaf | 50 | appropriately. |
7c913512 | 51 | @param n |
4cc4bfaf | 52 | Number of strings with which to initialise the control. |
7c913512 | 53 | @param choices |
4cc4bfaf | 54 | An array of strings with which to initialise the control. |
7c913512 | 55 | @param style |
4cc4bfaf | 56 | Window style. See wxCheckListBox. |
7c913512 | 57 | @param validator |
4cc4bfaf | 58 | Window validator. |
7c913512 | 59 | @param name |
4cc4bfaf | 60 | Window name. |
23324ae1 | 61 | */ |
7c913512 FM |
62 | wxCheckListBox(wxWindow* parent, wxWindowID id, |
63 | const wxPoint& pos = wxDefaultPosition, | |
64 | const wxSize& size = wxDefaultSize, | |
792255cc | 65 | int n = 0, |
4cc4bfaf | 66 | const wxString choices[] = NULL, |
7c913512 FM |
67 | long style = 0, |
68 | const wxValidator& validator = wxDefaultValidator, | |
69 | const wxString& name = "listBox"); | |
792255cc VZ |
70 | /** |
71 | Constructor, creating and showing a list box. | |
72 | ||
73 | @param parent | |
74 | Parent window. Must not be @NULL. | |
75 | @param id | |
76 | Window identifier. The value wxID_ANY indicates a default value. | |
77 | @param pos | |
78 | Window position. | |
79 | @param size | |
80 | Window size. If wxDefaultSize is specified then the window is sized | |
81 | appropriately. | |
82 | @param choices | |
83 | An array of strings with which to initialise the control. | |
84 | @param style | |
85 | Window style. See wxCheckListBox. | |
86 | @param validator | |
87 | Window validator. | |
88 | @param name | |
89 | Window name. | |
90 | */ | |
7c913512 FM |
91 | wxCheckListBox(wxWindow* parent, wxWindowID id, |
92 | const wxPoint& pos, | |
93 | const wxSize& size, | |
94 | const wxArrayString& choices, | |
95 | long style = 0, | |
96 | const wxValidator& validator = wxDefaultValidator, | |
97 | const wxString& name = "listBox"); | |
23324ae1 FM |
98 | //@} |
99 | ||
100 | /** | |
101 | Destructor, destroying the list box. | |
102 | */ | |
62a7da75 | 103 | virtual ~wxCheckListBox(); |
23324ae1 FM |
104 | |
105 | /** | |
bfac6166 BP |
106 | Checks the given item. Note that calling this method does not result in |
107 | a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted. | |
3c4f71cc | 108 | |
7c913512 | 109 | @param item |
4cc4bfaf | 110 | Index of item to check. |
7c913512 | 111 | @param check |
4cc4bfaf | 112 | @true if the item is to be checked, @false otherwise. |
23324ae1 | 113 | */ |
62a7da75 | 114 | void Check(unsigned int item, bool check = true); |
bfac6166 BP |
115 | |
116 | /** | |
117 | Returns @true if the given item is checked, @false otherwise. | |
118 | ||
119 | @param item | |
120 | Index of item whose check status is to be returned. | |
121 | */ | |
122 | bool IsChecked(unsigned int item) const; | |
23324ae1 | 123 | }; |
e54c96f1 | 124 |