]>
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 | |
11 | @wxheader{checklst.h} | |
7c913512 | 12 | |
23324ae1 | 13 | A checklistbox is like a listbox, but allows items to be checked or unchecked. |
7c913512 | 14 | |
23324ae1 FM |
15 | When using this class under Windows wxWidgets must be compiled with |
16 | USE_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 | |
23324ae1 | 23 | @beginEventTable |
4cc4bfaf | 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} | |
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: | |
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 |
4cc4bfaf FM |
49 | Window size. If wxDefaultSize is specified then the window is |
50 | sized | |
51 | appropriately. | |
7c913512 | 52 | @param n |
4cc4bfaf | 53 | Number of strings with which to initialise the control. |
7c913512 | 54 | @param choices |
4cc4bfaf | 55 | An array of strings with which to initialise the control. |
7c913512 | 56 | @param style |
4cc4bfaf | 57 | Window style. See wxCheckListBox. |
7c913512 | 58 | @param validator |
4cc4bfaf | 59 | Window validator. |
7c913512 | 60 | @param name |
4cc4bfaf | 61 | Window name. |
23324ae1 FM |
62 | */ |
63 | wxCheckListBox(); | |
7c913512 FM |
64 | wxCheckListBox(wxWindow* parent, wxWindowID id, |
65 | const wxPoint& pos = wxDefaultPosition, | |
66 | const wxSize& size = wxDefaultSize, | |
67 | int n, | |
4cc4bfaf | 68 | const wxString choices[] = NULL, |
7c913512 FM |
69 | long style = 0, |
70 | const wxValidator& validator = wxDefaultValidator, | |
71 | const wxString& name = "listBox"); | |
72 | wxCheckListBox(wxWindow* parent, wxWindowID id, | |
73 | const wxPoint& pos, | |
74 | const wxSize& size, | |
75 | const wxArrayString& choices, | |
76 | long style = 0, | |
77 | const wxValidator& validator = wxDefaultValidator, | |
78 | const wxString& name = "listBox"); | |
23324ae1 FM |
79 | //@} |
80 | ||
81 | /** | |
82 | Destructor, destroying the list box. | |
83 | */ | |
84 | ~wxCheckListBox(); | |
85 | ||
86 | /** | |
87 | Checks the given item. Note that calling this method doesn't result in | |
88 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLE being emitted. | |
3c4f71cc | 89 | |
7c913512 | 90 | @param item |
4cc4bfaf | 91 | Index of item to check. |
7c913512 | 92 | @param check |
4cc4bfaf | 93 | @true if the item is to be checked, @false otherwise. |
23324ae1 | 94 | */ |
4cc4bfaf | 95 | void Check(int item, bool check = true); |
23324ae1 | 96 | }; |
e54c96f1 | 97 |