]> git.saurik.com Git - wxWidgets.git/blame - interface/checklst.h
add handling of wxWrapSizer flags (part of ticket 9468)
[wxWidgets.git] / interface / checklst.h
CommitLineData
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
bfac6166
BP
13 A wxCheckListBox is like a wxListBox, but allows items to be checked or
14 unchecked.
7c913512 15
23324ae1 16 When using this class under Windows wxWidgets must be compiled with
bfac6166 17 wxUSE_OWNER_DRAWN set to 1.
7c913512 18
23324ae1 19 Only the new functions for this class are documented; see also wxListBox.
7c913512 20
23324ae1
FM
21 Please note that wxCheckListBox uses client data in its implementation,
22 and therefore this is not available to the application.
7c913512 23
1f1d2182 24 @beginEventTable{wxCommandEvent}
8c6791e4 25 @event{EVT_CHECKLISTBOX(id, func)}
23324ae1
FM
26 Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in
27 the check list box is checked or unchecked.
28 @endEventTable
7c913512 29
23324ae1
FM
30 @library{wxcore}
31 @category{ctrl}
bfac6166 32 <!-- @appearance{checklistbox.png} -->
7c913512 33
e54c96f1 34 @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
23324ae1
FM
35*/
36class wxCheckListBox : public wxListBox
37{
38public:
bfac6166
BP
39 /**
40 Default constructor.
41 */
42 wxCheckListBox();
43
23324ae1
FM
44 //@{
45 /**
46 Constructor, creating and showing a list box.
3c4f71cc 47
7c913512 48 @param parent
4cc4bfaf 49 Parent window. Must not be @NULL.
7c913512 50 @param id
4cc4bfaf 51 Window identifier. The value wxID_ANY indicates a default value.
7c913512 52 @param pos
4cc4bfaf 53 Window position.
7c913512 54 @param size
bfac6166 55 Window size. If wxDefaultSize is specified then the window is sized
4cc4bfaf 56 appropriately.
7c913512 57 @param n
4cc4bfaf 58 Number of strings with which to initialise the control.
7c913512 59 @param choices
4cc4bfaf 60 An array of strings with which to initialise the control.
7c913512 61 @param style
4cc4bfaf 62 Window style. See wxCheckListBox.
7c913512 63 @param validator
4cc4bfaf 64 Window validator.
7c913512 65 @param name
4cc4bfaf 66 Window name.
23324ae1 67 */
7c913512
FM
68 wxCheckListBox(wxWindow* parent, wxWindowID id,
69 const wxPoint& pos = wxDefaultPosition,
70 const wxSize& size = wxDefaultSize,
71 int n,
4cc4bfaf 72 const wxString choices[] = NULL,
7c913512
FM
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");
23324ae1
FM
83 //@}
84
85 /**
86 Destructor, destroying the list box.
87 */
88 ~wxCheckListBox();
89
90 /**
bfac6166
BP
91 Checks the given item. Note that calling this method does not result in
92 a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted.
3c4f71cc 93
7c913512 94 @param item
4cc4bfaf 95 Index of item to check.
7c913512 96 @param check
4cc4bfaf 97 @true if the item is to be checked, @false otherwise.
23324ae1 98 */
4cc4bfaf 99 void Check(int item, bool check = true);
bfac6166
BP
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;
23324ae1 108};
e54c96f1 109