1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 04:13:03 +08:00
osu-lazer/osu.Desktop.VisualTests/Tests/TestCaseTextBox.cs
Dean Herbert 7bdb2fcfc7 Add basic implementation of VisualTest framework for osu! project.
Comes with one complimentary test.
2016-09-24 15:47:17 +09:00

60 lines
1.7 KiB
C#

// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using OpenTK;
using osu.Framework.GameModes.Testing;
namespace osu.Framework.VisualTests.Tests
{
class TestCaseTextBox : TestCase
{
private TextBox tb;
public override string Name => @"TextBox";
public override string Description => @"Text entry evolved";
public override int DisplayOrder => -1;
public override void Reset()
{
base.Reset();
FlowContainer textBoxes = new FlowContainer
{
Direction = FlowDirection.VerticalOnly,
Padding = new Vector2(0, 50),
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
SizeMode = InheritMode.XY,
Size = new Vector2(0.8f, 1)
};
Add(textBoxes);
textBoxes.Add(tb = new TextBox
{
Size = new Vector2(100, 16),
});
textBoxes.Add(tb = new TextBox
{
Text = @"Limited length",
Size = new Vector2(200, 20),
LengthLimit = 20
});
textBoxes.Add(tb = new TextBox
{
Text = @"Box with some more text",
Size = new Vector2(500, 30),
});
//textBoxes.Add(tb = new PasswordTextBox(@"", 14, Vector2.Zero, 300));
}
}
}