1998-09-18 17:36:20 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2006-07-25 10:31:55 -04:00
|
|
|
// Name: wx/motif/menuitem.h
|
1998-09-18 17:36:20 -04:00
|
|
|
// Purpose: wxMenuItem class
|
|
|
|
// Author: Vadim Zeitlin
|
2000-01-11 08:58:41 -05:00
|
|
|
// Modified by:
|
1998-09-18 17:36:20 -04:00
|
|
|
// Created: 11.11.97
|
|
|
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 17:36:20 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
#ifndef _WX_MOTIF_MENUITEM_H
|
|
|
|
#define _WX_MOTIF_MENUITEM_H
|
1998-09-18 17:36:20 -04:00
|
|
|
|
2000-09-27 07:32:03 -04:00
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMenuBar;
|
1999-11-02 12:23:29 -05:00
|
|
|
|
1998-09-18 17:36:20 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 20:53:09 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
|
1999-10-27 09:19:07 -04:00
|
|
|
{
|
1998-09-18 17:36:20 -04:00
|
|
|
public:
|
1999-10-27 09:19:07 -04:00
|
|
|
// ctor & dtor
|
2009-01-19 08:55:27 -05:00
|
|
|
wxMenuItem(wxMenu *parentMenu = NULL,
|
2002-03-18 14:41:35 -05: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();
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
// accessors (some more are inherited from wxOwnerDrawn or are below)
|
2007-08-11 13:54:59 -04:00
|
|
|
virtual void SetItemLabel(const wxString& label);
|
2005-02-06 12:38:33 -05:00
|
|
|
virtual void Enable(bool enable = true);
|
|
|
|
virtual void Check(bool check = true);
|
2002-02-05 11:34:33 -05:00
|
|
|
// included SetBitmap and GetBitmap as copied from the GTK include file
|
|
|
|
// I'm not sure if this works but it silences the linker in the
|
|
|
|
// menu sample.
|
|
|
|
// JJ
|
2000-09-27 07:32:03 -04:00
|
|
|
virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
|
|
|
|
virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
// implementation from now on
|
2005-09-30 05:15:52 -04:00
|
|
|
void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu,
|
|
|
|
size_t index);
|
1999-10-27 09:19:07 -04:00
|
|
|
void DestroyItem(bool full);
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
WXWidget GetButtonWidget() const { return m_buttonWidget; }
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
wxMenuBar* GetMenuBar() const { return m_menuBar; }
|
|
|
|
void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
wxMenu* GetTopMenu() const { return m_topMenu; }
|
|
|
|
void SetTopMenu(wxMenu* menu) { m_topMenu = menu; }
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1998-09-18 17:36:20 -04:00
|
|
|
private:
|
1999-10-27 09:19:07 -04:00
|
|
|
WXWidget m_buttonWidget;
|
|
|
|
wxMenuBar* m_menuBar;
|
|
|
|
wxMenu* m_topMenu; // Top-level menu e.g. popup-menu
|
2000-09-27 07:32:03 -04:00
|
|
|
wxBitmap m_bitmap; // Bitmap for menuitem, if any
|
2006-07-25 10:31:55 -04:00
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxMenuItem);
|
1998-09-18 17:36:20 -04:00
|
|
|
};
|
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
#endif // _WX_MOTIF_MENUITEM_H
|