Fixed jumping problem with remotely scrolled tree
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -78,6 +78,9 @@ public:
|
|||||||
// In case we're using the generic tree control.
|
// In case we're using the generic tree control.
|
||||||
virtual void PrepareDC(wxDC& dc);
|
virtual void PrepareDC(wxDC& dc);
|
||||||
|
|
||||||
|
// In case we're using the generic tree control.
|
||||||
|
virtual int GetScrollPos(int orient) const;
|
||||||
|
|
||||||
//// Helpers
|
//// Helpers
|
||||||
void HideVScrollbar();
|
void HideVScrollbar();
|
||||||
|
|
||||||
|
@@ -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.
|
// In case we're using the generic tree control.
|
||||||
// Get the view start
|
// Get the view start
|
||||||
void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
|
void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
|
||||||
@@ -383,7 +403,7 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event)
|
|||||||
if (!m_treeCtrl)
|
if (!m_treeCtrl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
|
wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
|
||||||
dc.SetPen(pen);
|
dc.SetPen(pen);
|
||||||
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
||||||
wxFont font(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
wxFont font(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||||
@@ -400,11 +420,11 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event)
|
|||||||
cy = itemRect.GetTop();
|
cy = itemRect.GetTop();
|
||||||
wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
|
wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
|
||||||
|
|
||||||
dc.DrawLine(0, cy, clientSize.x, cy);
|
|
||||||
lastH = h;
|
lastH = h;
|
||||||
|
|
||||||
// Draw the actual item
|
// Draw the actual item
|
||||||
DrawItem(dc, h, drawItemRect);
|
DrawItem(dc, h, drawItemRect);
|
||||||
|
dc.DrawLine(0, cy, clientSize.x, cy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_treeCtrl->GetBoundingRect(lastH, itemRect))
|
if (m_treeCtrl->GetBoundingRect(lastH, itemRect))
|
||||||
|
Reference in New Issue
Block a user