From 9e9b5a7522b1857aa987ef70b32cbe374233c283 Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 25 May 2020 19:30:55 +0100 Subject: [PATCH] This help a lot to mouse debug. --- UICatalog/Scenarios/Mouse.cs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/UICatalog/Scenarios/Mouse.cs b/UICatalog/Scenarios/Mouse.cs index 44de0eae3..6c267b235 100644 --- a/UICatalog/Scenarios/Mouse.cs +++ b/UICatalog/Scenarios/Mouse.cs @@ -7,20 +7,33 @@ namespace UICatalog { [ScenarioMetadata (Name: "Mouse", Description: "Demonstrates how to capture mouse events")] [ScenarioCategory ("Input")] class Mouse : Scenario { - public override void Setup () { + public override void Setup () + { Label ml; int count = 0; ml = new Label (new Rect (1, 1, 50, 1), "Mouse: "); - Application.RootMouseEvent += delegate (MouseEvent me) { - ml.TextColor = Colors.TopLevel.Normal; - ml.Text = $"Mouse: ({me.X},{me.Y}) - {me.Flags} {count++}"; - }; - + List rme = new List (); var test = new Label (1, 2, "Se iniciarĂ¡ el anĂ¡lisis"); Win.Add (test); Win.Add (ml); + var rmeList = new ListView (rme) { + X = Pos.Right (test) + 25, + Y = Pos.Top (test) + 1, + Width = Dim.Fill () - 1, + Height = Dim.Fill (), + ColorScheme = Colors.TopLevel + }; + Win.Add (rmeList); + + Application.RootMouseEvent += delegate (MouseEvent me) { + ml.TextColor = Colors.TopLevel.Normal; + ml.Text = $"Mouse: ({me.X},{me.Y}) - {me.Flags} {count}"; + rme.Add ($"({me.X},{me.Y}) - {me.Flags} {count++}"); + rmeList.MoveDown (); + }; + // I have no idea what this was intended to show off in demo.c var drag = new Label ("Drag: ") { X = 1, Y = 4 }; var dragText = new TextField ("") {