X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63ec9dbbacaf363b67aa540896a2795c39dfe74b..44ba8f0ea92f65d9893ce0780971745a5d8e80ea:/src/generic/splitter.cpp diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index c6841bc9dc..1506cffcd7 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -272,7 +272,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) { SetResizeCursor(); } -#if defined(__WXGTK__) || defined(__WXMSW__) +#if defined(__WXGTK__) || defined(__WXMSW__) || defined(__WXMAC__) else { // We must set the normal cursor in MSW, because @@ -294,6 +294,11 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) #endif // __WXMSW__ int diff = m_splitMode == wxSPLIT_VERTICAL ? x - m_oldX : y - m_oldY; + if ( !diff ) + { + // nothing to do, mouse didn't really move far enough + return; + } int posSashOld = isLive ? m_sashPosition : m_sashPositionCurrent; int posSashNew = OnSashPositionChanging(posSashOld + diff); @@ -800,6 +805,9 @@ void wxSplitterWindow::SizeWindows() // Set pane for unsplit window void wxSplitterWindow::Initialize(wxWindow *window) { + wxASSERT_MSG( window->GetParent() == this, + _T("windows in the splitter should have it as parent!") ); + m_windowOne = window; m_windowTwo = (wxWindow *) NULL; DoSetSashPosition(0); @@ -815,6 +823,9 @@ bool wxSplitterWindow::DoSplit(wxSplitMode mode, if ( IsSplit() ) return FALSE; + wxASSERT_MSG( window1->GetParent() == this && window2->GetParent() == this, + _T("windows in the splitter should have it as parent!") ); + m_splitMode = mode; m_windowOne = window1; m_windowTwo = window2;