Exemplo n.º 1
0
        /// <summary></summary>
        /// <param name = "guiMgForm"></param>
        /// <param name = "guiMgCtrl"></param>
        /// <param name = "dotNetArgs"></param>
        /// <param name = "leftClickWasPressed"></param>
        /// <param name = "line"></param>
        private void processMouseDown(GuiMgForm guiMgForm, GuiMgControl guiMgCtrl, Object[] dotNetArgs, bool leftClickWasPressed, int line, bool onMultiMark, bool canProduceClick)
        {
            MgControlBase mgControl = (MgControlBase)guiMgCtrl;

            // Click on form or Click on the Subform's form should handle mg_act_hit (not control_hit).
            if (mgControl == null)
            {
                Debug.Assert(guiMgForm != null);
                // As in online. clicking on a form results in ACT_HIT
                Manager.EventsManager.addGuiTriggeredEvent(((MgFormBase)guiMgForm).getTask(), InternalInterface.MG_ACT_HIT, onMultiMark);
                return;
            }
            else if (mgControl.isSubform())
            {
                mgControl.OnSubformClick();
                return;
            }

            if (mgControl.RaiseControlHitOnMouseDown(leftClickWasPressed))
            {
                Manager.EventsManager.addGuiTriggeredEvent(mgControl, InternalInterface.MG_ACT_CTRL_HIT, line, null, onMultiMark);
            }

            if (leftClickWasPressed && canProduceClick)
            {
                // fixed bug#927942
                // we never get to this method with the control type button & checkbox.
                // for button & checkbox, we sent the trigger MG_ACT_WEB_CLICK in EventsManager.handleMouseUp() that call
                // from simulateSelection()
                // the "if" is only for make sure that if we will get it (in the feture) we will not be sent the same trigger twice
                if (mgControl.Type != MgControlType.CTRL_TYPE_BUTTON && mgControl.Type != MgControlType.CTRL_TYPE_CHECKBOX)
                {
                    Manager.EventsManager.addGuiTriggeredEvent(mgControl, InternalInterface.MG_ACT_WEB_CLICK, line, dotNetArgs, false);
                }
            }
        }