2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: checklst.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxCheckListBox
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxCheckListBox
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-05 05:12:23 -04:00
|
|
|
A wxCheckListBox is like a wxListBox, but allows items to be checked or
|
|
|
|
unchecked.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
When using this class under Windows wxWidgets must be compiled with
|
2008-04-05 05:12:23 -04:00
|
|
|
wxUSE_OWNER_DRAWN set to 1.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2009-02-18 12:58:51 -05:00
|
|
|
@beginEventEmissionTable{wxCommandEvent}
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_CHECKLISTBOX(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_CHECKLISTBOX event, when an item in
|
2009-02-18 12:58:51 -05:00
|
|
|
the check list box is checked or unchecked. wxCommandEvent::GetInt()
|
|
|
|
will contain the index of the item that was checked or unchecked.
|
|
|
|
wxCommandEvent::IsChecked() is not valid! Use wxCheckListBox::IsChecked()
|
|
|
|
instead.
|
2008-03-08 08:52:38 -05:00
|
|
|
@endEventTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2012-11-03 14:32:50 -04:00
|
|
|
@appearance{checklistbox}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxCheckListBox : public wxListBox
|
|
|
|
{
|
|
|
|
public:
|
2008-04-05 05:12:23 -04:00
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxCheckListBox();
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Constructor, creating and showing a list box.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Parent window. Must not be @NULL.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Window identifier. The value wxID_ANY indicates a default value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Window position.
|
2009-04-21 07:21:36 -04:00
|
|
|
If ::wxDefaultPosition is specified then a default position is chosen.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2019-01-30 11:28:08 -05:00
|
|
|
Window size.
|
2009-04-21 07:21:36 -04:00
|
|
|
If ::wxDefaultSize is specified then the window is sized appropriately.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param n
|
2008-03-09 08:33:59 -04:00
|
|
|
Number of strings with which to initialise the control.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param choices
|
2008-03-09 08:33:59 -04:00
|
|
|
An array of strings with which to initialise the control.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style. See wxCheckListBox.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param validator
|
2008-03-09 08:33:59 -04:00
|
|
|
Window validator.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2009-10-18 13:47:01 -04:00
|
|
|
|
|
|
|
@beginWxPerlOnly
|
|
|
|
Not supported by wxPerl.
|
|
|
|
@endWxPerlOnly
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxCheckListBox(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-08-30 08:44:43 -04:00
|
|
|
int n = 0,
|
2008-03-09 08:33:59 -04:00
|
|
|
const wxString choices[] = NULL,
|
2008-03-08 09:43:31 -05:00
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = "listBox");
|
2008-08-30 08:44:43 -04:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a list box.
|
|
|
|
|
|
|
|
@param parent
|
|
|
|
Parent window. Must not be @NULL.
|
|
|
|
@param id
|
|
|
|
Window identifier. The value wxID_ANY indicates a default value.
|
|
|
|
@param pos
|
|
|
|
Window position.
|
|
|
|
@param size
|
|
|
|
Window size. If wxDefaultSize is specified then the window is sized
|
|
|
|
appropriately.
|
|
|
|
@param choices
|
|
|
|
An array of strings with which to initialise the control.
|
|
|
|
@param style
|
|
|
|
Window style. See wxCheckListBox.
|
|
|
|
@param validator
|
|
|
|
Window validator.
|
|
|
|
@param name
|
|
|
|
Window name.
|
2009-10-18 13:47:01 -04:00
|
|
|
|
|
|
|
@beginWxPerlOnly
|
|
|
|
Use an array reference for the @a choices parameter.
|
|
|
|
@endWxPerlOnly
|
2008-08-30 08:44:43 -04:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxCheckListBox(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = "listBox");
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
2011-09-16 13:03:01 -04:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
int nStrings = 0,
|
|
|
|
const wxString choices[] = NULL,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxListBoxNameStr);
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
const wxArrayString& choices,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxListBoxNameStr);
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Destructor, destroying the list box.
|
|
|
|
*/
|
2008-09-22 14:21:32 -04:00
|
|
|
virtual ~wxCheckListBox();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-04-05 05:12:23 -04:00
|
|
|
Checks the given item. Note that calling this method does not result in
|
2013-04-25 06:11:03 -04:00
|
|
|
a @c wxEVT_CHECKLISTBOX event being emitted.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param item
|
2008-03-09 08:33:59 -04:00
|
|
|
Index of item to check.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param check
|
2008-03-09 08:33:59 -04:00
|
|
|
@true if the item is to be checked, @false otherwise.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-22 14:21:32 -04:00
|
|
|
void Check(unsigned int item, bool check = true);
|
2008-04-05 05:12:23 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the given item is checked, @false otherwise.
|
|
|
|
|
|
|
|
@param item
|
|
|
|
Index of item whose check status is to be returned.
|
|
|
|
*/
|
|
|
|
bool IsChecked(unsigned int item) const;
|
2013-01-21 06:18:55 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Return the indices of the checked items.
|
|
|
|
|
|
|
|
@param checkedItems
|
|
|
|
A reference to the array that is filled with the indices of the
|
|
|
|
checked items.
|
|
|
|
@return The number of checked items.
|
|
|
|
|
|
|
|
@see Check(), IsChecked()
|
|
|
|
|
|
|
|
@since 2.9.5
|
|
|
|
*/
|
|
|
|
unsigned int GetCheckedItems(wxArrayInt& checkedItems) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|