/// <summary>
        /// OnAction() method. This method gets called when there's a new action like a
        /// keypress or mousemove or... By overriding this method, the control can respond
        /// to any action
        /// </summary>
        /// <param name="action">action : contains the action</param>
        public override void OnAction(Action action)
        {
            GUIMessage message;

            if (Focus)
            {
                if (action.wID == Action.ActionType.ACTION_MOUSE_CLICK || action.wID == Action.ActionType.ACTION_SELECT_ITEM)
                {
                    // send a message to anyone interested
                    message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, WindowId, GetID, ParentID, 0, 0, null);
                    GUIGraphicsContext.SendMessage(message);

                    // If this button has a click setting then execute the setting.
                    if (_onclick.Length != 0)
                    {
                        GUIPropertyManager.Parse(_onclick, GUIExpressionManager.ExpressionOptions.EVALUATE_ALWAYS);
                    }
                }
            }

            // Allow the spin control to handle actions first.
            _spinControl.OnAction(action);

            // If the spin control handled the action then avoid the base action handler.
            // In particular this avoids the move up,down,left,right actions from leaving this control too soon.
            if (!_spinControl.ActionHandled)
            {
                base.OnAction(action);
            }
        }
Ejemplo n.º 2
0
        public override void OnAction(Action action)
        {
            switch (action.wID)
            {
            case Action.ActionType.ACTION_PAGE_UP:
                OnPageUp();
                break;

            case Action.ActionType.ACTION_PAGE_DOWN:
                OnPageDown();
                break;

            case Action.ActionType.ACTION_MOVE_DOWN:
                OnDown();
                break;

            case Action.ActionType.ACTION_MOVE_UP:
                OnUp();
                break;

            case Action.ActionType.ACTION_MOVE_LEFT:
                OnLeft();
                break;

            case Action.ActionType.ACTION_MOVE_RIGHT:
                OnRight();
                break;

            default:
                int ivalue = _upDownControl.Value;
                _upDownControl.OnAction(action);
                if (_upDownControl.Value != ivalue)
                {
                    _offset = (_upDownControl.Value - 1) * _itemsPerPage;
                }
                break;
            }
        }
        /// <summary>
        /// OnAction() method. This method gets called when there's a new action like a
        /// keypress or mousemove or... By overriding this method, the control can respond
        /// to any action
        /// </summary>
        /// <param name="action">action : contains the action</param>
        public override void OnAction(Action action)
        {
            GUIMessage message;

            if (Focus)
            {
                if (action.wID == Action.ActionType.ACTION_MOUSE_CLICK || action.wID == Action.ActionType.ACTION_SELECT_ITEM)
                {
                    // send a message to anyone interested
                    message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, WindowId, GetID, ParentID, 0, 0, null);
                    GUIGraphicsContext.SendMessage(message);
                }
            }

            // Allow the spin control to handle actions first.
            _spinControl.OnAction(action);

            // If the spin control handled the action then avoid the base action handler.
            // In particular this avoids the move up,down,left,right actions from leaving this control too soon.
            if (!_spinControl.ActionHandled)
            {
                base.OnAction(action);
            }
        }