X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1cc09bb6f0c0a75ab84ec147ba41f84d979766b..b2371711d0cd187826ce41ff69703d635e71df8d:/src/xrc/xh_unkwn.cpp diff --git a/src/xrc/xh_unkwn.cpp b/src/xrc/xh_unkwn.cpp index 4ff1733125..84c0158ff1 100644 --- a/src/xrc/xh_unkwn.cpp +++ b/src/xrc/xh_unkwn.cpp @@ -31,7 +31,7 @@ class wxUnknownControlContainer : public wxPanel public: wxUnknownControlContainer(wxWindow *parent, const wxString& controlName, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0) @@ -68,7 +68,6 @@ void wxUnknownControlContainer::AddChild(wxWindowBase *child) wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add((wxWindow*)child, 1, wxEXPAND); SetSizer(sizer); - SetAutoLayout(true); Layout(); } @@ -90,9 +89,12 @@ wxUnknownWidgetXmlHandler::wxUnknownWidgetXmlHandler() wxObject *wxUnknownWidgetXmlHandler::DoCreateResource() { + wxASSERT_MSG( m_instance == NULL, + _T("'unknown' controls can't be subclassed, use wxXmlResource::AttachUnknownControl") ); + wxPanel *panel = new wxUnknownControlContainer(m_parentAsWindow, - GetName(), -1, + GetName(), wxID_ANY, GetPosition(), GetSize(), GetStyle(wxT("style"))); SetupWindow(panel);