]>
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 license
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
= ""
51 ,const wxString
& rWxHelp
= ""
52 ,wxItemKind kind
= 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;
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
114 bool m_bIsRadioGroupStart
;
115 DECLARE_DYNAMIC_CLASS(wxMenuItem
)
116 }; // end of CLASS wxMenuItem