]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/menuitem.h
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 // ----------------------------------------------------------------------------
21 // an exception to the general rule that a normal header doesn't include other
22 // headers - only because ownerdrw.h is not always included and I don't want
23 // to write #ifdef's everywhere...
25 #include "wx/ownerdrw.h"
28 // ----------------------------------------------------------------------------
30 // ----------------------------------------------------------------------------
32 // ----------------------------------------------------------------------------
33 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
34 // ----------------------------------------------------------------------------
35 class WXDLLEXPORT wxMenuItem
: public wxMenuItemBase
44 wxMenuItem( wxMenu
* pParentMenu
= NULL
45 ,int nId
= wxID_SEPARATOR
46 ,const wxString
& rStrName
= wxEmptyString
47 ,const wxString
& rWxHelp
= wxEmptyString
48 ,wxItemKind eKind
= wxITEM_NORMAL
49 ,wxMenu
* pSubMenu
= NULL
53 // Depricated, do not use in new code
55 wxMenuItem( wxMenu
* pParentMenu
57 ,const wxString
& rsText
58 ,const wxString
& rsHelp
60 ,wxMenu
* pSubMenu
= (wxMenu
*)NULL
62 virtual ~wxMenuItem();
65 // Override base class virtuals
67 virtual void SetItemLabel(const wxString
& rStrName
);
68 virtual void SetCheckable(bool bCheckable
);
70 virtual void Enable(bool bDoEnable
= true);
71 virtual void Check(bool bDoCheck
= true);
72 virtual bool IsChecked(void) const;
75 // Unfortunately needed to resolve ambiguity between
76 // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
78 bool IsCheckable(void) const { return wxMenuItemBase::IsCheckable(); }
81 // The id for a popup menu is really its menu handle (as required by
82 // ::AppendMenu() API), so this function will return either the id or the
83 // menu handle depending on what we're
85 int GetRealId(void) const;
88 // Mark item as belonging to the given radio group
90 void SetAsRadioGroupStart(void);
91 void SetRadioGroupStart(int nStart
);
92 void SetRadioGroupEnd(int nEnd
);
95 // All OS/2PM Submenus and menus have one of these
103 // The positions of the first and last items of the radio group this item
104 // belongs to or -1: start is the radio group start and is valid for all
105 // but first radio group items (m_isRadioGroupStart == FALSE), end is valid
106 // only for the first one
115 // Does this item start a radio group?
117 bool m_bIsRadioGroupStart
;
119 DECLARE_DYNAMIC_CLASS(wxMenuItem
)
120 }; // end of CLASS wxMenuItem