예제 #1
0
        /// <summary>
        /// 押されたキーに応じてフォーカスの移動を試みます。
        /// </summary>
        void MoveFocus()
        {
            if (Screen.FocusedControl == null)
            {
                return;
            }

            var focusScope = FocusScope.GetFocusScope(Screen.FocusedControl);

            if (focusScope == null)
            {
                return;
            }

            if (Screen.KeyboardDevice.IsKeyPressed(Keys.Up))
            {
                focusScope.MoveFocus(FocusNavigationDirection.Up);
            }
            else if (Screen.KeyboardDevice.IsKeyPressed(Keys.Down))
            {
                focusScope.MoveFocus(FocusNavigationDirection.Down);
            }
            else if (Screen.KeyboardDevice.IsKeyPressed(Keys.Left))
            {
                focusScope.MoveFocus(FocusNavigationDirection.Left);
            }
            else if (Screen.KeyboardDevice.IsKeyPressed(Keys.Right))
            {
                focusScope.MoveFocus(FocusNavigationDirection.Right);
            }
        }
예제 #2
0
        /// <summary>
        /// コンストラクタ。
        /// </summary>
        /// <param name="screen">Screen。</param>
        public Window(Screen screen)
            : base(screen)
        {
            FocusScope  = new FocusScope(this);
            Activatable = true;

            // Window は表示されるまで Visible = false です。
            Visible = false;
        }
예제 #3
0
        /// <summary>
        /// コンストラクタ。
        /// </summary>
        /// <param name="screen">Screen。</param>
        public Window(Screen screen)
            : base(screen)
        {
            FocusScope = new FocusScope(this);
            Activatable = true;

            // Window は表示されるまで Visible = false です。
            Visible = false;
        }