1999-01-01 11:05:26 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: menuitem.h
|
|
|
|
// Purpose: wxMenuItem class
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 11.11.97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
2003-03-17 05:34:04 -05:00
|
|
|
// Licence: wxWindows licence
|
1999-01-01 11:05:26 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _MENUITEM_H
|
|
|
|
#define _MENUITEM_H
|
|
|
|
|
2002-08-31 07:29:13 -04:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
1999-01-01 11:05:26 -05:00
|
|
|
#pragma interface "menuitem.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "wx/setup.h"
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-11-05 04:16:09 -05:00
|
|
|
class WXDLLEXPORT wxMenuItem: public wxMenuItemBase
|
1999-01-01 11:05:26 -05:00
|
|
|
{
|
|
|
|
public:
|
1999-11-05 04:16:09 -05:00
|
|
|
// ctor & dtor
|
|
|
|
wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
|
|
|
|
int id = wxID_SEPARATOR,
|
|
|
|
const wxString& name = wxEmptyString,
|
|
|
|
const wxString& help = wxEmptyString,
|
2002-03-22 14:18:51 -05:00
|
|
|
wxItemKind kind = wxITEM_NORMAL,
|
1999-11-05 04:16:09 -05:00
|
|
|
wxMenu *subMenu = (wxMenu *)NULL);
|
|
|
|
virtual ~wxMenuItem();
|
|
|
|
|
|
|
|
// override base class virtuals
|
|
|
|
virtual void SetText(const wxString& strName);
|
|
|
|
|
|
|
|
virtual void Enable(bool bDoEnable = TRUE);
|
|
|
|
virtual void Check(bool bDoCheck = TRUE);
|
|
|
|
|
2003-01-28 01:54:36 -05:00
|
|
|
virtual void SetBitmap(const wxBitmap& bitmap) ;
|
2001-08-12 11:43:02 -04:00
|
|
|
virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
|
|
|
|
|
2003-02-28 18:48:13 -05:00
|
|
|
// update the os specific representation
|
|
|
|
void UpdateItemBitmap() ;
|
|
|
|
void UpdateItemText() ;
|
|
|
|
void UpdateItemStatus() ;
|
1999-11-05 04:16:09 -05:00
|
|
|
|
2003-01-28 01:54:36 -05:00
|
|
|
// mark item as belonging to the given radio group
|
|
|
|
void SetAsRadioGroupStart();
|
|
|
|
void SetRadioGroupStart(int start);
|
|
|
|
void SetRadioGroupEnd(int end);
|
2000-08-09 07:02:59 -04:00
|
|
|
|
1999-01-01 11:05:26 -05:00
|
|
|
private:
|
2003-01-28 01:54:36 -05:00
|
|
|
void UncheckRadio() ;
|
|
|
|
|
|
|
|
// the positions of the first and last items of the radio group this item
|
|
|
|
// belongs to or -1: start is the radio group start and is valid for all
|
|
|
|
// but first radio group items (m_isRadioGroupStart == FALSE), end is valid
|
|
|
|
// only for the first one
|
|
|
|
union
|
|
|
|
{
|
|
|
|
int start;
|
|
|
|
int end;
|
|
|
|
} m_radioGroup;
|
|
|
|
|
|
|
|
// does this item start a radio group?
|
|
|
|
bool m_isRadioGroupStart;
|
|
|
|
|
2001-08-12 11:43:02 -04:00
|
|
|
wxBitmap m_bitmap; // Bitmap for menuitem, if any
|
2002-01-20 11:12:22 -05:00
|
|
|
void* m_menu ; // the appropriate menu , may also be a system menu
|
2001-08-12 11:43:02 -04:00
|
|
|
|
1999-11-05 04:16:09 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMenuItem)
|
1999-01-01 11:05:26 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //_MENUITEM_H
|