2024-09-04 19:57:53 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2024-09-17 17:35:16 +08:00
|
|
|
using osu.Framework.Bindables;
|
2024-09-04 19:57:53 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
|
|
|
using osu.Game.Graphics.Cursor;
|
|
|
|
using osu.Game.Graphics.UserInterfaceV2;
|
2024-09-06 17:38:50 +08:00
|
|
|
using osu.Game.Localisation;
|
2024-09-04 19:57:53 +08:00
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
|
|
{
|
|
|
|
public partial class TestSceneFormControls : ThemeComparisonTestScene
|
|
|
|
{
|
|
|
|
public TestSceneFormControls()
|
|
|
|
: base(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override Drawable CreateContent() => new OsuContextMenuContainer
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Child = new PopoverContainer
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Child = new FillFlowContainer
|
|
|
|
{
|
2024-09-13 20:54:07 +08:00
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Width = 400,
|
2024-09-04 19:57:53 +08:00
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Spacing = new Vector2(5),
|
|
|
|
Padding = new MarginPadding(10),
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new FormTextBox
|
|
|
|
{
|
|
|
|
Caption = "Artist",
|
|
|
|
HintText = "Poot artist here!",
|
|
|
|
PlaceholderText = "Here is an artist",
|
|
|
|
TabbableContentContainer = this,
|
|
|
|
},
|
|
|
|
new FormTextBox
|
|
|
|
{
|
|
|
|
Caption = "Artist",
|
|
|
|
HintText = "Poot artist here!",
|
|
|
|
PlaceholderText = "Here is an artist",
|
|
|
|
Current = { Disabled = true },
|
|
|
|
TabbableContentContainer = this,
|
|
|
|
},
|
|
|
|
new FormNumberBox
|
|
|
|
{
|
|
|
|
Caption = "Number",
|
|
|
|
HintText = "Insert your favourite number",
|
|
|
|
PlaceholderText = "Mine is 42!",
|
|
|
|
TabbableContentContainer = this,
|
|
|
|
},
|
2024-09-06 17:38:50 +08:00
|
|
|
new FormCheckBox
|
|
|
|
{
|
|
|
|
Caption = EditorSetupStrings.LetterboxDuringBreaks,
|
|
|
|
HintText = EditorSetupStrings.LetterboxDuringBreaksDescription,
|
|
|
|
},
|
|
|
|
new FormCheckBox
|
|
|
|
{
|
|
|
|
Caption = EditorSetupStrings.LetterboxDuringBreaks,
|
|
|
|
HintText = EditorSetupStrings.LetterboxDuringBreaksDescription,
|
|
|
|
Current = { Disabled = true },
|
|
|
|
},
|
2024-09-17 17:35:16 +08:00
|
|
|
new FormSliderBar<float>
|
|
|
|
{
|
2024-09-18 17:23:00 +08:00
|
|
|
Caption = "Instantaneous slider",
|
2024-09-17 17:35:16 +08:00
|
|
|
Current = new BindableFloat
|
|
|
|
{
|
|
|
|
MinValue = 0,
|
|
|
|
MaxValue = 10,
|
|
|
|
Value = 5,
|
|
|
|
Precision = 0.1f,
|
2024-09-18 17:32:55 +08:00
|
|
|
},
|
|
|
|
TabbableContentContainer = this,
|
2024-09-17 17:35:16 +08:00
|
|
|
},
|
2024-09-18 17:23:00 +08:00
|
|
|
new FormSliderBar<float>
|
|
|
|
{
|
|
|
|
Caption = "Non-instantaneous slider",
|
|
|
|
Current = new BindableFloat
|
|
|
|
{
|
|
|
|
MinValue = 0,
|
|
|
|
MaxValue = 10,
|
|
|
|
Value = 5,
|
|
|
|
Precision = 0.1f,
|
|
|
|
},
|
|
|
|
Instantaneous = false,
|
2024-09-18 17:32:55 +08:00
|
|
|
TabbableContentContainer = this,
|
2024-09-18 17:23:00 +08:00
|
|
|
},
|
2024-09-04 19:57:53 +08:00
|
|
|
},
|
|
|
|
},
|
2024-09-06 17:38:50 +08:00
|
|
|
}
|
2024-09-04 19:57:53 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|