]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/checklst.h
Applied patch [ 649590 ] fixes bug 611264: wxFileDialog entry
[wxWidgets.git] / include / wx / os2 / checklst.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: checklst.h
3 // Purpose: wxCheckListBox class - a listbox with checkable items
4 // Note: this is an optional class.
5 // Author: David Webster
6 // Modified by:
7 // Created: 10/13/99
8 // RCS-ID: $Id$
9 // Copyright: (c) David Webster
10 // Licence: wxWindows licence
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_CHECKLST_H_
14 #define _WX_CHECKLST_H_
15
16 #include <stddef.h>
17
18 #include "wx/setup.h"
19
20 class wxOwnerDrawn; // so the compiler knows, it is a class.
21
22 class wxCheckListBoxItem; // fwd decl, define in checklst.cpp
23
24 class WXDLLEXPORT wxCheckListBox : public wxListBox
25 {
26 public:
27 //
28 // Ctors
29 //
30 wxCheckListBox();
31 wxCheckListBox( wxWindow* pParent
32 ,wxWindowID vId
33 ,const wxPoint& rPos = wxDefaultPosition
34 ,const wxSize& vSize = wxDefaultSize
35 ,int nStrings = 0
36 ,const wxString asChoices[] = NULL
37 ,long lStyle = 0
38 #if wxUSE_VALIDATORS
39 ,const wxValidator& rValidator = wxDefaultValidator
40 #endif
41 ,const wxString& rsName = wxListBoxNameStr
42 );
43
44 //
45 // Override base class virtuals
46 //
47 virtual void Delete(int n);
48 virtual void InsertItems( int nItems
49 ,const wxString asItems[]
50 ,int nPos
51 );
52
53 virtual bool SetFont(const wxFont &rFont);
54
55 //
56 // Items may be checked
57 //
58 bool IsChecked(size_t uiIndex) const;
59 void Check( size_t uiIndex
60 ,bool bCheck = TRUE
61 );
62
63 //
64 // Accessors
65 //
66 size_t GetItemHeight(void) const { return m_nItemHeight; }
67
68 protected:
69 //
70 // We create our items ourselves and they have non-standard size,
71 // so we need to override these functions
72 //
73 virtual wxOwnerDrawn* CreateItem(size_t n);
74 virtual long OS2OnMeasure(WXMEASUREITEMSTRUCT* pItem);
75
76 //
77 // Pressing space or clicking the check box toggles the item
78 //
79 void OnChar(wxKeyEvent& rEvent);
80 void OnLeftClick(wxMouseEvent& rEvent);
81
82 private:
83 size_t m_nItemHeight; // height of checklistbox items (the same for all)
84
85 //
86 // Virtual function hiding suppression, do not use
87 //
88 virtual wxControl* CreateItem( const wxItemResource* pChildResource
89 ,const wxItemResource* pParentResource
90 ,const wxResourceTable* pTable = (const wxResourceTable *) NULL
91 )
92 {
93 return(wxWindowBase::CreateItem( pChildResource
94 ,pParentResource
95 ,pTable
96 ));
97 }
98 DECLARE_DYNAMIC_CLASS(wxCheckListBox)
99 DECLARE_EVENT_TABLE()
100 }; // end of CLASS wxCheckListBoxItem
101
102 #endif
103 // _WX_CHECKLST_H_