summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/source/MonoGame.Extended.Gui/Controls/Form.cs
blob: 97b984dec8d66262084e7e016e2882a72de27885 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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<Control>();
    //            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<Submit>();
    //            if (controls.Count > 0)
    //            {
    //                var submit = controls.FirstOrDefault();
    //                submit.TriggerClicked();
    //                return true;
    //            }
    //        }

    //        return base.OnKeyPressed(context, args);
    //    }
    //}
}