]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_sizer.cpp
Remove m_blockEvents and use Disable/Enable instead, some more rearraging
[wxWidgets.git] / src / xrc / xh_sizer.cpp
index 4b5f0b03aa1af7ab80faac575e33af12472ca8f8..2e6bc72c4a89c0a91e01f981797707d3cf7ca493 100644 (file)
@@ -31,6 +31,7 @@
 #endif
 
 #include "wx/gbsizer.h"
+#include "wx/wrapsizer.h"
 #include "wx/notebook.h"
 #include "wx/tokenzr.h"
 
@@ -78,6 +79,11 @@ wxSizerXmlHandler::wxSizerXmlHandler()
     XRC_ADD_STYLE(wxALIGN_CENTRE_VERTICAL);
 
     XRC_ADD_STYLE(wxFIXED_MINSIZE);
+    XRC_ADD_STYLE(wxRESERVE_SPACE_EVEN_IF_HIDDEN);
+
+    // wxWrapSizer-specific flags
+    XRC_ADD_STYLE(wxEXTEND_LAST_ON_EACH_LINE);
+    XRC_ADD_STYLE(wxREMOVE_LEADING_SPACES);
 }
 
 
@@ -112,7 +118,8 @@ bool wxSizerXmlHandler::IsSizerNode(wxXmlNode *node)
            (IsOfClass(node, wxT("wxStaticBoxSizer"))) ||
            (IsOfClass(node, wxT("wxGridSizer"))) ||
            (IsOfClass(node, wxT("wxFlexGridSizer"))) ||
-           (IsOfClass(node, wxT("wxGridBagSizer")));
+           (IsOfClass(node, wxT("wxGridBagSizer"))) ||
+           (IsOfClass(node, wxT("wxWrapSizer")));
 }
 
 
@@ -205,6 +212,9 @@ wxObject* wxSizerXmlHandler::Handle_sizer()
     else if (m_class == wxT("wxGridBagSizer"))
         sizer = Handle_wxGridBagSizer();
 
+    else if (m_class == wxT("wxWrapSizer"))
+        sizer = Handle_wxWrapSizer();
+
     if ( !sizer )
     {
         wxLogError(_T("Failed to create size of class \"%s\""), m_class.c_str());
@@ -305,6 +315,11 @@ wxSizer*  wxSizerXmlHandler::Handle_wxGridBagSizer()
     return sizer;
 }
 
+wxSizer*  wxSizerXmlHandler::Handle_wxWrapSizer()
+{
+    wxWrapSizer *sizer = new wxWrapSizer(GetStyle("orient"), GetStyle("flag"));
+    return sizer;
+}