X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4db172a3b318df9aff178eb6c5da149d56e0859..54e660f85e8525cc0d0cb0ca7a5c01f931e3ed62:/src/xrc/xh_split.cpp diff --git a/src/xrc/xh_split.cpp b/src/xrc/xh_split.cpp index f1dc831246..e14300f4f9 100644 --- a/src/xrc/xh_split.cpp +++ b/src/xrc/xh_split.cpp @@ -15,7 +15,7 @@ #pragma hdrstop #endif -#if wxUSE_XRC +#if wxUSE_XRC && wxUSE_SPLITTER #include "wx/xrc/xh_split.h" @@ -57,8 +57,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 +87,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) @@ -107,4 +110,4 @@ bool wxSplitterWindowXmlHandler::CanHandle(wxXmlNode *node) return IsOfClass(node, wxT("wxSplitterWindow")); } -#endif // wxUSE_XRC +#endif // wxUSE_XRC && wxUSE_SPLITTER