X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/544fee32eeac1a4f6ca3e0c7c1b13ee24f1d1c1c..b1b3ddd840a507f3ca85379bfa832f2b0c9105d6:/src/xrc/xh_sizer.cpp diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp index 09a1bbc43a..2a1bbf8eb9 100644 --- a/src/xrc/xh_sizer.cpp +++ b/src/xrc/xh_sizer.cpp @@ -24,6 +24,7 @@ #include "wx/log.h" #include "wx/statbox.h" #include "wx/notebook.h" +#include "wx/panel.h" #include "wx/tokenzr.h" bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node) @@ -68,6 +69,8 @@ wxSizerXmlHandler::wxSizerXmlHandler() XRC_ADD_STYLE(wxALIGN_CENTRE_HORIZONTAL); XRC_ADD_STYLE(wxALIGN_CENTER_VERTICAL); XRC_ADD_STYLE(wxALIGN_CENTRE_VERTICAL); + + XRC_ADD_STYLE(wxADJUST_MINSIZE); } @@ -136,10 +139,12 @@ wxObject *wxSizerXmlHandler::DoCreateResource() wxXmlNode *parentNode = m_node->GetParent(); wxCHECK_MSG(m_parentSizer != NULL || - ((IsOfClass(parentNode, wxT("wxPanel")) || - IsOfClass(parentNode, wxT("wxDialog"))) && - parentNode->GetType() == wxXML_ELEMENT_NODE), NULL, - wxT("Incorrect use of sizer: parent is not 'wxDialog' or 'wxPanel'.")); + (parentNode->GetType() == wxXML_ELEMENT_NODE && + (m_parentAsWindow->IsKindOf(CLASSINFO(wxPanel)) || + m_parentAsWindow->IsKindOf(CLASSINFO(wxFrame)) || + m_parentAsWindow->IsKindOf(CLASSINFO(wxDialog))) + ), NULL, + wxT("Incorrect use of sizer: parent is not 'wxDialog', 'wxFrame' or 'wxPanel'.")); if (m_class == wxT("wxBoxSizer")) sizer = new wxBoxSizer(GetStyle(wxT("orient"), wxHORIZONTAL)); @@ -147,7 +152,12 @@ wxObject *wxSizerXmlHandler::DoCreateResource() else if (m_class == wxT("wxStaticBoxSizer")) { sizer = new wxStaticBoxSizer( - new wxStaticBox(m_parentAsWindow, -1, GetText(wxT("label"))), + new wxStaticBox(m_parentAsWindow, + GetID(), + GetText(wxT("label")), + wxDefaultPosition, wxDefaultSize, + 0/*style*/, + GetName()), GetStyle(wxT("orient"), wxHORIZONTAL)); }