X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb29e7071f01834400fda4c51b5fb7717374be76..892aeafc2a0212b4c3bebcaddd96a42cdd307afd:/contrib/src/gizmos/splittree.cpp diff --git a/contrib/src/gizmos/splittree.cpp b/contrib/src/gizmos/splittree.cpp index 76cd79471c..d1911ee8e3 100644 --- a/contrib/src/gizmos/splittree.cpp +++ b/contrib/src/gizmos/splittree.cpp @@ -106,6 +106,26 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPer } } +// In case we're using the generic tree control. +int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const +{ + wxScrolledWindow* scrolledWindow = GetScrolledWindow(); + + if (IsKindOf(CLASSINFO(wxGenericTreeCtrl))) + { + wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this; + + if (orient == wxHORIZONTAL) + return win->wxGenericTreeCtrl::GetScrollPos(orient); + else + { + return scrolledWindow->GetScrollPos(orient); + } + } + return 0; +} + + // In case we're using the generic tree control. // Get the view start void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const @@ -318,7 +338,7 @@ void wxRemotelyScrolledTreeCtrl::OnScroll(wxScrollWinEvent& event) int orient = event.GetOrientation(); if (orient == wxHORIZONTAL) { - // Don't 'skip' or we'd get into infinite recursion + event.Skip(); return; } wxScrolledWindow* scrollWin = GetScrolledWindow(); @@ -383,7 +403,7 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event) if (!m_treeCtrl) return; - wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); + wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); dc.SetPen(pen); dc.SetBrush(* wxTRANSPARENT_BRUSH); wxFont font(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); @@ -400,14 +420,14 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event) cy = itemRect.GetTop(); wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight()); - dc.DrawLine(0, cy, clientSize.x, cy); lastH = h; // Draw the actual item DrawItem(dc, h, drawItemRect); + dc.DrawLine(0, cy, clientSize.x, cy); } } - if (m_treeCtrl->GetBoundingRect(lastH, itemRect)) + if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect)) { cy = itemRect.GetBottom(); dc.DrawLine(0, cy, clientSize.x, cy); @@ -419,7 +439,7 @@ void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event) int orient = event.GetOrientation(); if (orient == wxHORIZONTAL) { - // Don't 'skip' or we'd get into infinite recursion + event.Skip(); return; } if (!m_treeCtrl) @@ -553,7 +573,7 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event) if (inOnScroll) return; inOnScroll = TRUE; - + int orient = event.GetOrientation(); int nScrollInc = CalcScrollInc(event); @@ -565,8 +585,13 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event) if (orient == wxHORIZONTAL) { + inOnScroll = FALSE; + event.Skip(); + return; +#if 0 int newPos = m_xScrollPosition + nScrollInc; SetScrollPos(wxHORIZONTAL, newPos, TRUE ); +#endif } else {