1998-09-18 17:36:20 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: menuitem.h
|
|
|
|
// 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
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
|
|
|
// Licence: wxWindows license
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
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
|
|
|
|
|
|
|
#ifdef __GNUG__
|
2002-02-05 11:34:33 -05:00
|
|
|
#pragma interface "menuitem.h"
|
1998-09-18 17:36:20 -04:00
|
|
|
#endif
|
|
|
|
|
2000-09-27 07:32:03 -04:00
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
1999-11-02 12:23:29 -05:00
|
|
|
class WXDLLEXPORT wxMenuBar;
|
|
|
|
|
1998-09-18 17:36:20 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1999-11-02 12:23:29 -05:00
|
|
|
class 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
|
|
|
|
wxMenuItem(wxMenu *parentMenu = (wxMenu *)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,
|
2002-03-18 14:41:35 -05:00
|
|
|
wxMenu *subMenu = (wxMenu *)NULL);
|
1999-10-27 09:19:07 -04:00
|
|
|
~wxMenuItem();
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-27 09:19:07 -04: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 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; }
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
void DeleteSubMenu();
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
// implementation from now on
|
|
|
|
void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu);
|
|
|
|
void DestroyItem(bool full);
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
WXWidget GetButtonWidget() const { return m_buttonWidget; }
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
wxMenuBar* GetMenuBar() const { return m_menuBar; }
|
|
|
|
void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
wxMenu* GetTopMenu() const { return m_topMenu; }
|
|
|
|
void SetTopMenu(wxMenu* menu) { m_topMenu = menu; }
|
2002-02-05 11:34:33 -05: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
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMenuItem)
|
1998-09-18 17:36:20 -04:00
|
|
|
};
|
|
|
|
|
1999-10-27 09:19:07 -04:00
|
|
|
#endif // _WX_MOTIF_MENUITEM_H
|