Merge branch 'master' into refactor_onload_onresize

This commit is contained in:
Charlie Kindel
2020-05-21 08:22:16 -06:00
4 changed files with 79 additions and 27 deletions

View File

@@ -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

View File

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

View File

@@ -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;
}
}
}

View File

@@ -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,
});
}
}
}