]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/menuitem.h
merge of wxMac into main repository
[wxWidgets.git] / include / wx / os2 / menuitem.h
CommitLineData
0e320a79
DW
1///////////////////////////////////////////////////////////////////////////////
2// Name: menuitem.h
3// Purpose: wxMenuItem class
4// Author: Vadim Zeitlin
75f11ad7 5// Modified by:
0e320a79
DW
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__
16#pragma interface "menuitem.h"
17#endif
18
19// ----------------------------------------------------------------------------
20// headers
21// ----------------------------------------------------------------------------
22
23#include "wx/setup.h"
24
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...
28#if wxUSE_OWNER_DRAWN
75f11ad7 29 #include "wx/ownerdrw.h"
0e320a79
DW
30#endif
31
32// ----------------------------------------------------------------------------
33// constants
34// ----------------------------------------------------------------------------
35
0e320a79
DW
36// ----------------------------------------------------------------------------
37// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
38// ----------------------------------------------------------------------------
e92f266c 39class WXDLLEXPORT wxMenuItem: public wxMenuItemBase
0e320a79
DW
40#if wxUSE_OWNER_DRAWN
41 , public wxOwnerDrawn
42#endif
43{
0e320a79 44public:
e92f266c 45 // ctor & dtor
22e90769 46 wxMenuItem( wxMenu* pParentMenu = NULL
4a277ceb 47 ,int nId = wxID_SEPARATOR
22e90769
DW
48 ,const wxString& rStrName = ""
49 ,const wxString& rWxHelp = ""
50 ,bool bCheckable = FALSE
51 ,wxMenu* pSubMenu = NULL
52 );
e92f266c 53 virtual ~wxMenuItem();
0e320a79 54
e92f266c 55 // override base class virtuals
22e90769
DW
56 virtual void SetText(const wxString& rStrName);
57 virtual void SetCheckable(bool bCheckable);
0e320a79 58
e92f266c
DW
59 virtual void Enable(bool bDoEnable = TRUE);
60 virtual void Check(bool bDoCheck = TRUE);
22e90769 61 virtual bool IsChecked(void) const;
75f11ad7 62
e92f266c 63#if wxUSE_ACCEL
22e90769 64 virtual wxAcceleratorEntry* GetAccel(void) const;
e92f266c 65#endif // wxUSE_ACCEL
0e320a79 66
e92f266c
DW
67 // unfortunately needed to resolve ambiguity between
68 // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
22e90769 69 bool IsCheckable(void) const { return wxMenuItemBase::IsCheckable(); }
0e320a79 70
e92f266c
DW
71 // the id for a popup menu is really its menu handle (as required by
72 // ::AppendMenu() API), so this function will return either the id or the
73 // menu handle depending on what we're
22e90769 74 int GetRealId(void) const;
0e320a79 75
3e282d33
DW
76 //
77 // All OS/2PM Submenus and menus have one of these
78 //
79 MENUITEM m_vMenuData;
80
0e320a79 81private:
e92f266c 82 DECLARE_DYNAMIC_CLASS(wxMenuItem)
22e90769 83}; // end of CLASS wxMenuItem
0e320a79
DW
84
85#endif //_MENUITEM_H