]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/checklst.h
add overloads of ctors and Create() functions taking wxSize; document the various...
[wxWidgets.git] / interface / wx / checklst.h
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
12 A wxCheckListBox is like a wxListBox, but allows items to be checked or
13 unchecked.
14
15 When using this class under Windows wxWidgets must be compiled with
16 wxUSE_OWNER_DRAWN set to 1.
17
18 @beginEventEmissionTable{wxCommandEvent}
19 @event{EVT_CHECKLISTBOX(id, func)}
20 Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in
21 the check list box is checked or unchecked. wxCommandEvent::GetInt()
22 will contain the index of the item that was checked or unchecked.
23 wxCommandEvent::IsChecked() is not valid! Use wxCheckListBox::IsChecked()
24 instead.
25 @endEventTable
26
27 @library{wxcore}
28 @category{ctrl}
29 @appearance{checklistbox.png}
30
31 @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
32 */
33 class wxCheckListBox : public wxListBox
34 {
35 public:
36 /**
37 Default constructor.
38 */
39 wxCheckListBox();
40
41 //@{
42 /**
43 Constructor, creating and showing a list box.
44
45 @param parent
46 Parent window. Must not be @NULL.
47 @param id
48 Window identifier. The value wxID_ANY indicates a default value.
49 @param pos
50 Window position.
51 @param size
52 Window size. If wxDefaultSize is specified then the window is sized
53 appropriately.
54 @param n
55 Number of strings with which to initialise the control.
56 @param choices
57 An array of strings with which to initialise the control.
58 @param style
59 Window style. See wxCheckListBox.
60 @param validator
61 Window validator.
62 @param name
63 Window name.
64 */
65 wxCheckListBox(wxWindow* parent, wxWindowID id,
66 const wxPoint& pos = wxDefaultPosition,
67 const wxSize& size = wxDefaultSize,
68 int n = 0,
69 const wxString choices[] = NULL,
70 long style = 0,
71 const wxValidator& validator = wxDefaultValidator,
72 const wxString& name = "listBox");
73 /**
74 Constructor, creating and showing a list box.
75
76 @param parent
77 Parent window. Must not be @NULL.
78 @param id
79 Window identifier. The value wxID_ANY indicates a default value.
80 @param pos
81 Window position.
82 @param size
83 Window size. If wxDefaultSize is specified then the window is sized
84 appropriately.
85 @param choices
86 An array of strings with which to initialise the control.
87 @param style
88 Window style. See wxCheckListBox.
89 @param validator
90 Window validator.
91 @param name
92 Window name.
93 */
94 wxCheckListBox(wxWindow* parent, wxWindowID id,
95 const wxPoint& pos,
96 const wxSize& size,
97 const wxArrayString& choices,
98 long style = 0,
99 const wxValidator& validator = wxDefaultValidator,
100 const wxString& name = "listBox");
101 //@}
102
103 /**
104 Destructor, destroying the list box.
105 */
106 virtual ~wxCheckListBox();
107
108 /**
109 Checks the given item. Note that calling this method does not result in
110 a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted.
111
112 @param item
113 Index of item to check.
114 @param check
115 @true if the item is to be checked, @false otherwise.
116 */
117 void Check(unsigned int item, bool check = true);
118
119 /**
120 Returns @true if the given item is checked, @false otherwise.
121
122 @param item
123 Index of item whose check status is to be returned.
124 */
125 bool IsChecked(unsigned int item) const;
126 };
127