]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_split.cpp
Further refine of #15226: wxRichTextCtrl: Implement setting properties with undo...
[wxWidgets.git] / src / xrc / xh_split.cpp
index f9e89a36bdc5ec0bd38da43a73a8037448aae5a2..6f15a3bb1cd53f230fc1a547c17751e554b31d79 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     XRC resource for wxSplitterWindow
 // Author:      panga@freemail.hu, Vaclav Slavik
 // Created:     2003/01/26
-// RCS-ID:      $Id$
 // Copyright:   (c) 2003 panga@freemail.hu, Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
     #pragma hdrstop
 #endif
 
-#if wxUSE_XRC
+#if wxUSE_XRC && wxUSE_SPLITTER
 
 #include "wx/xrc/xh_split.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/log.h"
+#endif
+
 #include "wx/splitter.h"
-#include "wx/log.h"
+
+#include "wx/xml/xml.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindowXmlHandler, wxXmlResourceHandler)
 
@@ -51,10 +56,13 @@ wxObject *wxSplitterWindowXmlHandler::DoCreateResource()
 
     SetupWindow(splitter);
 
-    long sashpos = GetLong(wxT("sashpos"), 0);
-    long minpanesize = GetLong(wxT("minsize"), -1);
+    long sashpos = GetDimension(wxT("sashpos"), 0);
+    long minpanesize = GetDimension(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();
@@ -80,7 +88,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)
@@ -103,4 +111,4 @@ bool wxSplitterWindowXmlHandler::CanHandle(wxXmlNode *node)
      return IsOfClass(node, wxT("wxSplitterWindow"));
 }
 
-#endif // wxUSE_XRC
+#endif // wxUSE_XRC && wxUSE_SPLITTER