]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: menuitem.h | |
3 | // Purpose: wxMenuItem class | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
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 | #if wxUSE_OWNER_DRAWN | |
24 | #include "wx/ownerdrw.h" // base class | |
25 | #endif | |
26 | ||
27 | // ---------------------------------------------------------------------------- | |
28 | // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour | |
29 | // ---------------------------------------------------------------------------- | |
30 | ||
31 | class WXDLLEXPORT wxMenuItem : public wxMenuItemBase | |
32 | #if wxUSE_OWNER_DRAWN | |
33 | , public wxOwnerDrawn | |
34 | #endif | |
35 | { | |
36 | public: | |
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); | |
48 | virtual void SetCheckable(bool checkable); | |
49 | ||
50 | virtual void Enable(bool bDoEnable = TRUE); | |
51 | virtual void Check(bool bDoCheck = TRUE); | |
52 | virtual bool IsChecked() const; | |
53 | ||
54 | // unfortunately needed to resolve ambiguity between | |
55 | // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable() | |
56 | bool IsCheckable() const { return wxMenuItemBase::IsCheckable(); } | |
57 | ||
58 | // the id for a popup menu is really its menu handle (as required by | |
59 | // ::AppendMenu() API), so this function will return either the id or the | |
60 | // menu handle depending on what we're | |
61 | int GetRealId() const; | |
62 | ||
63 | private: | |
64 | DECLARE_DYNAMIC_CLASS(wxMenuItem) | |
65 | }; | |
66 | ||
67 | #endif //_MENUITEM_H |