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