osu/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs

46 lines
1.4 KiB
C#
Raw Normal View History

2017-03-08 09:19:00 +00:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
2017-03-15 03:30:42 +00:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-03-08 09:19:00 +00:00
2017-03-16 05:49:23 +00:00
using OpenTK;
2017-03-08 09:19:00 +00:00
using osu.Framework.Graphics.Primitives;
2017-03-28 12:03:34 +00:00
using osu.Framework.Testing;
2017-03-08 09:19:00 +00:00
using osu.Game.Graphics.Sprites;
2017-03-16 00:11:50 +00:00
using osu.Game.Graphics.UserInterface;
2017-03-16 05:49:23 +00:00
using osu.Game.Screens.Select.Filter;
2017-03-08 09:19:00 +00:00
namespace osu.Desktop.VisualTests.Tests
{
public class TestCaseTabControl : TestCase
{
public override string Description => @"Filter for song select";
public override void Reset()
{
base.Reset();
OsuSpriteText text;
2017-03-16 00:11:50 +00:00
OsuTabControl<GroupMode> filter;
2017-03-16 05:49:23 +00:00
Add(filter = new OsuTabControl<GroupMode>
{
Margin = new MarginPadding(4),
2017-03-16 07:43:42 +00:00
Size = new Vector2(229, 24),
2017-03-16 05:49:23 +00:00
AutoSort = true
});
Add(text = new OsuSpriteText
2017-03-08 09:19:00 +00:00
{
2017-03-16 05:49:23 +00:00
Text = "None",
Margin = new MarginPadding(4),
Position = new Vector2(275, 5)
2017-03-08 09:19:00 +00:00
});
2017-03-15 02:46:13 +00:00
filter.PinItem(GroupMode.All);
filter.PinItem(GroupMode.RecentlyPlayed);
2017-03-15 02:46:13 +00:00
filter.SelectedItem.ValueChanged += newFilter =>
2017-03-08 09:19:00 +00:00
{
text.Text = "Currently Selected: " + newFilter.ToString();
2017-03-08 09:19:00 +00:00
};
}
}
}