X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd47af27e12ee66b3e9eed6f1711e516f36dc837..43f4e852a1b2ac37c3db6a2b87315192ac549191:/src/xrc/xh_split.cpp diff --git a/src/xrc/xh_split.cpp b/src/xrc/xh_split.cpp index be23b871f5..7e3175c657 100644 --- a/src/xrc/xh_split.cpp +++ b/src/xrc/xh_split.cpp @@ -25,6 +25,8 @@ #include "wx/splitter.h" +#include "wx/xml/xml.h" + IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindowXmlHandler, wxXmlResourceHandler) wxSplitterWindowXmlHandler::wxSplitterWindowXmlHandler() : wxXmlResourceHandler() @@ -57,8 +59,11 @@ wxObject *wxSplitterWindowXmlHandler::DoCreateResource() long sashpos = GetLong(wxT("sashpos"), 0); long minpanesize = GetLong(wxT("minsize"), -1); + float gravity = GetFloat(wxT("gravity"), 0.0); if (minpanesize != -1) - splitter->SetMinimumPaneSize(minpanesize); + splitter->SetMinimumPaneSize(minpanesize); + if (gravity != 0.0) + splitter->SetSashGravity(gravity); wxWindow *win1 = NULL, *win2 = NULL; wxXmlNode *n = m_node->GetChildren(); @@ -84,7 +89,7 @@ wxObject *wxSplitterWindowXmlHandler::DoCreateResource() } if (win1 == NULL) - wxLogError(wxT("wxSplitterWindow node must contain at least one window.")); + ReportError("wxSplitterWindow node must contain at least one window"); bool horizontal = (GetParamValue(wxT("orientation")) != wxT("vertical")); if (win1 && win2)