+}
+
+int wxSplitterWindow::GetWindowSize() const
+{
+ wxSize size = GetClientSize();
+
+ return m_splitMode == wxSPLIT_VERTICAL ? size.x : size.y;
+}
+
+int wxSplitterWindow::AdjustSashPosition(int sashPos) const
+{
+ wxWindow *win;
+
+ win = GetWindow1();
+ if ( win )
+ {
+ // the window shouldn't be smaller than its own minimal size nor
+ // smaller than the minimual pane size specified for this splitter
+ int minSize = m_splitMode == wxSPLIT_VERTICAL ? win->GetMinWidth()
+ : win->GetMinHeight();
+
+ if ( minSize == -1 || m_minimumPaneSize > minSize )
+ minSize = m_minimumPaneSize;
+
+ minSize += GetBorderSize();
+
+ if ( sashPos < minSize )
+ sashPos = minSize;
+ }
+
+ win = GetWindow2();
+ if ( win )
+ {
+ int minSize = m_splitMode == wxSPLIT_VERTICAL ? win->GetMinWidth()
+ : win->GetMinHeight();
+
+ if ( minSize == -1 || m_minimumPaneSize > minSize )
+ minSize = m_minimumPaneSize;
+
+ int maxSize = GetWindowSize() - minSize - GetBorderSize() - GetSashSize();
+ if ( maxSize > 0 && sashPos > maxSize )
+ sashPos = maxSize;
+ }
+
+ return sashPos;
+}
+
+bool wxSplitterWindow::DoSetSashPosition(int sashPos)
+{
+ int newSashPosition = AdjustSashPosition(sashPos);
+
+ if ( newSashPosition == m_sashPosition )
+ return false;
+
+ m_sashPosition = newSashPosition;