X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f80ea77b4a8bac4ab005bfc592f9cd3262ffa397..370dc79c5a7fd9ac24fb001e38388a210750e2e7:/src/xrc/xh_menu.cpp diff --git a/src/xrc/xh_menu.cpp b/src/xrc/xh_menu.cpp index dbe2a89e61..5b13b5be3c 100644 --- a/src/xrc/xh_menu.cpp +++ b/src/xrc/xh_menu.cpp @@ -8,10 +8,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "xh_menu.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -19,6 +15,8 @@ #pragma hdrstop #endif +#if wxUSE_XRC + #include "wx/xrc/xh_menu.h" #include "wx/menu.h" #include "wx/frame.h" @@ -46,12 +44,18 @@ wxObject *wxMenuXmlHandler::DoCreateResource() wxMenuBar *p_bar = wxDynamicCast(m_parent, wxMenuBar); if (p_bar) + { p_bar->Append(menu, title); + } else { wxMenu *p_menu = wxDynamicCast(m_parent, wxMenu); if (p_menu) + { p_menu->Append(GetID(), title, menu, help); + if (HasParam(wxT("enabled"))) + p_menu->Enable(GetID(), GetBool(wxT("enabled"))); + } } return menu; @@ -86,7 +90,7 @@ wxObject *wxMenuXmlHandler::DoCreateResource() wxMenuItem *mitem = new wxMenuItem(p_menu, id, fullLabel, GetText(wxT("help")), kind); -#if wxCHECK_VERSION(2,3,0) || (defined(__WXMSW__) && wxUSE_OWNER_DRAWN) +#if (!defined(__WXMSW__) && !defined(__WXPM__)) || wxUSE_OWNER_DRAWN if (HasParam(wxT("bitmap"))) mitem->SetBitmap(GetBitmap(wxT("bitmap"), wxART_MENU)); #endif @@ -139,3 +143,5 @@ bool wxMenuBarXmlHandler::CanHandle(wxXmlNode *node) { return IsOfClass(node, wxT("wxMenuBar")); } + +#endif // wxUSE_XRC