From acea7b2e728787a0d83bbf83c8c1f042d2c32e7e Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Mon, 3 Jun 2024 10:15:45 +0800 Subject: + plugins project --- .../source/MonoGame.Extended.Gui/Controls/Form.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Plugins/MonoGame.Extended/source/MonoGame.Extended.Gui/Controls/Form.cs (limited to 'Plugins/MonoGame.Extended/source/MonoGame.Extended.Gui/Controls/Form.cs') diff --git a/Plugins/MonoGame.Extended/source/MonoGame.Extended.Gui/Controls/Form.cs b/Plugins/MonoGame.Extended/source/MonoGame.Extended.Gui/Controls/Form.cs new file mode 100644 index 0000000..97b984d --- /dev/null +++ b/Plugins/MonoGame.Extended/source/MonoGame.Extended.Gui/Controls/Form.cs @@ -0,0 +1,42 @@ +using System.Linq; +using MonoGame.Extended.Input.InputListeners; +using Microsoft.Xna.Framework.Input; + +namespace MonoGame.Extended.Gui.Controls +{ + //public class Form : StackPanel + //{ + // public Form() + // { + // } + + // public override bool OnKeyPressed(IGuiContext context, KeyboardEventArgs args) + // { + // if (args.Key == Keys.Tab) + // { + // var controls = FindControls(); + // var index = controls.IndexOf(context.FocusedControl); + // if (index > -1) + // { + // index++; + // if (index >= controls.Count) index = 0; + // context.SetFocus(controls[index]); + // return true; + // } + // } + + // if (args.Key == Keys.Enter) + // { + // var controls = FindControls(); + // if (controls.Count > 0) + // { + // var submit = controls.FirstOrDefault(); + // submit.TriggerClicked(); + // return true; + // } + // } + + // return base.OnKeyPressed(context, args); + // } + //} +} -- cgit v1.1-26-g67d0