]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/checklst.h
applied patch 890642: wxRE_ADVANCED flag and docs
[wxWidgets.git] / include / wx / mac / checklst.h
CommitLineData
0dbd6262
SC
1///////////////////////////////////////////////////////////////////////////////
2// Name: checklst.h
3// Purpose: wxCheckListBox class - a listbox with checkable items
4// Note: this is an optional class.
a31a5f85
JS
5// Author: Stefan Csomor
6// Modified by:
7// Created: 1998-01-01
0dbd6262 8// RCS-ID: $Id$
a31a5f85 9// Copyright: (c) Stefan Csomor
0dbd6262
SC
10// Licence: wxWindows licence
11///////////////////////////////////////////////////////////////////////////////
12
13#ifndef _WX_CHECKLST_H_
14#define _WX_CHECKLST_H_
15
12028905 16#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
0dbd6262
SC
17#pragma interface "checklst.h"
18#endif
19
03e11df5 20#if !defined(__MWERKS__) && !defined(__UNIX__)
0dbd6262
SC
21typedef unsigned int size_t;
22#endif
23
dde587d9 24class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase
0dbd6262
SC
25{
26 DECLARE_DYNAMIC_CLASS(wxCheckListBox)
27public:
28 // ctors
f5705626
SC
29 wxCheckListBox() { Init(); }
30 wxCheckListBox(wxWindow *parent,
31 wxWindowID id,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 int nStrings = 0,
35 const wxString *choices = NULL,
36 long style = 0,
37 const wxValidator& validator = wxDefaultValidator,
38 const wxString& name = wxListBoxNameStr)
39 {
40 Init();
41
42 Create(parent, id, pos, size, nStrings, choices, style, validator, name);
43 }
584ad2a3
MB
44 wxCheckListBox(wxWindow *parent,
45 wxWindowID id,
46 const wxPoint& pos,
47 const wxSize& size,
48 const wxArrayString& choices,
49 long style = 0,
50 const wxValidator& validator = wxDefaultValidator,
51 const wxString& name = wxListBoxNameStr)
52 {
53 Init();
54
55 Create(parent, id, pos, size, choices, style, validator, name);
56 }
f5705626
SC
57
58 bool Create(wxWindow *parent,
59 wxWindowID id,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 int nStrings = 0,
63 const wxString *choices = NULL,
584ad2a3
MB
64 long style = 0,
65 const wxValidator& validator = wxDefaultValidator,
66 const wxString& name = wxListBoxNameStr);
67 bool Create(wxWindow *parent,
68 wxWindowID id,
69 const wxPoint& pos,
70 const wxSize& size,
71 const wxArrayString& choices,
f5705626
SC
72 long style = 0,
73 const wxValidator& validator = wxDefaultValidator,
74 const wxString& name = wxListBoxNameStr);
0dbd6262
SC
75
76 // items may be checked
77 bool IsChecked(size_t uiIndex) const;
78 void Check(size_t uiIndex, bool bCheck = TRUE);
f5705626
SC
79 void OnChar(wxKeyEvent& event) ;
80 void OnLeftClick(wxMouseEvent& event) ;
81
d921af51
JS
82 // metrics
83 wxInt32 m_checkBoxWidth;
50b30d83 84 wxInt32 m_checkBoxHeight;
d921af51
JS
85 wxInt32 m_TextBaseLineOffset;
86
f5705626
SC
87 // the array containing the checked status of the items
88 wxArrayInt m_checks;
0dbd6262 89
f5705626
SC
90 // override all methods which add/delete items to update m_checks array as
91 // well
92 virtual void Delete(int n);
93protected:
94 virtual int DoAppend(const wxString& item);
95 virtual void DoInsertItems(const wxArrayString& items, int pos);
96 virtual void DoSetItems(const wxArrayString& items, void **clientData);
97 virtual void DoClear();
98 // common part of all ctors
99 void Init();
100private:
0dbd6262
SC
101 DECLARE_EVENT_TABLE()
102};
103
104#endif
105 // _WX_CHECKLST_H_