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