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
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@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
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Only the new functions for this class are documented; see also wxListBox.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Please note that wxCheckListBox uses client data in its implementation,
|
|
|
|
and therefore this is not available to the application.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-28 12:19:12 -04:00
|
|
|
@beginEventTable{wxCommandEvent}
|
2008-04-06 10:43:04 -04:00
|
|
|
@event{EVT_CHECKLISTBOX(id, func)}
|
2008-03-08 08:52:38 -05:00
|
|
|
Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in
|
|
|
|
the check list box is checked or unchecked.
|
|
|
|
@endEventTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2008-04-05 05:12:23 -04:00
|
|
|
<!-- @appearance{checklistbox.png} -->
|
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.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-04-05 05:12:23 -04:00
|
|
|
Window size. If wxDefaultSize is specified then the window is sized
|
2008-03-09 08:33:59 -04:00
|
|
|
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.
|
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.
|
|
|
|
*/
|
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
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor, destroying the list box.
|
|
|
|
*/
|
|
|
|
~wxCheckListBox();
|
|
|
|
|
|
|
|
/**
|
2008-04-05 05:12:23 -04:00
|
|
|
Checks the given item. Note that calling this method does not result in
|
|
|
|
a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE 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-03-09 08:33:59 -04:00
|
|
|
void Check(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;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|