]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/checklst.h
use CLSCTX_ALL instead of CLSCTX_LOCAL_SERVER in CreateInstance() (#9868)
[wxWidgets.git] / interface / wx / 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
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
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
1f1d2182 23 @beginEventTable{wxCommandEvent}
8c6791e4 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}
bfac6166 31 <!-- @appearance{checklistbox.png} -->
7c913512 32
e54c96f1 33 @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
23324ae1
FM
34*/
35class wxCheckListBox : public wxListBox
36{
37public:
bfac6166
BP
38 /**
39 Default constructor.
40 */
41 wxCheckListBox();
42
23324ae1
FM
43 //@{
44 /**
45 Constructor, creating and showing a list box.
3c4f71cc 46
7c913512 47 @param parent
4cc4bfaf 48 Parent window. Must not be @NULL.
7c913512 49 @param id
4cc4bfaf 50 Window identifier. The value wxID_ANY indicates a default value.
7c913512 51 @param pos
4cc4bfaf 52 Window position.
7c913512 53 @param size
bfac6166 54 Window size. If wxDefaultSize is specified then the window is sized
4cc4bfaf 55 appropriately.
7c913512 56 @param n
4cc4bfaf 57 Number of strings with which to initialise the control.
7c913512 58 @param choices
4cc4bfaf 59 An array of strings with which to initialise the control.
7c913512 60 @param style
4cc4bfaf 61 Window style. See wxCheckListBox.
7c913512 62 @param validator
4cc4bfaf 63 Window validator.
7c913512 64 @param name
4cc4bfaf 65 Window name.
23324ae1 66 */
7c913512
FM
67 wxCheckListBox(wxWindow* parent, wxWindowID id,
68 const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize,
70 int n,
4cc4bfaf 71 const wxString choices[] = NULL,
7c913512
FM
72 long style = 0,
73 const wxValidator& validator = wxDefaultValidator,
74 const wxString& name = "listBox");
75 wxCheckListBox(wxWindow* parent, wxWindowID id,
76 const wxPoint& pos,
77 const wxSize& size,
78 const wxArrayString& choices,
79 long style = 0,
80 const wxValidator& validator = wxDefaultValidator,
81 const wxString& name = "listBox");
23324ae1
FM
82 //@}
83
84 /**
85 Destructor, destroying the list box.
86 */
87 ~wxCheckListBox();
88
89 /**
bfac6166
BP
90 Checks the given item. Note that calling this method does not result in
91 a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted.
3c4f71cc 92
7c913512 93 @param item
4cc4bfaf 94 Index of item to check.
7c913512 95 @param check
4cc4bfaf 96 @true if the item is to be checked, @false otherwise.
23324ae1 97 */
4cc4bfaf 98 void Check(int item, bool check = true);
bfac6166
BP
99
100 /**
101 Returns @true if the given item is checked, @false otherwise.
102
103 @param item
104 Index of item whose check status is to be returned.
105 */
106 bool IsChecked(unsigned int item) const;
23324ae1 107};
e54c96f1 108