X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/afe06a5457cb38b1243d9cb2160fe1e0e28f6478..d1a6e2b7a103d761fbc15e0e9c1c20ab53a849d9:/contrib/src/xrc/xh_unkwn.cpp?ds=sidebyside diff --git a/contrib/src/xrc/xh_unkwn.cpp b/contrib/src/xrc/xh_unkwn.cpp index 388fb040c3..cad645b68b 100644 --- a/contrib/src/xrc/xh_unkwn.cpp +++ b/contrib/src/xrc/xh_unkwn.cpp @@ -34,8 +34,10 @@ public: wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL | wxNO_BORDER) - : wxPanel(parent, id, pos, size, style, + long style = 0) + // Always add the wxTAB_TRAVERSAL and wxNO_BORDER styles to what comes + // from the XRC if anything. + : wxPanel(parent, id, pos, size, style | wxTAB_TRAVERSAL | wxNO_BORDER, controlName + wxT("_container")), m_controlName(controlName), m_controlAdded(false) { @@ -88,12 +90,14 @@ 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, GetPosition(), GetSize(), - GetStyle(wxT("style"), - wxTAB_TRAVERSAL | wxNO_BORDER)); + GetStyle(wxT("style"))); SetupWindow(panel); return panel; }