-
-
Notifications
You must be signed in to change notification settings - Fork 314
/
IListRowLocator.cs
38 lines (37 loc) · 1.67 KB
/
IListRowLocator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace MonoGame.Extended.NuclexGui.Controls.Desktop
{
/// <summary>
/// Interface which can be established between a control and its renderer to
/// allow a list control to locate the list row the cursor is in
/// </summary>
/// <remarks>
/// A renderer can implement this interface and assign it to a control that
/// it renders so the control can ask the renderer for extended informations
/// regarding the look of its text. If this interface is provided, certain
/// controls will be able to correctly place the caret in user-editable text
/// when they are clicked by the mouse.
/// </remarks>
public interface IListRowLocator
{
/// <summary>Calculates the list row the cursor is in</summary>
/// <param name="bounds">
/// Boundaries of the control, should be in absolute coordinates
/// </param>
/// <param name="thumbPosition">
/// Position of the thumb in the list's slider
/// </param>
/// <param name="itemCount">
/// Number of items contained in the list
/// </param>
/// <param name="y">Vertical position of the cursor</param>
/// <returns>The row the cursor is over</returns>
int GetRow(RectangleF bounds, float thumbPosition, int itemCount, float y);
/// <summary>Determines the height of a row displayed in the list</summary>
/// <param name="bounds">
/// Boundaries of the control, should be in absolute coordinates
/// </param>
/// <returns>The height of a single row in the list</returns>
float GetRowHeight(RectangleF bounds);
}
}