forked from ppy/osu-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple
InputProperties
/ TextInputType
test
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
osu.Framework.Tests/Visual/UserInterface/TestSceneTextInputProperties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.UserInterface; | ||
using osu.Framework.Input; | ||
using osu.Framework.Testing; | ||
using osuTK; | ||
|
||
namespace osu.Framework.Tests.Visual.UserInterface | ||
{ | ||
public partial class TestSceneTextInputProperties : FrameworkTestScene | ||
{ | ||
[SetUpSteps] | ||
public void SetUpSteps() | ||
{ | ||
AddStep("Create text boxes", () => | ||
{ | ||
FillFlowContainer flow; | ||
Child = new BasicScrollContainer | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
Child = flow = new FillFlowContainer | ||
{ | ||
RelativeSizeAxes = Axes.X, | ||
AutoSizeAxes = Axes.Y, | ||
Width = 0.9f, | ||
Anchor = Anchor.TopCentre, | ||
Origin = Anchor.TopCentre, | ||
Spacing = new Vector2(0, 13), | ||
} | ||
}; | ||
|
||
foreach (var textInputType in Enum.GetValues<TextInputType>()) | ||
{ | ||
flow.Add(new BasicTextBox | ||
{ | ||
TabbableContentContainer = flow, | ||
RelativeSizeAxes = Axes.X, | ||
Height = 40, | ||
PlaceholderText = $"{textInputType} (allow IME)", | ||
InputProperties = new TextInputProperties | ||
{ | ||
Type = textInputType, | ||
AllowIme = true | ||
}, | ||
}); | ||
flow.Add(new BasicTextBox | ||
{ | ||
TabbableContentContainer = flow, | ||
RelativeSizeAxes = Axes.X, | ||
Height = 40, | ||
PlaceholderText = $"{textInputType} (no IME)", | ||
InputProperties = new TextInputProperties | ||
{ | ||
Type = textInputType, | ||
AllowIme = false | ||
}, | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
} |