]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/menuitem.h
wxMenu::Insert() seems to work, bug in wxMenuBase::Insert() is corrected
[wxWidgets.git] / include / wx / msw / menuitem.h
CommitLineData
23d1d521
JS
1///////////////////////////////////////////////////////////////////////////////
2// Name: menuitem.h
3// Purpose: wxMenuItem class
4// Author: Vadim Zeitlin
c626a8b7 5// Modified by:
23d1d521
JS
6// Created: 11.11.97
7// RCS-ID: $Id$
8// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9// Licence: wxWindows license
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _MENUITEM_H
13#define _MENUITEM_H
14
15#ifdef __GNUG__
c626a8b7 16 #pragma interface "menuitem.h"
23d1d521
JS
17#endif
18
19// ----------------------------------------------------------------------------
20// headers
21// ----------------------------------------------------------------------------
22
47d67540 23#if wxUSE_OWNER_DRAWN
974e8d94 24 #include "wx/ownerdrw.h" // base class
23d1d521
JS
25#endif
26
23d1d521
JS
27// ----------------------------------------------------------------------------
28// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
29// ----------------------------------------------------------------------------
974e8d94
VZ
30
31class WXDLLEXPORT wxMenuItem : public wxMenuItemBase
47d67540 32#if wxUSE_OWNER_DRAWN
974e8d94 33 , public wxOwnerDrawn
23d1d521
JS
34#endif
35{
23d1d521 36public:
974e8d94
VZ
37 // ctor & dtor
38 wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
39 int id = wxID_SEPARATOR,
40 const wxString& name = wxEmptyString,
41 const wxString& help = wxEmptyString,
42 bool isCheckable = FALSE,
43 wxMenu *subMenu = (wxMenu *)NULL);
44 virtual ~wxMenuItem();
45
46 // override base class virtuals
47 virtual void SetText(const wxString& strName);
717a57c2 48 virtual wxString GetLabel() const;
974e8d94
VZ
49 virtual void SetCheckable(bool checkable);
50
51 virtual void Enable(bool bDoEnable = TRUE);
52 virtual void Check(bool bDoCheck = TRUE);
a8cfd0cb 53 virtual bool IsChecked() const;
974e8d94 54
717a57c2
VZ
55#if wxUSE_ACCEL
56 virtual wxAcceleratorEntry *GetAccel() const;
57#endif // wxUSE_ACCEL
58
974e8d94
VZ
59 // unfortunately needed to resolve ambiguity between
60 // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
61 bool IsCheckable() const { return wxMenuItemBase::IsCheckable(); }
62
63 // the id for a popup menu is really its menu handle (as required by
64 // ::AppendMenu() API), so this function will return either the id or the
65 // menu handle depending on what we're
66 int GetRealId() const;
67
23d1d521 68private:
974e8d94 69 DECLARE_DYNAMIC_CLASS(wxMenuItem)
23d1d521
JS
70};
71
72#endif //_MENUITEM_H