1998-09-18 21:36:20 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2011-03-20 00:14:35 +00:00
|
|
|
// Name: wx/gtk/menuitem.h
|
1998-09-18 21:36:20 +00:00
|
|
|
// Purpose: wxMenuItem class
|
1998-11-03 11:19:58 +00:00
|
|
|
// Author: Robert Roebling
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 21:36:20 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-05-29 04:41:37 +00:00
|
|
|
#ifndef _WX_GTKMENUITEM_H_
|
|
|
|
#define _WX_GTKMENUITEM_H_
|
1998-09-18 21:36:20 +00:00
|
|
|
|
2000-09-01 08:35:30 +00:00
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
1998-11-03 11:19:58 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMenuItem
|
|
|
|
//-----------------------------------------------------------------------------
|
1998-09-18 21:36:20 +00:00
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
|
1998-11-03 11:19:58 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-01-19 13:55:27 +00:00
|
|
|
wxMenuItem(wxMenu *parentMenu = NULL,
|
1999-10-25 15:51:37 +00:00
|
|
|
int id = wxID_SEPARATOR,
|
|
|
|
const wxString& text = wxEmptyString,
|
|
|
|
const wxString& help = wxEmptyString,
|
2002-03-22 19:18:51 +00:00
|
|
|
wxItemKind kind = wxITEM_NORMAL,
|
2009-01-19 13:55:27 +00:00
|
|
|
wxMenu *subMenu = NULL);
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxMenuItem();
|
1999-03-24 19:05:19 +00:00
|
|
|
|
1999-10-25 15:51:37 +00:00
|
|
|
// implement base class virtuals
|
2007-08-11 17:54:59 +00:00
|
|
|
virtual void SetItemLabel( const wxString& str );
|
2008-05-29 04:41:37 +00:00
|
|
|
virtual void Enable( bool enable = true );
|
|
|
|
virtual void Check( bool check = true );
|
1999-10-25 15:51:37 +00:00
|
|
|
virtual bool IsChecked() const;
|
2008-06-10 03:54:43 +00:00
|
|
|
virtual void SetBitmap(const wxBitmap& bitmap);
|
2000-09-01 08:35:30 +00:00
|
|
|
virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
|
1999-03-24 19:05:19 +00:00
|
|
|
|
|
|
|
// implementation
|
2012-12-29 07:07:29 +00:00
|
|
|
void SetMenuItem(GtkWidget *menuItem);
|
1999-03-24 19:05:19 +00:00
|
|
|
GtkWidget *GetMenuItem() const { return m_menuItem; }
|
2008-06-10 03:54:43 +00:00
|
|
|
void SetGtkLabel();
|
2008-06-02 21:46:29 +00:00
|
|
|
|
2008-05-29 04:26:29 +00:00
|
|
|
#if WXWIN_COMPATIBILITY_2_8
|
2002-03-23 01:23:11 +00:00
|
|
|
// compatibility only, don't use in new code
|
2012-12-28 18:38:55 +00:00
|
|
|
wxDEPRECATED_CONSTRUCTOR(
|
2002-03-23 01:23:11 +00:00
|
|
|
wxMenuItem(wxMenu *parentMenu,
|
|
|
|
int id,
|
|
|
|
const wxString& text,
|
|
|
|
const wxString& help,
|
|
|
|
bool isCheckable,
|
2008-05-29 04:26:29 +00:00
|
|
|
wxMenu *subMenu = NULL)
|
|
|
|
);
|
|
|
|
#endif
|
2002-03-23 01:23:11 +00:00
|
|
|
|
1999-03-24 19:05:19 +00:00
|
|
|
private:
|
2000-09-01 08:35:30 +00:00
|
|
|
wxBitmap m_bitmap; // Bitmap for menuitem, if any
|
1999-10-25 15:51:37 +00:00
|
|
|
GtkWidget *m_menuItem; // GtkMenuItem
|
1999-03-24 19:05:19 +00:00
|
|
|
|
1999-10-25 15:51:37 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMenuItem)
|
1998-09-18 21:36:20 +00:00
|
|
|
};
|
|
|
|
|
2008-05-29 04:41:37 +00:00
|
|
|
#endif // _WX_GTKMENUITEM_H_
|