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