]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/menuitem.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/menuitem.h
3 // Purpose: wxMenuItem class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
20 #include "wx/bitmap.h"
22 // ----------------------------------------------------------------------------
23 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
24 // ----------------------------------------------------------------------------
25 class WXDLLEXPORT wxMenuItem
: public wxMenuItemBase
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();
37 // override base class virtuals
38 virtual void SetItemLabel(const wxString
& strName
);
40 virtual void Enable(bool bDoEnable
= true);
41 virtual void Check(bool bDoCheck
= true);
43 virtual void SetBitmap(const wxBitmap
& bitmap
) ;
44 virtual const wxBitmap
& GetBitmap() const { return m_bitmap
; }
46 // update the os specific representation
47 void UpdateItemBitmap() ;
48 void UpdateItemText() ;
49 void UpdateItemStatus() ;
51 // mark item as belonging to the given radio group
52 void SetAsRadioGroupStart();
53 void SetRadioGroupStart(int start
);
54 void SetRadioGroupEnd(int end
);
57 void DoUpdateItemBitmap( WXHMENU menu
, wxUint16 index
) ;
61 // the positions of the first and last items of the radio group this item
62 // belongs to or -1: start is the radio group start and is valid for all
63 // but first radio group items (m_isRadioGroupStart == FALSE), end is valid
64 // only for the first one
71 // does this item start a radio group?
72 bool m_isRadioGroupStart
;
74 wxBitmap m_bitmap
; // Bitmap for menuitem, if any
75 void* m_menu
; // the appropriate menu , may also be a system menu
77 DECLARE_DYNAMIC_CLASS(wxMenuItem
)