]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/menuitem.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/menuitem.cpp
3 // Purpose: wxMenuItem implementation
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
29 #include "wx/menuitem.h"
33 #include "wx/bitmap.h"
34 #include "wx/settings.h"
35 #include "wx/window.h"
37 #include "wx/string.h"
46 // ---------------------------------------------------------------------------
48 // ---------------------------------------------------------------------------
50 // conditional compilation
52 #define OWNER_DRAWN_ONLY( code ) if ( IsOwnerDrawn() ) code
53 #else // !wxUSE_OWNER_DRAWN
54 #define OWNER_DRAWN_ONLY( code )
55 #endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN
57 // ============================================================================
59 // ============================================================================
61 // ----------------------------------------------------------------------------
63 // ----------------------------------------------------------------------------
68 wxMenuItem::wxMenuItem(wxMenu
*pParentMenu
,
71 const wxString
& strHelp
,
74 : wxMenuItemBase(pParentMenu
, id
, text
, strHelp
, kind
, pSubMenu
)
76 , wxOwnerDrawn(text
, kind
== wxITEM_CHECK
, true)
81 wxMenuItem::wxMenuItem(wxMenu
*parentMenu
,
87 : wxMenuItemBase(parentMenu
, id
, text
, help
,
88 isCheckable
? wxITEM_CHECK
: wxITEM_NORMAL
, subMenu
)
90 , wxOwnerDrawn(text
, isCheckable
, true)
95 void wxMenuItem::Init()
99 wxMenuItem::~wxMenuItem()
109 bool wxMenuItem::IsChecked() const
117 void wxMenuItem::SetAsRadioGroupStart()
121 void wxMenuItem::SetRadioGroupStart(int start
)
125 void wxMenuItem::SetRadioGroupEnd(int end
)
132 void wxMenuItem::Enable(bool enable
)
136 void wxMenuItem::Check(bool check
)
140 void wxMenuItem::SetItemLabel(const wxString
& text
)
144 void wxMenuItem::SetCheckable(bool checkable
)
148 // ----------------------------------------------------------------------------
150 // ----------------------------------------------------------------------------
152 wxMenuItem
*wxMenuItemBase::New(wxMenu
*parentMenu
,
154 const wxString
& name
,
155 const wxString
& help
,
159 return new wxMenuItem(parentMenu
, id
, name
, help
, kind
, subMenu
);
162 #endif // wxUSE_MENUS