]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/menuitem.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMenuItem class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
16 #pragma interface "menuitem.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
25 // an exception to the general rule that a normal header doesn't include other
26 // headers - only because ownerdrw.h is not always included and I don't want
27 // to write #ifdef's everywhere...
29 #include "wx/ownerdrw.h"
32 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
36 // ----------------------------------------------------------------------------
37 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
38 // ----------------------------------------------------------------------------
39 class WXDLLEXPORT wxMenuItem
: public wxMenuItemBase
48 wxMenuItem( wxMenu
* pParentMenu
= NULL
49 ,int nId
= wxID_SEPARATOR
50 ,const wxString
& rStrName
= wxEmptyString
51 ,const wxString
& rWxHelp
= wxEmptyString
52 ,wxItemKind eKind
= wxITEM_NORMAL
53 ,wxMenu
* pSubMenu
= NULL
57 // Depricated, do not use in new code
59 wxMenuItem( wxMenu
* pParentMenu
61 ,const wxString
& rsText
62 ,const wxString
& rsHelp
64 ,wxMenu
* pSubMenu
= (wxMenu
*)NULL
66 virtual ~wxMenuItem();
69 // Override base class virtuals
71 virtual void SetText(const wxString
& rStrName
);
72 virtual void SetCheckable(bool bCheckable
);
74 virtual void Enable(bool bDoEnable
= TRUE
);
75 virtual void Check(bool bDoCheck
= TRUE
);
76 virtual bool IsChecked(void) const;
79 // Unfortunately needed to resolve ambiguity between
80 // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
82 bool IsCheckable(void) const { return wxMenuItemBase::IsCheckable(); }
85 // The id for a popup menu is really its menu handle (as required by
86 // ::AppendMenu() API), so this function will return either the id or the
87 // menu handle depending on what we're
89 int GetRealId(void) const;
92 // Mark item as belonging to the given radio group
94 void SetAsRadioGroupStart(void);
95 void SetRadioGroupStart(int nStart
);
96 void SetRadioGroupEnd(int nEnd
);
99 // All OS/2PM Submenus and menus have one of these
101 MENUITEM m_vMenuData
;
107 // The positions of the first and last items of the radio group this item
108 // belongs to or -1: start is the radio group start and is valid for all
109 // but first radio group items (m_isRadioGroupStart == FALSE), end is valid
110 // only for the first one
119 // Does this item start a radio group?
121 bool m_bIsRadioGroupStart
;
123 DECLARE_DYNAMIC_CLASS(wxMenuItem
)
124 }; // end of CLASS wxMenuItem