Beispiel #1
0
		internal bool confirmSelect(ChartObject obj)
		{
			bool res = true;

			switch (obj.getType())
			{
				case ItemType.Box:
					if (BoxSelecting != null)
					{
						BoxConfirmArgs args = new BoxConfirmArgs((Box)obj);
						BoxSelecting(this, args);
						res = args.Confirm;
					}
					break;
				case ItemType.ControlHost:
					if (ControlHostSelecting != null)
					{
						ControlHostConfirmArgs args = new ControlHostConfirmArgs((ControlHost)obj);
						ControlHostSelecting(this, args);
						res = args.Confirm;
					}
					break;
				case ItemType.Table:
					if (TableSelecting != null)
					{
						TableConfirmArgs args = new TableConfirmArgs((Table)obj);
						TableSelecting(this, args);
						res = args.Confirm;
					}
					break;
				case ItemType.Arrow:
					if (ArrowSelecting != null)
					{
						ArrowConfirmArgs args = new ArrowConfirmArgs((Arrow)obj);
						ArrowSelecting(this, args);
						res = args.Confirm;
					}
					break;
			}

			return res;
		}
Beispiel #2
0
		internal bool confirmModify(ChartObject item)
		{
			PointF point = AlignPointToGrid(interaction.CurrentPoint);
			int selHandle = interaction.SelectionHandle;
			bool validated = true;

			switch (item.getType())
			{
				case ItemType.Box:
					if (BoxModifying != null)
					{
						Box box = (Box)item;
						BoxConfirmArgs args = new BoxConfirmArgs(box, point, selHandle);
						BoxModifying(this, args);
						validated = args.Confirm;
					}
					break;
				case ItemType.ControlHost:
					if (ControlHostModifying != null)
					{
						ControlHost host = (ControlHost)item;
						ControlHostConfirmArgs args = new ControlHostConfirmArgs(host, point, selHandle);
						ControlHostModifying(this, args);
						validated = args.Confirm;
					}
					break;
				case ItemType.Table:
					if (TableModifying != null)
					{
						Table table = (Table)item;
						TableConfirmArgs args = new TableConfirmArgs(table, point, selHandle);
						TableModifying(this, args);
						validated = args.Confirm;
					}
					break;
				case ItemType.Arrow:
					if (ArrowModifying != null)
					{
						Arrow arrow = (Arrow)item;
						ArrowConfirmArgs args = new ArrowConfirmArgs(arrow, point, selHandle);
						ArrowModifying(this, args);
						validated = args.Confirm;
					}
					break;
			}

			return validated;
		}
Beispiel #3
0
 private void flowChart1_ArrowSelecting(object sender, ArrowConfirmArgs e)
 {
     BoxPropertiesExt pro = (BoxPropertiesExt)e.Arrow.Tag;
     pro.property.typbeName = "分支";// pro.model;
     propertyGrid1.SelectedObject = pro.property;
 }
Beispiel #4
0
        /// <summary>
        /// 箭头绘画
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void flowChart1_ArrowCreating(object sender, AttachConfirmArgs e)
        {
            Box destBox = (Box)e.Destination;
            Box originBox=(Box)e.Origin;

            //判断连接点的输入元件类型是否相同,相同则不允许连接
            if (MainFormExt.ConnectorElements.Contains(destBox))
            {
                foreach (Arrow arrow in destBox.IncomingArrows)
                {
                    Box box = (Box)arrow.Destination;
                    if (box.Text == destBox.Text)
                    {
                        e.Confirm = false;
                        return;
                    }
                }

            }

            if (MainFormExt.ComponentElements.Contains(originBox)&&
                MainFormExt.ComponentElements.Contains(destBox) &&
                (originBox.OutgoingArrows.Count > 0 || destBox.IncomingArrows.Count > 0))
            {
                e.Confirm = false;
                return;
            }
            else if (MainFormExt.StartElements.Contains(originBox) &&
                //originBox.OutgoingArrows.Count<=0&&
                MainFormExt.ComponentElements.Contains(destBox))
            {
                e.Confirm = true;
            }
            else if (MainFormExt.ConnectorElements.Contains(originBox) &&
                MainFormExt.ComponentElements.Contains(destBox))
            {
                e.Confirm = true;
            }
            else if (MainFormExt.ComponentElements.Contains(originBox) &&
                       (MainFormExt.ComponentElements.Contains(destBox) ||
                           (MainFormExt.EndElements.Contains(destBox)
                //&&destBox.IncomingArrows.Count<=0
                           ) ||
                           MainFormExt.ConnectorElements.Contains(destBox)
                       )
                   )
            {
                e.Confirm = true;
            }
            else
            {
                e.Confirm = false;
                return;
            }

            BoxPropertiesExt pro = new BoxPropertiesExt();
            pro.property = (Element)new ArrowElement();
            pro.model = "-3";
            e.Arrow.Tag = pro;

            ArrowConfirmArgs args = new ArrowConfirmArgs(e.Arrow);
            flowChart1_ArrowSelecting(this.propertyGrid1, args);
            //this.propertyGrid1.SelectedObject = pro;
        }
Beispiel #5
0
 private void flowChart1_ArrowModifying(object sender, ArrowConfirmArgs e)
 {
   toolStripStatusLabel1.Text = GridUnfix(e.Point).ToString();
 }
Beispiel #6
0
    private void fcFlowChart_ArrowModifying(object sender, ArrowConfirmArgs e)
    {

      form1.ModeModify();

      if (fcFlowChart.Selection.Arrows.Count == 1) // We're playing with just one arrow...
      {
        DoArrowModifyingOperations(e.Arrow, e.SelectionHandle);
      }
    }
Beispiel #7
0
 private void fcFlowChart_ArrowDeleting(object sender, ArrowConfirmArgs e)
 {
   e.Confirm = false;
   MessageBox.Show("Not Implemented");
 }