]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/menuitem.h
dbc4478b3db7125a57e40b8d0e5b73fe4f066ca2
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMenuItem class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
16 #pragma interface "menuitem.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
24 #include "wx/ownerdrw.h" // base class
27 // ----------------------------------------------------------------------------
28 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
29 // ----------------------------------------------------------------------------
31 class WXDLLEXPORT wxMenuItem
: public wxMenuItemBase
38 wxMenuItem(wxMenu
*parentMenu
= (wxMenu
*)NULL
,
39 int id
= wxID_SEPARATOR
,
40 const wxString
& name
= wxEmptyString
,
41 const wxString
& help
= wxEmptyString
,
42 wxItemKind kind
= wxItem_Normal
,
43 wxMenu
*subMenu
= (wxMenu
*)NULL
);
44 virtual ~wxMenuItem();
46 // override base class virtuals
47 virtual void SetText(const wxString
& strName
);
48 virtual void SetCheckable(bool checkable
);
50 virtual void Enable(bool bDoEnable
= TRUE
);
51 virtual void Check(bool bDoCheck
= TRUE
);
52 virtual bool IsChecked() const;
54 // unfortunately needed to resolve ambiguity between
55 // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
56 bool IsCheckable() const { return wxMenuItemBase::IsCheckable(); }
58 // the id for a popup menu is really its menu handle (as required by
59 // ::AppendMenu() API), so this function will return either the id or the
60 // menu handle depending on what we're
61 int GetRealId() const;
63 // mark item as belonging to the given radio group
64 void SetRadioGroup(int start
, int end
)
66 m_startRadioGroup
= start
;
67 m_endRadioGroup
= end
;
71 // the positions of the first and last items of the radio group this item
73 int m_startRadioGroup
,
76 DECLARE_DYNAMIC_CLASS(wxMenuItem
)