]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/splitter/splitter.cpp
Revert the zoom direction on Ctrl-mouse wheel in wxStyledTextCtrl.
[wxWidgets.git] / samples / splitter / splitter.cpp
index cd05d8ab8839625c1d62336237b35c23b156cb1b..1884138e60a5a9e039bebd2963d29836007f65a6 100644 (file)
@@ -39,7 +39,7 @@
 #include "wx/splitter.h"
 #include "wx/dcmirror.h"
 
-#ifndef __WXMSW__
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
@@ -257,6 +257,12 @@ MyFrame::MyFrame()
     menuBar->Check(SPLIT_LIVE, true);
     m_splitter = new MySplitterWindow(this);
 
+    // If you use non-zero gravity you must initialize the splitter with its
+    // correct initial size, otherwise it will change the sash position by a
+    // huge amount when it's resized from its initial default size to its real
+    // size when the frame lays it out. This wouldn't be necessary if default
+    // zero gravity were used (although it would do no harm neither).
+    m_splitter->SetSize(GetClientSize());
     m_splitter->SetSashGravity(1.0);
 
 #if 1