Browse Source

Test button

Tig 1 year ago
parent
commit
b980f07688
1 changed files with 36 additions and 3 deletions
  1. 36 3
      UICatalog/Scenarios/Buttons.cs

+ 36 - 3
UICatalog/Scenarios/Buttons.cs

@@ -290,10 +290,11 @@ public class Buttons : Scenario
         {
         {
             X = 0,
             X = 0,
             Y = Pos.Bottom (moveUnicodeHotKeyBtn) + 1,
             Y = Pos.Bottom (moveUnicodeHotKeyBtn) + 1,
-            Title = "_1x1 Button:",
+            Title = "_Numeric Up/Down:",
         };
         };
-        var oneByOne = new Button ()
+        var downButton = new Button ()
         {
         {
+            CanFocus = false,
             AutoSize = false,
             AutoSize = false,
             X = Pos.Right(label)+1,
             X = Pos.Right(label)+1,
             Y = Pos.Top (label),
             Y = Pos.Top (label),
@@ -301,9 +302,41 @@ public class Buttons : Scenario
             Width = 1,
             Width = 1,
             NoPadding = true,
             NoPadding = true,
             NoDecorations = true,
             NoDecorations = true,
+            Title = $"{CM.Glyphs.DownArrow}",
+            WantContinuousButtonPressed = true,
+        };
+
+        var numericEdit = new TextField ()
+        {
+            Text = "1966",
+            X = Pos.Right (downButton),
+            Y = Pos.Top (downButton),
+            Width = 5,
+            Height = 1,
+        };
+        var upButton = new Button ()
+        {
+            CanFocus = false,
+            AutoSize = false,
+            X = Pos.Right (numericEdit),
+            Y = Pos.Top (numericEdit),
+            Height = 1,
+            Width = 1,
+            NoPadding = true,
+            NoDecorations = true,
             Title = $"{CM.Glyphs.UpArrow}",
             Title = $"{CM.Glyphs.UpArrow}",
+            WantContinuousButtonPressed = true,
         };
         };
-        Win.Add (label, oneByOne);
+        downButton.Accept += (s, e) =>
+                             {
+                                 numericEdit.Text = $"{int.Parse(numericEdit.Text) - 1}";
+                             };
+        upButton.Accept += (s, e) =>
+                           {
+                               numericEdit.Text = $"{int.Parse (numericEdit.Text) + 1}";
+                           };
+
+        Win.Add (label, downButton, numericEdit, upButton);
 
 
         radioGroup.SelectedItemChanged += (s, args) =>
         radioGroup.SelectedItemChanged += (s, args) =>
                                           {
                                           {