1999-01-01 11:05:26 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: checklst.h
|
|
|
|
// Purpose: wxCheckListBox class - a listbox with checkable items
|
|
|
|
// Note: this is an optional class.
|
2003-02-28 16:54:04 -05:00
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
1999-01-01 11:05:26 -05:00
|
|
|
// RCS-ID: $Id$
|
2003-02-28 16:54:04 -05:00
|
|
|
// Copyright: (c) Stefan Csomor
|
1999-01-01 11:05:26 -05:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CHECKLST_H_
|
|
|
|
#define _WX_CHECKLST_H_
|
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1999-01-01 11:05:26 -05:00
|
|
|
#pragma interface "checklst.h"
|
|
|
|
#endif
|
|
|
|
|
2001-02-15 16:51:14 -05:00
|
|
|
#if !defined(__MWERKS__) && !defined(__UNIX__)
|
1999-01-01 11:05:26 -05:00
|
|
|
typedef unsigned int size_t;
|
|
|
|
#endif
|
|
|
|
|
2002-01-20 11:13:05 -05:00
|
|
|
class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase
|
1999-01-01 11:05:26 -05:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
|
|
|
public:
|
|
|
|
// ctors
|
2001-12-31 11:30:54 -05:00
|
|
|
wxCheckListBox() { Init(); }
|
|
|
|
wxCheckListBox(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)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, pos, size, nStrings, choices, style, validator, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
1999-01-01 11:05:26 -05:00
|
|
|
|
|
|
|
// items may be checked
|
|
|
|
bool IsChecked(size_t uiIndex) const;
|
|
|
|
void Check(size_t uiIndex, bool bCheck = TRUE);
|
2001-12-31 11:30:54 -05:00
|
|
|
void OnChar(wxKeyEvent& event) ;
|
|
|
|
void OnLeftClick(wxMouseEvent& event) ;
|
|
|
|
|
2003-02-28 18:36:37 -05:00
|
|
|
// metrics
|
|
|
|
wxInt32 m_checkBoxWidth;
|
2002-04-16 17:04:38 -04:00
|
|
|
wxInt32 m_checkBoxHeight;
|
2003-02-28 18:36:37 -05:00
|
|
|
wxInt32 m_TextBaseLineOffset;
|
|
|
|
|
2001-12-31 11:30:54 -05:00
|
|
|
// the array containing the checked status of the items
|
|
|
|
wxArrayInt m_checks;
|
1999-01-01 11:05:26 -05:00
|
|
|
|
2001-12-31 11:30:54 -05:00
|
|
|
// override all methods which add/delete items to update m_checks array as
|
|
|
|
// well
|
|
|
|
virtual void Delete(int n);
|
|
|
|
protected:
|
|
|
|
virtual int DoAppend(const wxString& item);
|
|
|
|
virtual void DoInsertItems(const wxArrayString& items, int pos);
|
|
|
|
virtual void DoSetItems(const wxArrayString& items, void **clientData);
|
|
|
|
virtual void DoClear();
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
private:
|
1999-01-01 11:05:26 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_CHECKLST_H_
|