1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/menuitem.h
3 // Purpose: wxMenuItem class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
20 #include "wx/os2/private.h" // for MENUITEM
22 // an exception to the general rule that a normal header doesn't include other
23 // headers - only because ownerdrw.h is not always included and I don't want
24 // to write #ifdef's everywhere...
26 #include "wx/ownerdrw.h"
29 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
33 // ----------------------------------------------------------------------------
34 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
35 // ----------------------------------------------------------------------------
36 class WXDLLIMPEXP_CORE wxMenuItem
: public wxMenuItemBase
45 wxMenuItem( wxMenu
* pParentMenu
= NULL
46 ,int nId
= wxID_SEPARATOR
47 ,const wxString
& rStrName
= wxEmptyString
48 ,const wxString
& rWxHelp
= wxEmptyString
49 ,wxItemKind eKind
= wxITEM_NORMAL
50 ,wxMenu
* pSubMenu
= NULL
54 // Depricated, do not use in new code
56 wxMenuItem( wxMenu
* pParentMenu
58 ,const wxString
& rsText
59 ,const wxString
& rsHelp
61 ,wxMenu
* pSubMenu
= (wxMenu
*)NULL
63 virtual ~wxMenuItem();
66 // Override base class virtuals
68 virtual void SetItemLabel(const wxString
& rStrName
);
69 virtual void SetCheckable(bool bCheckable
);
71 virtual void Enable(bool bDoEnable
= true);
72 virtual void Check(bool bDoCheck
= true);
73 virtual bool IsChecked(void) const;
76 // Unfortunately needed to resolve ambiguity between
77 // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
79 bool IsCheckable(void) const { return wxMenuItemBase::IsCheckable(); }
82 // The id for a popup menu is really its menu handle (as required by
83 // ::AppendMenu() API), so this function will return either the id or the
84 // menu handle depending on what we're
86 int GetRealId(void) const;
89 // Mark item as belonging to the given radio group
91 void SetAsRadioGroupStart(void);
92 void SetRadioGroupStart(int nStart
);
93 void SetRadioGroupEnd(int nEnd
);
96 // All OS/2PM Submenus and menus have one of these
104 // The positions of the first and last items of the radio group this item
105 // belongs to or -1: start is the radio group start and is valid for all
106 // but first radio group items (m_isRadioGroupStart == FALSE), end is valid
107 // only for the first one
116 // Does this item start a radio group?
118 bool m_bIsRadioGroupStart
;
120 DECLARE_DYNAMIC_CLASS(wxMenuItem
)
121 }; // end of CLASS wxMenuItem