]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/menuitem.h
rewrote wxFileName::Normalize(), added a few methods, general clean up,
[wxWidgets.git] / include / wx / gtk / menuitem.h
CommitLineData
23d1d521
JS
1///////////////////////////////////////////////////////////////////////////////
2// Name: menuitem.h
3// Purpose: wxMenuItem class
6ca41e57 4// Author: Robert Roebling
23d1d521 5// RCS-ID: $Id$
6ca41e57 6// Copyright: (c) 1998 Robert Roebling
23d1d521
JS
7// Licence: wxWindows license
8///////////////////////////////////////////////////////////////////////////////
9
6ca41e57
RR
10#ifndef __GTKMENUITEMH__
11#define __GTKMENUITEMH__
23d1d521
JS
12
13#ifdef __GNUG__
6ca41e57 14#pragma interface
23d1d521
JS
15#endif
16
37d403aa
JS
17#include "wx/bitmap.h"
18
6ca41e57
RR
19//-----------------------------------------------------------------------------
20// wxMenuItem
21//-----------------------------------------------------------------------------
23d1d521 22
974e8d94 23class wxMenuItem : public wxMenuItemBase
6ca41e57 24{
6ca41e57 25public:
974e8d94
VZ
26 wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
27 int id = wxID_SEPARATOR,
28 const wxString& text = wxEmptyString,
29 const wxString& help = wxEmptyString,
30 bool isCheckable = FALSE,
31 wxMenu *subMenu = (wxMenu *)NULL);
d1b15f03 32 ~wxMenuItem();
c626a8b7 33
974e8d94 34 // implement base class virtuals
354aa1e3 35 virtual void SetText( const wxString& str );
974e8d94
VZ
36 virtual void Enable( bool enable = TRUE );
37 virtual void Check( bool check = TRUE );
38 virtual bool IsChecked() const;
37d403aa
JS
39 virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
40 virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
c626a8b7 41
717a57c2
VZ
42#if wxUSE_ACCEL
43 virtual wxAcceleratorEntry *GetAccel() const;
44#endif // wxUSE_ACCEL
45
c626a8b7
VZ
46 // implementation
47 void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
48 GtkWidget *GetMenuItem() const { return m_menuItem; }
37d403aa
JS
49 GtkWidget *GetLabelWidget() const { return m_labelWidget; }
50 void SetLabelWidget(GtkWidget *labelWidget) { m_labelWidget = labelWidget; }
354aa1e3 51 wxString GetFactoryPath() const;
c626a8b7 52
974e8d94 53 wxString GetHotKey() const { return m_hotKey; }
c626a8b7
VZ
54
55private:
974e8d94
VZ
56 // DoSetText() transforms the accel mnemonics in our label from MSW/wxWin
57 // style to GTK+ and is called from ctor and SetText()
58 void DoSetText(const wxString& text);
59
60 wxString m_hotKey;
37d403aa 61 wxBitmap m_bitmap; // Bitmap for menuitem, if any
974e8d94
VZ
62
63 GtkWidget *m_menuItem; // GtkMenuItem
37d403aa 64 GtkWidget* m_labelWidget; // Label widget
c626a8b7 65
974e8d94 66 DECLARE_DYNAMIC_CLASS(wxMenuItem)
23d1d521
JS
67};
68
6ca41e57 69
8bbe427f 70#endif
6ca41e57 71 //__GTKMENUITEMH__