|
@@ -105,8 +105,8 @@ namespace UICatalog.Scenarios {
|
|
|
{
|
|
|
Win.X = 3;
|
|
|
Win.Y = 3;
|
|
|
- Win.Width = Dim.Fill () - 3;
|
|
|
- Win.Height = Dim.Fill () - 3;
|
|
|
+ Win.Width = Dim.Fill (3);
|
|
|
+ Win.Height = Dim.Fill (3);
|
|
|
var label = new Label ("ScrollView (new Rect (2, 2, 50, 20)) with a 200, 100 ContentSize...") {
|
|
|
X = 0,
|
|
|
Y = 0,
|
|
@@ -114,8 +114,12 @@ namespace UICatalog.Scenarios {
|
|
|
};
|
|
|
Win.Add (label);
|
|
|
|
|
|
- // BUGBUG: ScrollView only supports Absolute Positioning (#72)
|
|
|
- var scrollView = new ScrollView (new Rect (2, 2, 50, 20)) {
|
|
|
+ // FIXED: ScrollView only supports Absolute Positioning (#72)
|
|
|
+ var scrollView = new ScrollView {
|
|
|
+ X = 2,
|
|
|
+ Y = 2,
|
|
|
+ Width = 50,
|
|
|
+ Height = 20,
|
|
|
ColorScheme = Colors.TopLevel,
|
|
|
ContentSize = new Size (200, 100),
|
|
|
//ContentOffset = new Point (0, 0),
|
|
@@ -124,6 +128,7 @@ namespace UICatalog.Scenarios {
|
|
|
};
|
|
|
|
|
|
const string rule = "0123456789";
|
|
|
+
|
|
|
var horizontalRuler = new Label () {
|
|
|
X = 0,
|
|
|
Y = 0,
|
|
@@ -133,6 +138,7 @@ namespace UICatalog.Scenarios {
|
|
|
AutoSize = false
|
|
|
};
|
|
|
scrollView.Add (horizontalRuler);
|
|
|
+
|
|
|
const string vrule = "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n";
|
|
|
|
|
|
var verticalRuler = new Label () {
|
|
@@ -148,7 +154,7 @@ namespace UICatalog.Scenarios {
|
|
|
void Top_Loaded ()
|
|
|
{
|
|
|
horizontalRuler.Text = rule.Repeat ((int)Math.Ceiling ((double)(horizontalRuler.Bounds.Width) / (double)rule.Length)) [0..(horizontalRuler.Bounds.Width)] +
|
|
|
- "\n" + "| ".Repeat ((int)Math.Ceiling ((double)(horizontalRuler.Bounds.Width) / (double)rule.Length)) [0..(horizontalRuler.Bounds.Width)];
|
|
|
+ "\n" + "| ".Repeat ((int)Math.Ceiling ((double)(horizontalRuler.Bounds.Width) / (double)rule.Length)) [0..(horizontalRuler.Bounds.Width)];
|
|
|
verticalRuler.Text = vrule.Repeat ((int)Math.Ceiling ((double)(verticalRuler.Bounds.Height * 2) / (double)rule.Length)) [0..(verticalRuler.Bounds.Height * 2)];
|
|
|
Top.Loaded -= Top_Loaded;
|
|
|
}
|
|
@@ -164,7 +170,7 @@ namespace UICatalog.Scenarios {
|
|
|
var aLongButton = new Button ("A very long button. Should be wide enough to demo clipping!") {
|
|
|
X = 3,
|
|
|
Y = 4,
|
|
|
- Width = Dim.Fill (6),
|
|
|
+ Width = Dim.Fill (3),
|
|
|
};
|
|
|
aLongButton.Clicked += () => MessageBox.Query (20, 7, "MessageBox", "Neat?", "Yes", "No");
|
|
|
scrollView.Add (aLongButton);
|
|
@@ -206,6 +212,8 @@ namespace UICatalog.Scenarios {
|
|
|
};
|
|
|
scrollView.Add (anchorButton);
|
|
|
|
|
|
+ Win.Add (scrollView);
|
|
|
+
|
|
|
var hCheckBox = new CheckBox ("Horizontal Scrollbar", scrollView.ShowHorizontalScrollIndicator) {
|
|
|
X = Pos.X (scrollView),
|
|
|
Y = Pos.Bottom (scrollView) + 1,
|
|
@@ -265,6 +273,7 @@ namespace UICatalog.Scenarios {
|
|
|
scrollView2.DrawContent += (r) => {
|
|
|
scrollView2.ContentSize = filler.GetContentSize ();
|
|
|
};
|
|
|
+ Win.Add (scrollView2);
|
|
|
|
|
|
// This is just to debug the visuals of the scrollview when small
|
|
|
var scrollView3 = new ScrollView (new Rect (55, 15, 3, 3)) {
|
|
@@ -273,20 +282,26 @@ namespace UICatalog.Scenarios {
|
|
|
ShowHorizontalScrollIndicator = true
|
|
|
};
|
|
|
scrollView3.Add (new Box10x (0, 0));
|
|
|
+ Win.Add (scrollView3);
|
|
|
|
|
|
int count = 0;
|
|
|
- var mousePos = new Label ("Mouse: ");
|
|
|
- mousePos.X = Pos.Right (scrollView) + 1;
|
|
|
- mousePos.Y = Pos.AnchorEnd (1);
|
|
|
- mousePos.Width = 50;
|
|
|
+ var mousePos = new Label ("Mouse: ") {
|
|
|
+ X = Pos.Right (scrollView) + 1,
|
|
|
+ Y = Pos.AnchorEnd (1),
|
|
|
+ Width = 50,
|
|
|
+ };
|
|
|
+ Win.Add (mousePos);
|
|
|
Application.RootMouseEvent += delegate (MouseEvent me) {
|
|
|
mousePos.Text = $"Mouse: ({me.X},{me.Y}) - {me.Flags} {count++}";
|
|
|
};
|
|
|
|
|
|
- var progress = new ProgressBar ();
|
|
|
- progress.X = Pos.Right (scrollView) + 1;
|
|
|
- progress.Y = Pos.AnchorEnd (2);
|
|
|
- progress.Width = 50;
|
|
|
+ var progress = new ProgressBar {
|
|
|
+ X = Pos.Right (scrollView) + 1,
|
|
|
+ Y = Pos.AnchorEnd (2),
|
|
|
+ Width = 50
|
|
|
+ };
|
|
|
+ Win.Add (progress);
|
|
|
+
|
|
|
bool pulsing = true;
|
|
|
bool timer (MainLoop caller)
|
|
|
{
|
|
@@ -301,8 +316,6 @@ namespace UICatalog.Scenarios {
|
|
|
Top.Unloaded -= Top_Unloaded;
|
|
|
}
|
|
|
Top.Unloaded += Top_Unloaded;
|
|
|
-
|
|
|
- Win.Add (scrollView, scrollView2, scrollView3, mousePos, progress);
|
|
|
}
|
|
|
}
|
|
|
}
|