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