]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/menuitem.h
Compilation fixes for wxUSE_STL == 1 and for wxUSE_UNICODE == 1.
[wxWidgets.git] / include / wx / mac / menuitem.h
CommitLineData
0dbd6262
SC
1///////////////////////////////////////////////////////////////////////////////
2// Name: menuitem.h
3// Purpose: wxMenuItem class
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 11.11.97
7// RCS-ID: $Id$
8// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
371a5b4e 9// Licence: wxWindows licence
0dbd6262
SC
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _MENUITEM_H
13#define _MENUITEM_H
14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
0dbd6262
SC
16#pragma interface "menuitem.h"
17#endif
18
19// ----------------------------------------------------------------------------
20// headers
21// ----------------------------------------------------------------------------
22
23#include "wx/setup.h"
24
0dbd6262
SC
25// ----------------------------------------------------------------------------
26// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
27// ----------------------------------------------------------------------------
519cb848 28class WXDLLEXPORT wxMenuItem: public wxMenuItemBase
0dbd6262 29{
0dbd6262 30public:
519cb848
SC
31 // ctor & dtor
32 wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
33 int id = wxID_SEPARATOR,
34 const wxString& name = wxEmptyString,
35 const wxString& help = wxEmptyString,
546bfbea 36 wxItemKind kind = wxITEM_NORMAL,
519cb848
SC
37 wxMenu *subMenu = (wxMenu *)NULL);
38 virtual ~wxMenuItem();
39
40 // override base class virtuals
41 virtual void SetText(const wxString& strName);
519cb848
SC
42
43 virtual void Enable(bool bDoEnable = TRUE);
44 virtual void Check(bool bDoCheck = TRUE);
519cb848 45
f3fb0a07 46 virtual void SetBitmap(const wxBitmap& bitmap) ;
d062e17f
GD
47 virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
48
e40298d5
JS
49 // update the os specific representation
50 void UpdateItemBitmap() ;
51 void UpdateItemText() ;
52 void UpdateItemStatus() ;
519cb848 53
f3fb0a07
SC
54 // mark item as belonging to the given radio group
55 void SetAsRadioGroupStart();
56 void SetRadioGroupStart(int start);
57 void SetRadioGroupEnd(int end);
05adb9d2 58
0dbd6262 59private:
f3fb0a07
SC
60 void UncheckRadio() ;
61
62 // the positions of the first and last items of the radio group this item
63 // belongs to or -1: start is the radio group start and is valid for all
64 // but first radio group items (m_isRadioGroupStart == FALSE), end is valid
65 // only for the first one
66 union
67 {
68 int start;
69 int end;
70 } m_radioGroup;
71
72 // does this item start a radio group?
73 bool m_isRadioGroupStart;
74
d062e17f 75 wxBitmap m_bitmap; // Bitmap for menuitem, if any
ac398c14 76 void* m_menu ; // the appropriate menu , may also be a system menu
d062e17f 77
519cb848 78 DECLARE_DYNAMIC_CLASS(wxMenuItem)
0dbd6262
SC
79};
80
81#endif //_MENUITEM_H