]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/checklst.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCheckListBox class - a listbox with checkable items
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef __CHECKLST_H__
13 #define __CHECKLST_H__
15 typedef unsigned int uint
;
18 #error "wxCheckListBox class requires owner-drawn functionality."
21 class wxCheckListBoxItem
; // fwd decl, define in checklst.cpp
23 class wxCheckListBox
: public wxListBox
25 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
29 wxCheckListBox(wxWindow
*parent
, const wxWindowID id
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
32 const int nStrings
= 0,
33 const wxString choices
[] = NULL
,
35 const wxValidator
& validator
= wxDefaultValidator
,
36 const wxString
& name
= wxListBoxNameStr
);
37 // const wxFont& font = wxNullFont);
39 // items may be checked
40 bool IsChecked(uint uiIndex
) const;
41 void Check(uint uiIndex
, bool bCheck
= TRUE
);
44 uint
GetItemHeight() const { return m_nItemHeight
; }
47 // we create our items ourselves and they have non-standard size,
48 // so we need to override these functions
49 virtual wxOwnerDrawn
*CreateItem(uint n
);
50 virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT
*item
);
52 // pressing space or clicking the check box toggles the item
53 void OnChar(wxKeyEvent
& event
);
54 void OnLeftClick(wxMouseEvent
& event
);
57 uint m_nItemHeight
; // height of checklistbox items (the same for all)