2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: checklst.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxCheckListBox
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxCheckListBox
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-04-05 09:12:23 +00:00
|
|
|
A wxCheckListBox is like a wxListBox, but allows items to be checked or
|
|
|
|
unchecked.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
When using this class under Windows wxWidgets must be compiled with
|
2008-04-05 09:12:23 +00:00
|
|
|
wxUSE_OWNER_DRAWN set to 1.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
Only the new functions for this class are documented; see also wxListBox.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
Please note that wxCheckListBox uses client data in its implementation,
|
|
|
|
and therefore this is not available to the application.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-28 16:19:12 +00:00
|
|
|
@beginEventTable{wxCommandEvent}
|
2008-04-06 14:43:04 +00:00
|
|
|
@event{EVT_CHECKLISTBOX(id, func)}
|
2008-03-08 13:52:38 +00:00
|
|
|
Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in
|
|
|
|
the check list box is checked or unchecked.
|
|
|
|
@endEventTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2008-10-13 08:05:18 +00:00
|
|
|
@appearance{checklistbox.png}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxCheckListBox : public wxListBox
|
|
|
|
{
|
|
|
|
public:
|
2008-04-05 09:12:23 +00:00
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxCheckListBox();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Constructor, creating and showing a list box.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window. Must not be @NULL.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
Window identifier. The value wxID_ANY indicates a default value.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
Window position.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-04-05 09:12:23 +00:00
|
|
|
Window size. If wxDefaultSize is specified then the window is sized
|
2008-03-09 12:33:59 +00:00
|
|
|
appropriately.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param n
|
2008-03-09 12:33:59 +00:00
|
|
|
Number of strings with which to initialise the control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param choices
|
2008-03-09 12:33:59 +00:00
|
|
|
An array of strings with which to initialise the control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
Window style. See wxCheckListBox.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param validator
|
2008-03-09 12:33:59 +00:00
|
|
|
Window validator.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
Window name.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
wxCheckListBox(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2008-08-30 12:44:43 +00:00
|
|
|
int n = 0,
|
2008-03-09 12:33:59 +00:00
|
|
|
const wxString choices[] = NULL,
|
2008-03-08 14:43:31 +00:00
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = "listBox");
|
2008-08-30 12:44:43 +00: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 14:43:31 +00: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 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor, destroying the list box.
|
|
|
|
*/
|
2008-09-22 18:21:32 +00:00
|
|
|
virtual ~wxCheckListBox();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-04-05 09:12:23 +00: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 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param item
|
2008-03-09 12:33:59 +00:00
|
|
|
Index of item to check.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param check
|
2008-03-09 12:33:59 +00:00
|
|
|
@true if the item is to be checked, @false otherwise.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-22 18:21:32 +00:00
|
|
|
void Check(unsigned int item, bool check = true);
|
2008-04-05 09:12:23 +00: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 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|