mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 09:47:58 +01:00
Changed name to GetObjectRow
This commit is contained in:
@@ -622,7 +622,7 @@ namespace Terminal.Gui {
|
||||
/// </summary>
|
||||
/// <param name="toFind"></param>
|
||||
/// <returns></returns>
|
||||
public int? GetObjectYPosition(T toFind)
|
||||
public int? GetObjectRow(T toFind)
|
||||
{
|
||||
var idx = BuildLineMap ().IndexOf (o => o.Model.Equals (toFind));
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace UICatalog.Scenarios {
|
||||
if (selected == null)
|
||||
return;
|
||||
|
||||
var location = treeViewFiles.GetObjectYPosition (selected);
|
||||
var location = treeViewFiles.GetObjectRow (selected);
|
||||
|
||||
//selected object is offscreen or somehow not found
|
||||
if (location == null || location < 0 || location > treeViewFiles.Frame.Height)
|
||||
|
||||
@@ -770,7 +770,7 @@ namespace Terminal.Gui.Views {
|
||||
}
|
||||
|
||||
[Fact, AutoInitShutdown]
|
||||
public void TestGetObjectYPosition ()
|
||||
public void TestGetObjectRow ()
|
||||
{
|
||||
var tv = new TreeView { Width = 20, Height = 10 };
|
||||
|
||||
@@ -795,10 +795,10 @@ namespace Terminal.Gui.Views {
|
||||
└─pink
|
||||
", output);
|
||||
|
||||
Assert.Equal (0, tv.GetObjectYPosition (n1));
|
||||
Assert.Equal (1, tv.GetObjectYPosition (n1_1));
|
||||
Assert.Equal (2, tv.GetObjectYPosition (n1_2));
|
||||
Assert.Equal (3, tv.GetObjectYPosition (n2));
|
||||
Assert.Equal (0, tv.GetObjectRow (n1));
|
||||
Assert.Equal (1, tv.GetObjectRow (n1_1));
|
||||
Assert.Equal (2, tv.GetObjectRow (n1_2));
|
||||
Assert.Equal (3, tv.GetObjectRow (n2));
|
||||
|
||||
tv.Collapse (n1);
|
||||
|
||||
@@ -809,10 +809,10 @@ namespace Terminal.Gui.Views {
|
||||
@"├+normal
|
||||
└─pink
|
||||
", output);
|
||||
Assert.Equal (0, tv.GetObjectYPosition (n1));
|
||||
Assert.Null (tv.GetObjectYPosition (n1_1));
|
||||
Assert.Null (tv.GetObjectYPosition (n1_2));
|
||||
Assert.Equal (1, tv.GetObjectYPosition (n2));
|
||||
Assert.Equal (0, tv.GetObjectRow (n1));
|
||||
Assert.Null (tv.GetObjectRow (n1_1));
|
||||
Assert.Null (tv.GetObjectRow (n1_2));
|
||||
Assert.Equal (1, tv.GetObjectRow (n2));
|
||||
|
||||
|
||||
// scroll down 1
|
||||
@@ -824,10 +824,10 @@ namespace Terminal.Gui.Views {
|
||||
GraphViewTests.AssertDriverContentsAre (
|
||||
@"└─pink
|
||||
", output);
|
||||
Assert.Equal (-1, tv.GetObjectYPosition (n1));
|
||||
Assert.Null (tv.GetObjectYPosition (n1_1));
|
||||
Assert.Null (tv.GetObjectYPosition (n1_2));
|
||||
Assert.Equal (0, tv.GetObjectYPosition (n2));
|
||||
Assert.Equal (-1, tv.GetObjectRow (n1));
|
||||
Assert.Null (tv.GetObjectRow (n1_1));
|
||||
Assert.Null (tv.GetObjectRow (n1_2));
|
||||
Assert.Equal (0, tv.GetObjectRow (n2));
|
||||
}
|
||||
[Fact, AutoInitShutdown]
|
||||
public void TestTreeViewColor()
|
||||
|
||||
Reference in New Issue
Block a user