浏览代码

Merge branch 'master' into refactor_onload_onresize

Charlie Kindel 5 年之前
父节点
当前提交
fb87cbb5e0

+ 0 - 25
.github/workflows/dotnetcore.yml

@@ -1,25 +0,0 @@
-name: .NET Core
-
-on:
-  push:
-    branches: [ master ]
-  pull_request:
-    branches: [ master ]
-
-jobs:
-  build:
-
-    runs-on: ubuntu-latest
-
-    steps:
-    - uses: actions/checkout@v2
-    - name: Setup .NET Core
-      uses: actions/setup-dotnet@v1
-      with:
-        dotnet-version: 3.1.101
-    - name: Install dependencies
-      run: dotnet restore
-    - name: Build
-      run: dotnet build --configuration Release --no-restore
-    - name: Test
-      run: dotnet test --no-restore --verbosity normal

+ 2 - 2
UICatalog/Properties/launchSettings.json

@@ -1,8 +1,8 @@
 {
 {
   "profiles": {
   "profiles": {
     "UICatalog": {
     "UICatalog": {
-      "commandName": "Project",
-      "commandLineArgs": "HexEditor"
+      "commandName": "Project"
+
     }
     }
   }
   }
 }
 }

+ 47 - 0
UICatalog/Scenarios/Progress.cs

@@ -0,0 +1,47 @@
+using System;
+using Terminal.Gui;
+
+namespace UICatalog {
+	// 
+	// This would be a great scenario to show of threading (Issue #471)
+	//
+	[ScenarioMetadata (Name: "Progress", Description: "Shows off ProgressBar.")]
+	[ScenarioCategory ("Controls")]
+	class Progress : Scenario {
+
+		private ProgressBar _progressBar;
+		public override void Setup ()
+		{
+			Win.Add (new Button ("Start") {
+				X = Pos.Center () - 20,
+				Y = Pos.Center () - 5,
+				Clicked = () => Start ()
+			}); ;
+
+			Win.Add (new Button ("Stop") {
+				X = Pos.Center () + 10,
+				Y = Pos.Center () - 5,
+				Clicked = () => Stop()
+			});
+
+			_progressBar = new ProgressBar () {
+				X = Pos.Center (),
+				// BUGBUG: If you remove the +1 below the control is drawn at top?!?!
+				Y = Pos.Center ()+1,
+				Width = 30,
+				Fraction = 0.25F,
+			};
+			Win.Add (_progressBar);
+		}
+
+		private void Start ()
+		{
+			_progressBar.Fraction = 0F;
+		}
+
+		private void Stop ()
+		{
+			_progressBar.Fraction = 1F;
+		}
+	}
+}

+ 30 - 0
UICatalog/Scenarios/TimeAndDate.cs

@@ -0,0 +1,30 @@
+using System;
+using Terminal.Gui;
+
+namespace UICatalog {
+	[ScenarioMetadata (Name: "Time And Date", Description: "Illustrates TimeField and time & date handling")]
+	[ScenarioCategory ("Controls")]
+	[ScenarioCategory ("Bug Repro")] // Issue #246
+	class TimeAndDate : Scenario {
+		public override void Setup ()
+		{
+			// NOTE: The TimeField control is not ready for prime-time.
+
+			Win.Add (new TimeField (0, 0, DateTime.Now, isShort: false) {
+				// BUGBUG: TimeField does not support Computed Layout
+				//X = Pos.Center (),
+				//Y = Pos.Center () - 1,
+				X = 10,
+				Y = 2,
+			});
+
+			Win.Add (new TimeField (0, 2, DateTime.Now, isShort: true) {
+				// BUGBUG: TimeField does not support Computed Layout
+				//X = Pos.Center (),
+				//Y = Pos.Center () + 1,
+				X = 10,
+				Y = 3,
+			});
+		}
+	}
+}