From 42fe890072f2ca1b28344fe70f1395b44ecf3e11 Mon Sep 17 00:00:00 2001 From: BDisp Date: Wed, 29 Apr 2020 16:08:42 +0100 Subject: [PATCH] Fsharp example updated with the Demo version. (#407) * Added solution file to the FSharpExample project. * Updated Terminal.Gui and FSharp.Core nuget packages * Removed the Terminal.Gui nuget package and added the project itself. * Added a new FrameView constructor with an array of views. * Changed FSharp Example with the Example Demo file version. * Fixes the Box10x() issue. --- FSharpExample/.editorconfig | 4 + FSharpExample/FSharpExample.fsproj | 6 +- FSharpExample/FSharpExample.sln | 31 ++ FSharpExample/Program.fs | 456 +++++++++++++++++++++++++++-- Terminal.Gui/Views/FrameView.cs | 24 +- 5 files changed, 491 insertions(+), 30 deletions(-) create mode 100644 FSharpExample/.editorconfig create mode 100644 FSharpExample/FSharpExample.sln diff --git a/FSharpExample/.editorconfig b/FSharpExample/.editorconfig new file mode 100644 index 000000000..924c8fe00 --- /dev/null +++ b/FSharpExample/.editorconfig @@ -0,0 +1,4 @@ +[*.fs] +indent_style = space +indent_size = 4 +tab_width = 4 diff --git a/FSharpExample/FSharpExample.fsproj b/FSharpExample/FSharpExample.fsproj index 3e9230e44..d251896a4 100644 --- a/FSharpExample/FSharpExample.fsproj +++ b/FSharpExample/FSharpExample.fsproj @@ -10,7 +10,11 @@ - + + + + + diff --git a/FSharpExample/FSharpExample.sln b/FSharpExample/FSharpExample.sln new file mode 100644 index 000000000..90e5c5be2 --- /dev/null +++ b/FSharpExample/FSharpExample.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpExample", "FSharpExample.fsproj", "{6E4DF691-FA5F-4D7C-8DBC-8656103C5CB1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Terminal.Gui", "..\Terminal.Gui\Terminal.Gui.csproj", "{FA48E777-1308-489D-95A0-89DE46B65A93}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6E4DF691-FA5F-4D7C-8DBC-8656103C5CB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E4DF691-FA5F-4D7C-8DBC-8656103C5CB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E4DF691-FA5F-4D7C-8DBC-8656103C5CB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E4DF691-FA5F-4D7C-8DBC-8656103C5CB1}.Release|Any CPU.Build.0 = Release|Any CPU + {FA48E777-1308-489D-95A0-89DE46B65A93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA48E777-1308-489D-95A0-89DE46B65A93}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA48E777-1308-489D-95A0-89DE46B65A93}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA48E777-1308-489D-95A0-89DE46B65A93}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A023D2E3-EF0F-4986-8E6C-323F967788B7} + EndGlobalSection +EndGlobal diff --git a/FSharpExample/Program.fs b/FSharpExample/Program.fs index 6a9418fa8..a2ec888c5 100644 --- a/FSharpExample/Program.fs +++ b/FSharpExample/Program.fs @@ -1,37 +1,441 @@ // Learn more about F# at http://fsharp.org -open System open Terminal.Gui +open System +open Mono.Terminal +open System.Collections.Generic +open System.Diagnostics +open System.Globalization +open System.Reflection open NStack +type Demo() = class end + let ustr (x:string) = ustring.Make(x) + let mutable ml2 = Unchecked.defaultof