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