From 72d54f49224a850715aee5d30d5ef20eb7e7bdcb Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 30 Mar 2020 02:53:39 +0100 Subject: [PATCH] Demo with the StatusBar. --- Example/demo.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Example/demo.cs b/Example/demo.cs index 5190391ff..4d1a3a265 100644 --- a/Example/demo.cs +++ b/Example/demo.cs @@ -358,6 +358,10 @@ static class Demo { } } + static void Help () + { + MessageBox.Query (50, 7, "Help", "This is a small help\nBe kind.", "Ok"); + } #region Selection Demo @@ -415,7 +419,7 @@ static class Demo { #if true var win = new Window ("Hello") { X = 0, - Y = 1, + Y = 0, Width = Dim.Fill (), Height = Dim.Fill () }; @@ -499,11 +503,19 @@ static class Demo { Y = Pos.Top (drag), Width = 40 }; + + var statusBar = new StatusBar (new StatusItem [] { + new StatusItem(Key.F1, "~F1~ Help", () => Help()), + new StatusItem(Key.F2, "~F2~ Load", null), + new StatusItem(Key.F3, "~F3~ Save", null), + new StatusItem(Key.ControlX, "~^X~ Quit", () => Quit()), + }); + win.Add (drag, dragText); top.Add (win); //top.Add (menu); - top.Add (menu, ml); + top.Add (menu, statusBar, ml); Application.Run (); } }