]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/menuitem.h
Remove RPM .spec files from the repository.
[wxWidgets.git] / include / wx / osx / menuitem.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/menuitem.h
3 // Purpose: wxMenuItem class
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 11.11.97
7 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _MENUITEM_H
12 #define _MENUITEM_H
13
14 // ----------------------------------------------------------------------------
15 // headers
16 // ----------------------------------------------------------------------------
17
18 #include "wx/defs.h"
19 #include "wx/bitmap.h"
20
21 // ----------------------------------------------------------------------------
22 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
23 // ----------------------------------------------------------------------------
24
25 class WXDLLIMPEXP_FWD_CORE wxMenuItemImpl ;
26
27 class WXDLLIMPEXP_CORE wxMenuItem: public wxMenuItemBase
28 {
29 public:
30 // ctor & dtor
31 wxMenuItem(wxMenu *parentMenu = NULL,
32 int id = wxID_SEPARATOR,
33 const wxString& name = wxEmptyString,
34 const wxString& help = wxEmptyString,
35 wxItemKind kind = wxITEM_NORMAL,
36 wxMenu *subMenu = NULL);
37 virtual ~wxMenuItem();
38
39 // override base class virtuals
40 virtual void SetItemLabel(const wxString& strName);
41
42 virtual void Enable(bool bDoEnable = true);
43 virtual void Check(bool bDoCheck = true);
44
45 virtual void SetBitmap(const wxBitmap& bitmap) ;
46 virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
47
48
49 // Implementation only from now on.
50
51 // update the os specific representation
52 void UpdateItemBitmap() ;
53 void UpdateItemText() ;
54 void UpdateItemStatus() ;
55
56 // mark item as belonging to the given radio group
57 void SetAsRadioGroupStart(bool start = true);
58 void SetRadioGroupStart(int start);
59 void SetRadioGroupEnd(int end);
60
61 // return true if this is the starting item of a radio group
62 bool IsRadioGroupStart() const;
63
64 // get the start of the radio group this item belongs to: should not be
65 // called for the starting radio group item itself because it doesn't have
66 // this information
67 int GetRadioGroupStart() const;
68
69 // get the end of the radio group this item belongs to: should be only
70 // called for the starting radio group item, i.e. if IsRadioGroupStart() is
71 // true
72 int GetRadioGroupEnd() const;
73
74 wxMenuItemImpl* GetPeer() { return m_peer; }
75 private:
76 void UncheckRadio() ;
77
78 // the positions of the first and last items of the radio group this item
79 // belongs to or -1: start is the radio group start and is valid for all
80 // but first radio group items (m_isRadioGroupStart == FALSE), end is valid
81 // only for the first one
82 union
83 {
84 int start;
85 int end;
86 } m_radioGroup;
87
88 // does this item start a radio group?
89 bool m_isRadioGroupStart;
90
91 wxBitmap m_bitmap; // Bitmap for menuitem, if any
92
93 wxMenuItemImpl* m_peer;
94
95 DECLARE_DYNAMIC_CLASS(wxMenuItem)
96 };
97
98 #endif //_MENUITEM_H