X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ea0d8ca6e89a677871a214f5e4e8c50422a0cfb8..86b79b93fbbb0c2e90e6595f7fea0f979b80881c:/src/xrc/xh_sizer.cpp diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp index 5022ffb8f4..2e3f3e4908 100644 --- a/src/xrc/xh_sizer.cpp +++ b/src/xrc/xh_sizer.cpp @@ -71,6 +71,7 @@ wxSizerXmlHandler::wxSizerXmlHandler() XRC_ADD_STYLE(wxALIGN_CENTRE_VERTICAL); XRC_ADD_STYLE(wxADJUST_MINSIZE); + XRC_ADD_STYLE(wxFIXED_MINSIZE); } @@ -121,7 +122,6 @@ wxObject* wxSizerXmlHandler::Handle_sizeritem() { // create a sizer item for it wxSizerItem* sitem = MakeSizerItem(); - SetSizerItemAttributes(sitem); // now fetch the item to be managed bool old_gbs = m_isGBS; @@ -145,6 +145,9 @@ wxObject* wxSizerXmlHandler::Handle_sizeritem() else wxLogError(wxT("Error in resource.")); + // finally, set other wxSizerItem attributes + SetSizerItemAttributes(sitem); + AddSizerItem(sitem); return item; } @@ -175,7 +178,7 @@ wxObject* wxSizerXmlHandler::Handle_sizer() wxXmlNode *parentNode = m_node->GetParent(); wxCHECK_MSG(m_parentSizer != NULL || - (parentNode->GetType() == wxXML_ELEMENT_NODE && + (parentNode && parentNode->GetType() == wxXML_ELEMENT_NODE && m_parentAsWindow != NULL && (m_parentAsWindow->IsKindOf(CLASSINFO(wxPanel)) || m_parentAsWindow->IsKindOf(CLASSINFO(wxFrame)) || @@ -206,7 +209,6 @@ wxObject* wxSizerXmlHandler::Handle_sizer() // save state wxSizer *old_par = m_parentSizer; bool old_ins = m_isInside; - bool old_gbs = m_isGBS; // set new state m_parentSizer = sizer; @@ -216,7 +218,6 @@ wxObject* wxSizerXmlHandler::Handle_sizer() CreateChildren(m_parent, TRUE/*only this handler*/); // restore state - old_gbs = m_isGBS; m_isInside = old_ins; m_parentSizer = old_par; @@ -340,7 +341,7 @@ void wxSizerXmlHandler::SetSizerItemAttributes(wxSizerItem* sitem) sitem->SetBorder(GetDimension(wxT("border"))); wxSize sz = GetSize(wxT("minsize")); if (!(sz == wxDefaultSize)) - sitem->SetInitSize(sz.x, sz.y); + sitem->SetMinSize(sz); sz = GetSize(wxT("ratio")); if (!(sz == wxDefaultSize)) sitem->SetRatio(sz);