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
|
1998-09-18 17:36:20 -04:00
|
|
|
// Licence: wxWindows license
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-11-03 06:19:58 -05:00
|
|
|
#ifndef __GTKMENUITEMH__
|
|
|
|
#define __GTKMENUITEMH__
|
1998-09-18 17:36:20 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1998-11-03 06:19:58 -05:00
|
|
|
#pragma interface
|
1998-09-18 17:36:20 -04:00
|
|
|
#endif
|
|
|
|
|
1998-11-03 06:19:58 -05:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMenuItem
|
|
|
|
//-----------------------------------------------------------------------------
|
1998-09-18 17:36:20 -04:00
|
|
|
|
1999-10-25 11:51:37 -04:00
|
|
|
class wxMenuItem : public wxMenuItemBase
|
1998-11-03 06:19:58 -05:00
|
|
|
{
|
|
|
|
public:
|
1999-10-25 11:51:37 -04:00
|
|
|
wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
|
|
|
|
int id = wxID_SEPARATOR,
|
|
|
|
const wxString& text = wxEmptyString,
|
|
|
|
const wxString& help = wxEmptyString,
|
|
|
|
bool isCheckable = FALSE,
|
|
|
|
wxMenu *subMenu = (wxMenu *)NULL);
|
1999-10-11 15:32:58 -04:00
|
|
|
~wxMenuItem();
|
1999-03-24 14:05:19 -05:00
|
|
|
|
1999-10-25 11:51:37 -04:00
|
|
|
// implement base class virtuals
|
1999-10-30 11:08:33 -04:00
|
|
|
virtual void SetText( const wxString& str );
|
1999-10-25 11:51:37 -04:00
|
|
|
virtual void Enable( bool enable = TRUE );
|
|
|
|
virtual void Check( bool check = TRUE );
|
|
|
|
virtual bool IsChecked() const;
|
1999-03-24 14:05:19 -05:00
|
|
|
|
1999-11-01 20:25:43 -05:00
|
|
|
#if wxUSE_ACCEL
|
|
|
|
virtual wxAcceleratorEntry *GetAccel() const;
|
|
|
|
#endif // wxUSE_ACCEL
|
|
|
|
|
1999-03-24 14:05:19 -05:00
|
|
|
// implementation
|
|
|
|
void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
|
|
|
|
GtkWidget *GetMenuItem() const { return m_menuItem; }
|
1999-10-30 11:08:33 -04:00
|
|
|
wxString GetFactoryPath() const;
|
1999-03-24 14:05:19 -05:00
|
|
|
|
1999-10-25 11:51:37 -04:00
|
|
|
wxString GetHotKey() const { return m_hotKey; }
|
1999-03-24 14:05:19 -05:00
|
|
|
|
|
|
|
private:
|
1999-10-25 11:51:37 -04:00
|
|
|
// DoSetText() transforms the accel mnemonics in our label from MSW/wxWin
|
|
|
|
// style to GTK+ and is called from ctor and SetText()
|
|
|
|
void DoSetText(const wxString& text);
|
|
|
|
|
|
|
|
wxString m_hotKey;
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
1998-11-03 06:19:58 -05:00
|
|
|
|
1998-12-09 12:30:17 -05:00
|
|
|
#endif
|
1998-11-03 06:19:58 -05:00
|
|
|
//__GTKMENUITEMH__
|