]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/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 // ----------------------------------------------------------------------------
33 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
34 // ----------------------------------------------------------------------------
35 class WXDLLEXPORT wxMenuItem
: public wxMenuItemBase
42 wxMenuItem(wxMenu
*parentMenu
= (wxMenu
*)NULL
,
43 int id
= wxID_SEPARATOR
,
44 const wxString
& name
= wxEmptyString
,
45 const wxString
& help
= wxEmptyString
,
46 bool isCheckable
= FALSE
,
47 wxMenu
*subMenu
= (wxMenu
*)NULL
);
48 virtual ~wxMenuItem();
50 // override base class virtuals
51 virtual void SetText(const wxString
& strName
);
52 virtual wxString
GetLabel() const;
53 virtual void SetCheckable(bool checkable
);
55 virtual void Enable(bool bDoEnable
= TRUE
);
56 virtual void Check(bool bDoCheck
= TRUE
);
57 virtual bool IsChecked() const;
60 virtual wxAcceleratorEntry
*GetAccel() const;
63 // unfortunately needed to resolve ambiguity between
64 // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
65 bool IsCheckable() const { return wxMenuItemBase::IsCheckable(); }
67 // the id for a popup menu is really its menu handle (as required by
68 // ::AppendMenu() API), so this function will return either the id or the
69 // menu handle depending on what we're
70 int GetRealId() const;
72 static int MacBuildMenuString(StringPtr outMacItemText
, SInt16
*outMacShortcutChar
, UInt8
*outMacModifiers
, const char *inItemName
, bool useShortcuts
) ;
75 DECLARE_DYNAMIC_CLASS(wxMenuItem
)