|
@@ -12,14 +12,14 @@ public class ScrollViewTests
|
|
public void Adding_Views ()
|
|
public void Adding_Views ()
|
|
{
|
|
{
|
|
var sv = new ScrollView { Width = 20, Height = 10 };
|
|
var sv = new ScrollView { Width = 20, Height = 10 };
|
|
- sv.ContentSize = new (30, 20);
|
|
|
|
|
|
+ sv.SetContentSize (new (30, 20));
|
|
|
|
|
|
sv.Add (
|
|
sv.Add (
|
|
new View { Width = 10, Height = 5 },
|
|
new View { Width = 10, Height = 5 },
|
|
new View { X = 12, Y = 7, Width = 10, Height = 5 }
|
|
new View { X = 12, Y = 7, Width = 10, Height = 5 }
|
|
);
|
|
);
|
|
|
|
|
|
- Assert.Equal (new (30, 20), sv.ContentSize);
|
|
|
|
|
|
+ Assert.Equal (new (30, 20), sv.GetContentSize ());
|
|
Assert.Equal (2, sv.Subviews [0].Subviews.Count);
|
|
Assert.Equal (2, sv.Subviews [0].Subviews.Count);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -187,7 +187,7 @@ public class ScrollViewTests
|
|
Height = 10,
|
|
Height = 10,
|
|
KeepContentAlwaysInViewport = false
|
|
KeepContentAlwaysInViewport = false
|
|
};
|
|
};
|
|
- sv.ContentSize = new (23, 23);
|
|
|
|
|
|
+ sv.SetContentSize (new (23, 23));
|
|
var bottomLabel = new Label { X = 15, Y = 15, Text = "At 15,15" };
|
|
var bottomLabel = new Label { X = 15, Y = 15, Text = "At 15,15" };
|
|
var top = new Toplevel ();
|
|
var top = new Toplevel ();
|
|
top.Add (topLabel, sv, bottomLabel);
|
|
top.Add (topLabel, sv, bottomLabel);
|
|
@@ -346,7 +346,7 @@ public class ScrollViewTests
|
|
Assert.Equal (new Rectangle (0, 0, 0, 0), sv.Frame);
|
|
Assert.Equal (new Rectangle (0, 0, 0, 0), sv.Frame);
|
|
Assert.Equal (Rectangle.Empty, sv.Frame);
|
|
Assert.Equal (Rectangle.Empty, sv.Frame);
|
|
Assert.Equal (Point.Empty, sv.ContentOffset);
|
|
Assert.Equal (Point.Empty, sv.ContentOffset);
|
|
- Assert.Equal (Size.Empty, sv.ContentSize);
|
|
|
|
|
|
+ Assert.Equal (Size.Empty, sv.GetContentSize ());
|
|
Assert.True (sv.AutoHideScrollBars);
|
|
Assert.True (sv.AutoHideScrollBars);
|
|
Assert.True (sv.KeepContentAlwaysInViewport);
|
|
Assert.True (sv.KeepContentAlwaysInViewport);
|
|
|
|
|
|
@@ -355,7 +355,7 @@ public class ScrollViewTests
|
|
Assert.True (sv.CanFocus);
|
|
Assert.True (sv.CanFocus);
|
|
Assert.Equal (new Rectangle (1, 2, 20, 10), sv.Frame);
|
|
Assert.Equal (new Rectangle (1, 2, 20, 10), sv.Frame);
|
|
Assert.Equal (Point.Empty, sv.ContentOffset);
|
|
Assert.Equal (Point.Empty, sv.ContentOffset);
|
|
- Assert.Equal (sv.Viewport.Size, sv.ContentSize);
|
|
|
|
|
|
+ Assert.Equal (sv.Viewport.Size, sv.GetContentSize ());
|
|
Assert.True (sv.AutoHideScrollBars);
|
|
Assert.True (sv.AutoHideScrollBars);
|
|
Assert.True (sv.KeepContentAlwaysInViewport);
|
|
Assert.True (sv.KeepContentAlwaysInViewport);
|
|
}
|
|
}
|
|
@@ -378,7 +378,7 @@ public class ScrollViewTests
|
|
Height = 5,
|
|
Height = 5,
|
|
ColorScheme = new ColorScheme { Normal = new Attribute (Color.Red, Color.Green) }
|
|
ColorScheme = new ColorScheme { Normal = new Attribute (Color.Red, Color.Green) }
|
|
};
|
|
};
|
|
- sv.ContentSize = size;
|
|
|
|
|
|
+ sv.SetContentSize (size);
|
|
string text = null;
|
|
string text = null;
|
|
|
|
|
|
for (var i = 0; i < size.Height; i++)
|
|
for (var i = 0; i < size.Height; i++)
|
|
@@ -447,7 +447,7 @@ public class ScrollViewTests
|
|
{
|
|
{
|
|
Width = 10, Height = 10,
|
|
Width = 10, Height = 10,
|
|
};
|
|
};
|
|
- sv.ContentSize = new (50, 50);
|
|
|
|
|
|
+ sv.SetContentSize (new (50, 50));
|
|
sv.ContentOffset = new (25, 25);
|
|
sv.ContentOffset = new (25, 25);
|
|
|
|
|
|
var top = new Toplevel ();
|
|
var top = new Toplevel ();
|
|
@@ -455,7 +455,7 @@ public class ScrollViewTests
|
|
Application.Begin (top);
|
|
Application.Begin (top);
|
|
|
|
|
|
Assert.Equal (new (-25, -25), sv.ContentOffset);
|
|
Assert.Equal (new (-25, -25), sv.ContentOffset);
|
|
- Assert.Equal (new (50, 50), sv.ContentSize);
|
|
|
|
|
|
+ Assert.Equal (new (50, 50), sv.GetContentSize ());
|
|
Assert.True (sv.AutoHideScrollBars);
|
|
Assert.True (sv.AutoHideScrollBars);
|
|
Assert.True (sv.ShowHorizontalScrollIndicator);
|
|
Assert.True (sv.ShowHorizontalScrollIndicator);
|
|
Assert.True (sv.ShowVerticalScrollIndicator);
|
|
Assert.True (sv.ShowVerticalScrollIndicator);
|
|
@@ -482,14 +482,14 @@ public class ScrollViewTests
|
|
public void ContentSize_AutoHideScrollBars_ShowHorizontalScrollIndicator_ShowVerticalScrollIndicator ()
|
|
public void ContentSize_AutoHideScrollBars_ShowHorizontalScrollIndicator_ShowVerticalScrollIndicator ()
|
|
{
|
|
{
|
|
var sv = new ScrollView { Width = 10, Height = 10, };
|
|
var sv = new ScrollView { Width = 10, Height = 10, };
|
|
- sv.ContentSize = new (50, 50);
|
|
|
|
|
|
+ sv.SetContentSize (new (50, 50));
|
|
|
|
|
|
var top = new Toplevel ();
|
|
var top = new Toplevel ();
|
|
top.Add (sv);
|
|
top.Add (sv);
|
|
Application.Begin (top);
|
|
Application.Begin (top);
|
|
|
|
|
|
- Assert.Equal (50, sv.ContentSize.Width);
|
|
|
|
- Assert.Equal (50, sv.ContentSize.Height);
|
|
|
|
|
|
+ Assert.Equal (50, sv.GetContentSize ().Width);
|
|
|
|
+ Assert.Equal (50, sv.GetContentSize ().Height);
|
|
Assert.True (sv.AutoHideScrollBars);
|
|
Assert.True (sv.AutoHideScrollBars);
|
|
Assert.True (sv.ShowHorizontalScrollIndicator);
|
|
Assert.True (sv.ShowHorizontalScrollIndicator);
|
|
Assert.True (sv.ShowVerticalScrollIndicator);
|
|
Assert.True (sv.ShowVerticalScrollIndicator);
|
|
@@ -546,7 +546,7 @@ public class ScrollViewTests
|
|
ShowHorizontalScrollIndicator = true,
|
|
ShowHorizontalScrollIndicator = true,
|
|
ShowVerticalScrollIndicator = true
|
|
ShowVerticalScrollIndicator = true
|
|
};
|
|
};
|
|
- scrollView.ContentSize = size;
|
|
|
|
|
|
+ scrollView.SetContentSize (size);
|
|
scrollView.Add (view);
|
|
scrollView.Add (view);
|
|
var win = new Window { X = 1, Y = 1, Width = 20, Height = 14 };
|
|
var win = new Window { X = 1, Y = 1, Width = 20, Height = 14 };
|
|
win.Add (scrollView);
|
|
win.Add (scrollView);
|
|
@@ -871,7 +871,7 @@ public class ScrollViewTests
|
|
Width = 10,
|
|
Width = 10,
|
|
Height = 10,
|
|
Height = 10,
|
|
};
|
|
};
|
|
- sv.ContentSize = new (50, 50);
|
|
|
|
|
|
+ sv.SetContentSize (new (50, 50));
|
|
|
|
|
|
for (var i = 0; i < 8; i++)
|
|
for (var i = 0; i < 8; i++)
|
|
{
|
|
{
|
|
@@ -921,7 +921,7 @@ public class ScrollViewTests
|
|
public void KeyBindings_Command ()
|
|
public void KeyBindings_Command ()
|
|
{
|
|
{
|
|
var sv = new ScrollView { Width = 20, Height = 10, };
|
|
var sv = new ScrollView { Width = 20, Height = 10, };
|
|
- sv.ContentSize = new (40, 20);
|
|
|
|
|
|
+ sv.SetContentSize (new (40, 20));
|
|
|
|
|
|
sv.Add (
|
|
sv.Add (
|
|
new View { Width = 20, Height = 5 },
|
|
new View { Width = 20, Height = 5 },
|
|
@@ -1056,7 +1056,7 @@ public class ScrollViewTests
|
|
public void Remove_Added_View_Is_Allowed ()
|
|
public void Remove_Added_View_Is_Allowed ()
|
|
{
|
|
{
|
|
var sv = new ScrollView { Width = 20, Height = 20, };
|
|
var sv = new ScrollView { Width = 20, Height = 20, };
|
|
- sv.ContentSize = new (100, 100);
|
|
|
|
|
|
+ sv.SetContentSize (new (100, 100));
|
|
|
|
|
|
sv.Add (
|
|
sv.Add (
|
|
new View { Width = Dim.Fill (), Height = Dim.Fill (50), Id = "View1" },
|
|
new View { Width = Dim.Fill (), Height = Dim.Fill (50), Id = "View1" },
|