예제 #1
0
        /// <summary>
        /// Perform actions required when a dragged object is dropped (mouse released).
        /// Put actions : ACT_CTRL_HIT or ACT_HIT and MG_ACT_BEGIN_DROP.
        /// </summary>
        /// <param name="guiMgForm"></param>
        /// <param name="guiMgCtrl"></param>
        /// <param name="line"></param>
        protected virtual void processBeginDrop(GuiMgForm guiMgForm, GuiMgControl guiMgCtrl, int line)
        {
            MgControlBase mgControl = (MgControlBase)guiMgCtrl;
            MgFormBase    mgForm    = (guiMgForm == null) ? mgControl.getForm() : (MgFormBase)guiMgForm;
            bool          isCtrlHit = (mgControl != null) ? true : false; // Drop occurs on a control or a form?

            if (isCtrlHit)
            {
                Manager.EventsManager.addGuiTriggeredEvent(mgControl, InternalInterface.MG_ACT_CTRL_HIT, line);

                if (mgControl.isSubform())
                {
                    Manager.EventsManager.addGuiTriggeredEvent(mgControl.GetSubformMgForm().getTask(), InternalInterface.MG_ACT_BEGIN_DROP);
                }
                else
                {
                    Manager.EventsManager.addGuiTriggeredEvent(mgControl, InternalInterface.MG_ACT_BEGIN_DROP, line);
                }
            }
            else
            { // If Drop occurs on FORM.
                Manager.EventsManager.addGuiTriggeredEvent(mgForm.getTask(), InternalInterface.MG_ACT_HIT);
                Manager.EventsManager.addGuiTriggeredEvent(mgForm.getTask(), InternalInterface.MG_ACT_BEGIN_DROP);
            }
        }
예제 #2
0
 /// <summary>
 /// Width
 /// </summary>
 /// <param name="control"></param>
 /// <param name="properties"></param>
 static void BuildWidthProperty(MgControlBase control, Dictionary <string, DesignerPropertyInfo> properties)
 {
     if (AddNavigationProperties(control))
     {
         int value = -1;
         if (control.Type == MgControlType.CTRL_TYPE_SUBFORM &&
             control.getProp(PropInterface.PROP_TYPE_AUTO_FIT).getValueInt() == (int)AutoFit.AsCalledForm &&
             control.GetSubformMgForm() != null)
         {
             MgFormBase subformForm = control.GetSubformMgForm();
             value = subformForm.getProp(PropInterface.PROP_TYPE_WIDTH).CalcWidthValue(control);
         }
         else
         {
             value = control.getProp(PropInterface.PROP_TYPE_WIDTH).CalcWidthValue(control);
         }
         String keyName = (control.Type == MgControlType.CTRL_TYPE_LINE ? Constants.WinPropX2 : Constants.WinPropWidth);
         CreateCoordinateDesignerPropertyInfo(keyName, control, properties, value);
     }
 }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        /// <param name="properties"></param>
        static void BuildFormNameProperty(MgControlBase control, Dictionary <string, DesignerPropertyInfo> properties)
        {
            MgFormBase form = control.GetSubformMgForm();

            if (form == null)
            {
                form = control.getForm();
            }
            String controlsPersistencyPath = EnvControlsPersistencyPath.GetInstance().GetFullControlsPersistencyFileName(form);

            properties.Add(Constants.ConfigurationFilePropertyName, new DesignerPropertyInfo()
            {
                VisibleInPropertyGrid = true, Value = controlsPersistencyPath, IsNativeProperty = false
            });
        }