1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
4 using System
.Collections
.Generic
;
8 namespace Aga
.Controls
.Tree
10 internal class FixedRowHeightLayout
: IRowLayout
12 private TreeViewAdv _treeView
;
14 public FixedRowHeightLayout(TreeViewAdv treeView
, int rowHeight
)
17 PreferredRowHeight
= rowHeight
;
20 private int _rowHeight
;
21 public int PreferredRowHeight
23 get { return _rowHeight; }
24 set { _rowHeight = value; }
27 public Rectangle
GetRowBounds(int rowNo
)
29 return new Rectangle(0, rowNo
* _rowHeight
, 0, _rowHeight
);
32 public int PageRowCount
36 return Math
.Max((_treeView
.DisplayRectangle
.Height
- _treeView
.ColumnHeaderHeight
) / _rowHeight
, 0);
40 public int CurrentPageSize
48 public int GetRowAt(Point point
)
50 point
= new Point(point
.X
, point
.Y
+ (_treeView
.FirstVisibleRow
* _rowHeight
) - _treeView
.ColumnHeaderHeight
);
51 return point
.Y
/ _rowHeight
;
54 public int GetFirstRow(int lastPageRow
)
56 return Math
.Max(0, lastPageRow
- PageRowCount
+ 1);
59 public void ClearCache()