]>
Commit | Line | Data |
---|---|---|
23d1d521 | 1 | /////////////////////////////////////////////////////////////////////////////// |
8ef94bfc | 2 | // Name: wx/gtk1/menuitem.h |
23d1d521 | 3 | // Purpose: wxMenuItem class |
6ca41e57 | 4 | // Author: Robert Roebling |
6ca41e57 | 5 | // Copyright: (c) 1998 Robert Roebling |
65571936 | 6 | // Licence: wxWindows licence |
23d1d521 JS |
7 | /////////////////////////////////////////////////////////////////////////////// |
8 | ||
6ca41e57 RR |
9 | #ifndef __GTKMENUITEMH__ |
10 | #define __GTKMENUITEMH__ | |
23d1d521 | 11 | |
37d403aa JS |
12 | #include "wx/bitmap.h" |
13 | ||
6ca41e57 RR |
14 | //----------------------------------------------------------------------------- |
15 | // wxMenuItem | |
16 | //----------------------------------------------------------------------------- | |
23d1d521 | 17 | |
20123d49 | 18 | class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase |
6ca41e57 | 19 | { |
6ca41e57 | 20 | public: |
d3b9f782 | 21 | wxMenuItem(wxMenu *parentMenu = NULL, |
974e8d94 VZ |
22 | int id = wxID_SEPARATOR, |
23 | const wxString& text = wxEmptyString, | |
24 | const wxString& help = wxEmptyString, | |
546bfbea | 25 | wxItemKind kind = wxITEM_NORMAL, |
d3b9f782 | 26 | wxMenu *subMenu = NULL); |
d3c7fc99 | 27 | virtual ~wxMenuItem(); |
c626a8b7 | 28 | |
974e8d94 | 29 | // implement base class virtuals |
52af3158 JS |
30 | virtual void SetItemLabel( const wxString& str ); |
31 | virtual wxString GetItemLabel() const; | |
974e8d94 VZ |
32 | virtual void Enable( bool enable = TRUE ); |
33 | virtual void Check( bool check = TRUE ); | |
34 | virtual bool IsChecked() const; | |
37d403aa JS |
35 | virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; } |
36 | virtual const wxBitmap& GetBitmap() const { return m_bitmap; } | |
c626a8b7 | 37 | |
717a57c2 VZ |
38 | #if wxUSE_ACCEL |
39 | virtual wxAcceleratorEntry *GetAccel() const; | |
40 | #endif // wxUSE_ACCEL | |
41 | ||
c626a8b7 VZ |
42 | // implementation |
43 | void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; } | |
44 | GtkWidget *GetMenuItem() const { return m_menuItem; } | |
37d403aa JS |
45 | GtkWidget *GetLabelWidget() const { return m_labelWidget; } |
46 | void SetLabelWidget(GtkWidget *labelWidget) { m_labelWidget = labelWidget; } | |
354aa1e3 | 47 | wxString GetFactoryPath() const; |
c626a8b7 | 48 | |
974e8d94 | 49 | wxString GetHotKey() const { return m_hotKey; } |
c626a8b7 | 50 | |
2368dcda VZ |
51 | // compatibility only, don't use in new code |
52 | wxMenuItem(wxMenu *parentMenu, | |
53 | int id, | |
54 | const wxString& text, | |
55 | const wxString& help, | |
56 | bool isCheckable, | |
d3b9f782 | 57 | wxMenu *subMenu = NULL); |
2368dcda | 58 | |
c626a8b7 | 59 | private: |
2368dcda | 60 | // common part of all ctors |
010eb424 | 61 | void Init(); |
2368dcda | 62 | |
974e8d94 VZ |
63 | // DoSetText() transforms the accel mnemonics in our label from MSW/wxWin |
64 | // style to GTK+ and is called from ctor and SetText() | |
65 | void DoSetText(const wxString& text); | |
66 | ||
67 | wxString m_hotKey; | |
37d403aa | 68 | wxBitmap m_bitmap; // Bitmap for menuitem, if any |
974e8d94 VZ |
69 | |
70 | GtkWidget *m_menuItem; // GtkMenuItem | |
37d403aa | 71 | GtkWidget* m_labelWidget; // Label widget |
c626a8b7 | 72 | |
974e8d94 | 73 | DECLARE_DYNAMIC_CLASS(wxMenuItem) |
23d1d521 JS |
74 | }; |
75 | ||
8bbe427f | 76 | #endif |
6ca41e57 | 77 | //__GTKMENUITEMH__ |