Skip to content

Commit

Permalink
Merge pull request #299 from gui-cs/numeric-up-down-support
Browse files Browse the repository at this point in the history
Numeric up down support
  • Loading branch information
tznind authored Sep 1, 2024
2 parents 1e3e365 + de1453d commit cf5c192
Show file tree
Hide file tree
Showing 28 changed files with 762 additions and 254 deletions.
209 changes: 209 additions & 0 deletions Showcase/NumericUpDown.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions Showcase/NumericUpDown.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

//------------------------------------------------------------------------------

// <auto-generated>
// This code was generated by:
// TerminalGuiDesigner v2.0.0.0
// You can make changes to this file and they will not be overwritten when saving.
// </auto-generated>
// -----------------------------------------------------------------------------
namespace Showcase {
using Terminal.Gui;


public partial class NumericUpDown {

public NumericUpDown() {
InitializeComponent();
}
}
}
46 changes: 46 additions & 0 deletions Showcase/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System.Collections.ObjectModel;
using System.Runtime.InteropServices.ComTypes;
using Terminal.Gui;

namespace Showcase
{
internal class Program
{
private static Type[] views = new[]
{
typeof(NumericUpDown)

};
static void Main(string[] args)
{
Application.Init();

var w = new Window()
{
Title = "Showcase"
};

var lv = new ListView()
{
Width = Dim.Fill(),
Height = Dim.Fill(),
};
w.Add(lv);
lv.SetSource(new ObservableCollection<Type>(views));


lv.KeyDown += (_, e) =>
{
if (e.KeyCode == KeyCode.Enter)
{
var v = (Toplevel)Activator.CreateInstance(views[lv.SelectedItem]);

Check warning on line 36 in Showcase/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Converting null literal or possible null value to non-nullable type.
e.Handled = true;
Application.Run(v);

Check warning on line 38 in Showcase/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Possible null reference argument for parameter 'view' in 'void Application.Run(Toplevel view, Func<Exception, bool>? errorHandler = null)'.
}
};

Application.Run(w);
Application.Shutdown();
}
}
}
5 changes: 5 additions & 0 deletions Showcase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Showcase

This project contains only .Designer.cs files created by TerminalGuiDesigner.

The purpose of the project is to ensure backwards compatibility issues are detected quickly as well as providing more structure for manual testing
14 changes: 14 additions & 0 deletions Showcase/Showcase.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Terminal.Gui" Version="2.0.0-v2-develop.2203" />
</ItemGroup>

</Project>
Loading

0 comments on commit cf5c192

Please sign in to comment.