1998-09-18 21:36:20 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: menuitem.h
|
|
|
|
// 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>
|
2003-03-17 10:34:04 +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
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2002-02-05 16:34:33 +00:00
|
|
|
#pragma interface "menuitem.h"
|
1998-09-18 21:36:20 +00:00
|
|
|
#endif
|
|
|
|
|
2000-09-27 11:32:03 +00:00
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
1999-11-02 17:23:29 +00:00
|
|
|
class WXDLLEXPORT wxMenuBar;
|
|
|
|
|
1998-09-18 21:36:20 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1999-11-02 17:23:29 +00:00
|
|
|
class 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
|
|
|
|
wxMenuItem(wxMenu *parentMenu = (wxMenu *)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,
|
2002-03-18 19:41:35 +00:00
|
|
|
wxMenu *subMenu = (wxMenu *)NULL);
|
1999-10-27 13:19:07 +00:00
|
|
|
~wxMenuItem();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 13:19:07 +00:00
|
|
|
// accessors (some more are inherited from wxOwnerDrawn or are below)
|
|
|
|
virtual void SetText(const wxString& label);
|
|
|
|
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; }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 13:19:07 +00:00
|
|
|
void DeleteSubMenu();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 13:19:07 +00:00
|
|
|
// implementation from now on
|
|
|
|
void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu);
|
|
|
|
void DestroyItem(bool full);
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 13:19:07 +00:00
|
|
|
WXWidget GetButtonWidget() const { return m_buttonWidget; }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 13:19:07 +00:00
|
|
|
wxMenuBar* GetMenuBar() const { return m_menuBar; }
|
|
|
|
void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 13:19:07 +00:00
|
|
|
wxMenu* GetTopMenu() const { return m_topMenu; }
|
|
|
|
void SetTopMenu(wxMenu* menu) { m_topMenu = menu; }
|
2002-02-05 16:34:33 +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
|
2002-02-05 16:34:33 +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
|