]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: menuitem.h | |
3 | // Purpose: wxMenuItem class | |
4 | // Author: Robert Roebling | |
5 | // RCS-ID: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling | |
7 | // Licence: wxWindows license | |
8 | /////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef __GTKMENUITEMH__ | |
11 | #define __GTKMENUITEMH__ | |
12 | ||
13 | #ifdef __GNUG__ | |
14 | #pragma interface | |
15 | #endif | |
16 | ||
17 | #include "wx/bitmap.h" | |
18 | ||
19 | //----------------------------------------------------------------------------- | |
20 | // wxMenuItem | |
21 | //----------------------------------------------------------------------------- | |
22 | ||
23 | class wxMenuItem : public wxMenuItemBase | |
24 | { | |
25 | public: | |
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); | |
32 | ~wxMenuItem(); | |
33 | ||
34 | // implement base class virtuals | |
35 | virtual void SetText( const wxString& str ); | |
36 | virtual void Enable( bool enable = TRUE ); | |
37 | virtual void Check( bool check = TRUE ); | |
38 | virtual bool IsChecked() const; | |
39 | virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; } | |
40 | virtual const wxBitmap& GetBitmap() const { return m_bitmap; } | |
41 | ||
42 | #if wxUSE_ACCEL | |
43 | virtual wxAcceleratorEntry *GetAccel() const; | |
44 | #endif // wxUSE_ACCEL | |
45 | ||
46 | // implementation | |
47 | void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; } | |
48 | GtkWidget *GetMenuItem() const { return m_menuItem; } | |
49 | GtkWidget *GetLabelWidget() const { return m_labelWidget; } | |
50 | void SetLabelWidget(GtkWidget *labelWidget) { m_labelWidget = labelWidget; } | |
51 | wxString GetFactoryPath() const; | |
52 | ||
53 | wxString GetHotKey() const { return m_hotKey; } | |
54 | ||
55 | private: | |
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; | |
61 | wxBitmap m_bitmap; // Bitmap for menuitem, if any | |
62 | ||
63 | GtkWidget *m_menuItem; // GtkMenuItem | |
64 | GtkWidget* m_labelWidget; // Label widget | |
65 | ||
66 | DECLARE_DYNAMIC_CLASS(wxMenuItem) | |
67 | }; | |
68 | ||
69 | ||
70 | #endif | |
71 | //__GTKMENUITEMH__ |