コード例 #1
0
        public TestCaseDropdownBox()
        {
            var testItems = new string[10];
            int i         = 0;

            while (i < items_to_add)
            {
                testItems[i] = @"test " + i++;
            }

            Add(testDropdown = new TestDropdown
            {
                Width    = 150,
                Position = new Vector2(200, 70),
                Items    = testItems
            });

            Add(testDropdownMenu = new TestDropdown
            {
                Width    = 150,
                Position = new Vector2(400, 70),
                Items    = testItems
            });

            Add(bindableDropdown = new TestDropdown
            {
                Width      = 150,
                Position   = new Vector2(600, 70),
                ItemSource = bindableList
            });
        }
コード例 #2
0
        public TestSceneDropdown()
        {
            var testItems = new TestModel[10];
            int i         = 0;

            while (i < items_to_add)
            {
                testItems[i] = @"test " + i++;
            }

            Add(platformActionContainerKeyboardSelection = new PlatformActionContainer
            {
                Child = testDropdown = new TestDropdown
                {
                    Width    = 150,
                    Position = new Vector2(50, 50),
                    Items    = testItems
                }
            });

            Add(platformActionContainerKeyboardPreselection = new PlatformActionContainer
            {
                Child = testDropdownMenu = new TestDropdown
                {
                    Width    = 150,
                    Position = new Vector2(250, 50),
                    Items    = testItems
                }
            });
            testDropdownMenu.Menu.MaxHeight = explicit_height;

            Add(bindableDropdown = new TestDropdown
            {
                Width      = 150,
                Position   = new Vector2(450, 50),
                ItemSource = bindableList
            });

            Add(platformActionContainerEmptyDropdown = new PlatformActionContainer
            {
                Child = emptyDropdown = new TestDropdown
                {
                    Width    = 150,
                    Position = new Vector2(650, 50),
                }
            });

            Add(disabledDropdown = new TestDropdown
            {
                Width    = 150,
                Position = new Vector2(50, 350),
                Items    = testItems,
                Current  =
                {
                    Value    = testItems[3],
                    Disabled = true
                }
            });
        }
コード例 #3
0
        public TestSceneDropdown()
        {
            var testItems = new string[10];
            int i         = 0;

            while (i < items_to_add)
            {
                testItems[i] = @"test " + i++;
            }

            Add(platformActionContainerKeyboardSelection = new PlatformActionContainer
            {
                Child = testDropdown = new TestDropdown
                {
                    Width    = 150,
                    Position = new Vector2(200, 70),
                    Items    = testItems
                }
            });

            Add(platformActionContainerKeyboardPreselection = new PlatformActionContainer
            {
                Child = testDropdownMenu = new TestDropdown
                {
                    Width    = 150,
                    Position = new Vector2(400, 70),
                    Items    = testItems
                }
            });
            testDropdownMenu.Menu.MaxHeight = explicit_height;

            Add(bindableDropdown = new TestDropdown
            {
                Width      = 150,
                Position   = new Vector2(600, 70),
                ItemSource = bindableList
            });

            Add(platformActionContainerEmptyDropdown = new PlatformActionContainer
            {
                Child = emptyDropdown = new TestDropdown
                {
                    Width    = 150,
                    Position = new Vector2(800, 70),
                }
            });
        }
コード例 #4
0
 private void assertDropdownIsClosed(TestDropdown dropdown) => AddAssert("dropdown is closed", () => dropdown.Menu.State == MenuState.Closed);
コード例 #5
0
 private void assertDropdownIsOpen(TestDropdown dropdown) => AddAssert("dropdown is open", () => dropdown.Menu.State == MenuState.Open);
コード例 #6
0
 private void toggleDropdownViaClick(TestDropdown dropdown, string dropdownName = null) => AddStep($"click {dropdownName ?? "dropdown"}", () =>
 {
     InputManager.MoveMouseTo(dropdown.Header);
     InputManager.Click(MouseButton.Left);
 });
コード例 #7
0
 private void toggleDropdownViaClick(TestDropdown dropdown)
 {
     InputManager.MoveMouseTo(dropdown.Header);
     InputManager.Click(MouseButton.Left);
 }
コード例 #8
0
 private void toggleDropdownViaClick(TestDropdown dropdown)
 {
     InputManager.MoveMouseTo(dropdown.Children.First());
     InputManager.Click(MouseButton.Left);
 }