]>
Commit | Line | Data |
---|---|---|
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 | 39 | class WXDLLEXPORT wxMenuItem: public wxMenuItemBase |
0e320a79 DW |
40 | #if wxUSE_OWNER_DRAWN |
41 | , public wxOwnerDrawn | |
42 | #endif | |
43 | { | |
0e320a79 | 44 | public: |
e92f266c DW |
45 | // ctor & dtor |
46 | wxMenuItem(wxMenu *pParentMenu = NULL, int id = ID_SEPARATOR, | |
0e320a79 DW |
47 | const wxString& strName = "", const wxString& wxHelp = "", |
48 | bool bCheckable = FALSE, wxMenu *pSubMenu = NULL); | |
e92f266c | 49 | virtual ~wxMenuItem(); |
0e320a79 | 50 | |
e92f266c DW |
51 | // override base class virtuals |
52 | virtual void SetText(const wxString& strName); | |
53 | virtual wxString GetLabel() const; | |
54 | virtual void SetCheckable(bool checkable); | |
0e320a79 | 55 | |
e92f266c DW |
56 | virtual void Enable(bool bDoEnable = TRUE); |
57 | virtual void Check(bool bDoCheck = TRUE); | |
58 | virtual bool IsChecked() const; | |
75f11ad7 | 59 | |
e92f266c DW |
60 | #if wxUSE_ACCEL |
61 | virtual wxAcceleratorEntry *GetAccel() const; | |
62 | #endif // wxUSE_ACCEL | |
0e320a79 | 63 | |
e92f266c DW |
64 | // unfortunately needed to resolve ambiguity between |
65 | // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable() | |
66 | bool IsCheckable() const { return wxMenuItemBase::IsCheckable(); } | |
0e320a79 | 67 | |
e92f266c DW |
68 | // the id for a popup menu is really its menu handle (as required by |
69 | // ::AppendMenu() API), so this function will return either the id or the | |
70 | // menu handle depending on what we're | |
71 | int GetRealId() const; | |
0e320a79 DW |
72 | |
73 | private: | |
e92f266c | 74 | DECLARE_DYNAMIC_CLASS(wxMenuItem) |
0e320a79 DW |
75 | }; |
76 | ||
77 | #endif //_MENUITEM_H |