Пример #1
0
        protected override void OnLeft()
        {
            switch (_currentSelection)
            {
            case Selection.PageUpDown:
                base.OnLeft();
                if (_listType == ListType.CONTROL_LIST)
                {
                    _currentSelection = Selection.ListItem;
                }
                break;

            case Selection.ListItem:
                if (_cursorX >= 0)
                {
                    GUIPlayListButtonControl btn = (GUIPlayListButtonControl)_listButtons[_cursorX];
                    GUIPlayListButtonControl.SuppressActiveButtonReset = false;
                    if (btn.CurrentActiveButton != GUIPlayListButtonControl.ActiveButton.Main && btn.CanMoveLeft())
                    {
                        Action action = new Action {
                            wID = Action.ActionType.ACTION_MOVE_LEFT
                        };
                        btn.OnAction(action);
                        return;
                    }
                }

                // select down..
                _currentSelection = Selection.PageUpDown;
                base.OnLeft();
                break;
            }
        }
Пример #2
0
        protected override void OnRight()
        {
            Action action = new Action();

            if (_listType == ListType.CONTROL_LIST)
            {
                if (_cursorX >= 0)
                {
                    GUIPlayListButtonControl btn = (GUIPlayListButtonControl)_listButtons[_cursorX];
                    GUIPlayListButtonControl.SuppressActiveButtonReset = false;

                    if (btn.CurrentActiveButton != GUIPlayListButtonControl.ActiveButton.Delete && btn.CanMoveRight())
                    {
                        action.wID = Action.ActionType.ACTION_MOVE_RIGHT;
                        btn.OnAction(action);
                        return;
                    }

                    btn.CurrentActiveButton = GUIPlayListButtonControl.ActiveButton.None;
                    if (!_spinCanFocus)
                    {
                        btn.CurrentActiveButton = GUIPlayListButtonControl.ActiveButton.Delete;
                        return;
                    }
                }

                action.wID = Action.ActionType.ACTION_MOVE_RIGHT;

                if (_listType == ListType.CONTROL_LIST)
                {
                    if (_upDownControl.GetMaximum() > 1)
                    {
                        _listType            = ListType.CONTROL_UPDOWN;
                        _upDownControl.Focus = true;

                        if (!_upDownControl.Focus)
                        {
                            _listType = ListType.CONTROL_LIST;
                        }
                    }
                }
                else
                {
                    _upDownControl.OnAction(action);

                    if (!_upDownControl.Focus)
                    {
                        if (_rightControlId != GetID)
                        {
                            base.OnAction(action);
                        }

                        _listType = ListType.CONTROL_LIST;
                    }
                }
            }
        }