Ejemplo n.º 1
0
 /// <summary>
 /// 添加控件元素
 /// </summary>
 /// <param name="FunctionControl"></param>
 public void Add(PrjUI.PrjFunction.FunctionBase FunctionControl)
 {
     FunctionControl.MouseMoveOver += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjFunction.FunctionBase.EventMouseMoveOver(FunctionControl_MouseMoveOver);
     FunctionControl.MouseMoves    += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjFunction.FunctionBase.EventMouseMove(FunctionControl_MouseMoves);
     FunctionControl.PrjSort       += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjFunction.FunctionBase.EventPrjSort(FunctionControl_PrjSort);
     FunctionControls.Add(FunctionControl);
 }
Ejemplo n.º 2
0
            /// <summary>
            /// 要检项目排序
            /// </summary>
            /// <param name="Index"></param>
            private void FunctionControl_PrjSort(object sender, int Index)
            {
                PrjUI.PrjFunction.FunctionBase Item = sender as PrjUI.PrjFunction.FunctionBase;

                if (FunctionControls.Contains(Item))
                {
                    FunctionControlsSort.Add(Index, Item);
                }
            }
Ejemplo n.º 3
0
            /// <summary>
            /// 拷贝需要检定的方案
            /// </summary>
            /// <param name="TaiType"></param>
            /// <param name="FaName"></param>
            /// <returns></returns>
            public CLDC_DataCore.Model.Plan.Plan_Function Copy(CLDC_Comm.Enum.Cus_TaiType TaiType, string FaName)
            {
                CLDC_DataCore.Model.Plan.Plan_Function Function = new CLDC_DataCore.Model.Plan.Plan_Function((int)TaiType, "");           //创建一个新的多功能方案

                for (int i = 0; i < FunctionControls.Count; i++)
                {
                    PrjUI.PrjFunction.FunctionBase Item = FunctionControls[i];
                    if (Item.IsCheck)
                    {
                        Function.Add(Item.FunctionID, Item.FunctionName, Item.FunctionPlanPrj.OutPramerter.Jion(), Item.Parm);
                    }
                }
                Function.SetPram((int)TaiType, FaName);
                return(Function);
            }
Ejemplo n.º 4
0
            /// <summary>
            /// 控件面板移动完毕事件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void FunctionControl_MouseMoveOver(object sender, EventArgs e)
            {
                if (!IsMoved)
                {
                    return;                 //如果控件没有移动过
                }
                IsMoved = false;
                bool IsInsert = false;

                PrjUI.PrjFunction.FunctionBase Item = sender as PrjUI.PrjFunction.FunctionBase;

                int Index = FunctionControls.FindIndex(delegate(PrjUI.PrjFunction.FunctionBase FunctionItem) { return(FunctionItem == Item); });

                FunctionControls.Remove(Item);

                for (int i = 0; i < FunctionControls.Count; i++)
                {
                    if (Item.Top < FunctionControls[i].Top + FunctionControls[i].Height)
                    {
                        FunctionControls.Insert(i, Item);
                        IsInsert = true;
                        Index    = i >= Index?Index:i;
                        break;
                    }
                }
                if (!IsInsert)
                {
                    FunctionControls.Add(Item);
                }

                int ScrollValue = 0;

                if (_CtrParent.VerticalScroll.Visible)
                {
                    ScrollValue = _CtrParent.VerticalScroll.Value;
                }
                this.Sort(Index);
                if (_CtrParent.VerticalScroll.Visible)
                {
                    _CtrParent.VerticalScroll.Value = ScrollValue;
                }
            }