Make it possible to subclass wxMenuBar in XRC (patch #11679).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e03951b772
commit
10ff14524b
@ -148,7 +148,17 @@ wxMenuBarXmlHandler::wxMenuBarXmlHandler() : wxXmlResourceHandler()
|
||||
|
||||
wxObject *wxMenuBarXmlHandler::DoCreateResource()
|
||||
{
|
||||
wxMenuBar *menubar = new wxMenuBar(GetStyle());
|
||||
wxMenuBar *menubar = NULL;
|
||||
|
||||
const int style = GetStyle();
|
||||
wxASSERT_MSG(!style || !m_instance,
|
||||
"cannot use <style> with pre-created menubar");
|
||||
|
||||
if ( m_instance )
|
||||
menubar = wxDynamicCast(m_instance, wxMenuBar);
|
||||
if ( !menubar )
|
||||
menubar = new wxMenuBar(style);
|
||||
|
||||
CreateChildren(menubar);
|
||||
|
||||
if (m_parentAsWindow)
|
||||
|
Loading…
Reference in New Issue
Block a user