!B (Sandbox) (CE-21795) Importing models with multisubmaterials via fbx switches...
[CRYENGINE.git] / Code / Tools / LuaRemoteDebugger / Aga.Controls / Tree / FixedRowHeightLayout.cs
blobd81eae939e90897556a9c932047f245b319e2c0c
1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
3 using System;
4 using System.Collections.Generic;
5 using System.Text;
6 using System.Drawing;
8 namespace Aga.Controls.Tree
10 internal class FixedRowHeightLayout : IRowLayout
12 private TreeViewAdv _treeView;
14 public FixedRowHeightLayout(TreeViewAdv treeView, int rowHeight)
16 _treeView = treeView;
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
34 get
36 return Math.Max((_treeView.DisplayRectangle.Height - _treeView.ColumnHeaderHeight) / _rowHeight, 0);
40 public int CurrentPageSize
42 get
44 return PageRowCount;
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()