]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | /////////////////////////////////////////////////////////////////////////////// |
84882850 | 2 | // Name: wx/os2/checklst.h |
0e320a79 DW |
3 | // Purpose: wxCheckListBox class - a listbox with checkable items |
4 | // Note: this is an optional class. | |
37f214d5 | 5 | // Author: David Webster |
a419c3b1 | 6 | // Modified by: |
37f214d5 | 7 | // Created: 10/13/99 |
0e320a79 | 8 | // RCS-ID: $Id$ |
37f214d5 | 9 | // Copyright: (c) David Webster |
65571936 | 10 | // Licence: wxWindows licence |
0e320a79 DW |
11 | /////////////////////////////////////////////////////////////////////////////// |
12 | ||
13 | #ifndef _WX_CHECKLST_H_ | |
14 | #define _WX_CHECKLST_H_ | |
15 | ||
37f214d5 | 16 | #include <stddef.h> |
0e320a79 | 17 | |
84882850 | 18 | #include "wx/defs.h" |
0e320a79 | 19 | |
1de4baa3 | 20 | class wxOwnerDrawn; // so the compiler knows, it is a class. |
023d13a6 | 21 | |
84882850 | 22 | class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase |
0e320a79 | 23 | { |
0e320a79 | 24 | public: |
f5ea767e | 25 | // |
1de4baa3 DW |
26 | // Ctors |
27 | // | |
28 | wxCheckListBox(); | |
29 | wxCheckListBox( wxWindow* pParent | |
30 | ,wxWindowID vId | |
31 | ,const wxPoint& rPos = wxDefaultPosition | |
32 | ,const wxSize& vSize = wxDefaultSize | |
33 | ,int nStrings = 0 | |
34 | ,const wxString asChoices[] = NULL | |
35 | ,long lStyle = 0 | |
1de4baa3 | 36 | ,const wxValidator& rValidator = wxDefaultValidator |
1de4baa3 DW |
37 | ,const wxString& rsName = wxListBoxNameStr |
38 | ); | |
584ad2a3 MB |
39 | wxCheckListBox( wxWindow* pParent |
40 | ,wxWindowID vId | |
41 | ,const wxPoint& rPos | |
42 | ,const wxSize& vSize | |
43 | ,const wxArrayString& asChoices | |
44 | ,long lStyle = 0 | |
45 | ,const wxValidator& rValidator = wxDefaultValidator | |
46 | ,const wxString& rsName = wxListBoxNameStr | |
47 | ); | |
1de4baa3 | 48 | |
f5ea767e | 49 | // |
1de4baa3 DW |
50 | // Override base class virtuals |
51 | // | |
aa61d352 | 52 | virtual void Delete(unsigned int n); |
1de4baa3 DW |
53 | |
54 | virtual bool SetFont(const wxFont &rFont); | |
55 | ||
f5ea767e | 56 | // |
1de4baa3 DW |
57 | // Items may be checked |
58 | // | |
aa61d352 VZ |
59 | bool IsChecked(unsigned int uiIndex) const; |
60 | void Check(unsigned int uiIndex, bool bCheck = true); | |
1de4baa3 | 61 | |
f5ea767e | 62 | // |
1de4baa3 DW |
63 | // Accessors |
64 | // | |
65 | size_t GetItemHeight(void) const { return m_nItemHeight; } | |
37f214d5 DW |
66 | |
67 | protected: | |
f5ea767e | 68 | // |
1de4baa3 DW |
69 | // We create our items ourselves and they have non-standard size, |
70 | // so we need to override these functions | |
71 | // | |
72 | virtual wxOwnerDrawn* CreateItem(size_t n); | |
f5ea767e | 73 | virtual long OS2OnMeasure(WXMEASUREITEMSTRUCT* pItem); |
1de4baa3 | 74 | |
a236aa20 VZ |
75 | virtual int DoInsertItems(const wxArrayStringsAdapter & items, |
76 | unsigned int pos, | |
77 | void **clientData, wxClientDataType type); | |
84882850 | 78 | |
f5ea767e | 79 | // |
1de4baa3 DW |
80 | // Pressing space or clicking the check box toggles the item |
81 | // | |
82 | void OnChar(wxKeyEvent& rEvent); | |
83 | void OnLeftClick(wxMouseEvent& rEvent); | |
37f214d5 DW |
84 | |
85 | private: | |
aa61d352 | 86 | size_t m_nItemHeight; // height of checklistbox items (the same for all) |
1de4baa3 | 87 | |
1de4baa3 DW |
88 | DECLARE_DYNAMIC_CLASS(wxCheckListBox) |
89 | DECLARE_EVENT_TABLE() | |
84882850 | 90 | }; // end of CLASS wxCheckListBox |
0e320a79 DW |
91 | |
92 | #endif | |
a419c3b1 | 93 | // _WX_CHECKLST_H_ |