X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66619ee50c63df5e232f8450757cf50e20ed94d9..6493aacaeb7b22b9fa35c559f7753e9fec0da71f:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index fd499ea6fe..a536833274 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -863,7 +863,7 @@ wxGenericTreeCtrl::~wxGenericTreeCtrl() // accessors // ----------------------------------------------------------------------------- -size_t wxGenericTreeCtrl::GetCount() const +unsigned int wxGenericTreeCtrl::GetCount() const { if ( !m_anchor ) { @@ -871,7 +871,7 @@ size_t wxGenericTreeCtrl::GetCount() const return 0; } - size_t count = m_anchor->GetChildrenCount(); + unsigned int count = m_anchor->GetChildrenCount(); if ( !HasFlag(wxTR_HIDE_ROOT) ) { // take the root itself into account @@ -2323,7 +2323,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level if (IsExposed(exposed_x, exposed_y, 10000, h)) // 10000 = very much { - wxPen *pen = + const wxPen *pen = #ifndef __WXMAC__ // don't draw rect outline if we already have the // background color under Mac @@ -2887,12 +2887,9 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item, wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem; - int startX, startY; - GetViewStart(& startX, & startY); - if ( textOnly ) { - rect.x = i->GetX() - startX*PIXELS_PER_UNIT; + rect.x = i->GetX(); rect.width = i->GetWidth(); if ( m_imageListNormal ) @@ -2908,9 +2905,12 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item, rect.width = GetClientSize().x; } - rect.y = i->GetY() - startY*PIXELS_PER_UNIT; + rect.y = i->GetY(); rect.height = GetLineHeight(i); + // we have to return the logical coordinates, not physical ones + rect.SetTopLeft(CalcScrolledPosition(rect.GetTopLeft())); + return true; }