示例#1
0
        public virtual Control CreateControl(GoView view)
        {
            Type controlType = ControlType;

            if (controlType != null)
            {
                Control          obj             = (Control)Activator.CreateInstance(controlType);
                RectangleF       bounds          = Bounds;
                Rectangle        rectangle2      = obj.Bounds = view.ConvertDocToView(bounds);
                IGoControlObject goControlObject = obj as IGoControlObject;
                if (goControlObject != null)
                {
                    goControlObject.GoView    = view;
                    goControlObject.GoControl = this;
                }
                return(obj);
            }
            return(null);
        }
示例#2
0
        // resizing updates the values for Begin and End
        public override void DoResize(GoView view, RectangleF origRect, PointF newPoint, int whichHandle, GoInputState evttype, SizeF min, SizeF max)
        {
            Lifeline line = this.Parent as Lifeline;

            if (line != null)
            {
                RectangleF box     = ComputeResize(origRect, newPoint, whichHandle, min, max, true);
                Rectangle  viewbox = view.ConvertDocToView(box);
                view.DrawXorBox(viewbox, evttype != GoInputState.Finish);
                if (evttype == GoInputState.Finish)
                {
                    this.Begin = line.GetStep(box.Top);
                    this.End   = line.GetStep(box.Bottom);
                    line.LayoutChildren(this);
                    line.Port.LinksOnPortChanged(GoObject.ChangedBounds, 0, null, NullRect, 0, null, NullRect);
                }
            }
            else
            {
                base.DoResize(view, origRect, newPoint, whichHandle, evttype, min, max);
            }
        }
示例#3
0
        /// <summary>
        /// Make sure the Control in the view exists and is positioned and sized correctly.
        /// </summary>
        /// <param name="g"></param>
        /// <param name="view"></param>
        /// <remarks>
        /// This ignores the <see cref="P:Northwoods.Go.GoObject.Shadowed" /> property.
        /// Controls are not created for <see cref="T:Northwoods.Go.GoOverview" /> views--instead
        /// they are drawn as light gray rectangles.
        /// </remarks>
        public override void Paint(Graphics g, GoView view)
        {
            if (view is GoOverview)
            {
                RectangleF bounds = Bounds;
                GoShape.DrawRectangle(g, view, GoShape.Pens_Black, GoShape.Brushes_LightGray, bounds.X, bounds.Y, bounds.Width, bounds.Height);
                return;
            }
            Control control = GetControl(view);

            if (control != null)
            {
                RectangleF bounds2 = Bounds;
                Rectangle  bounds3 = view.ConvertDocToView(bounds2);
                if (!(control is GoText.ComboBoxControl))
                {
                    control.Bounds = bounds3;
                }
                if (!control.Visible)
                {
                    control.Visible = true;
                }
            }
        }
示例#4
0
 // resizing updates the values for Begin and End
 public override void DoResize(GoView view, RectangleF origRect, PointF newPoint, int whichHandle,
                               GoInputState evttype, SizeF min, SizeF max)
 {
     var line = Parent as Lifeline;
     if (line != null)
     {
         RectangleF box = ComputeResize(origRect, newPoint, whichHandle, min, max, true);
         Rectangle viewbox = view.ConvertDocToView(box);
         view.DrawXorBox(viewbox, evttype != GoInputState.Finish);
         if (evttype == GoInputState.Finish)
         {
             Begin = line.GetStep(box.Top);
             End = line.GetStep(box.Bottom);
             line.LayoutChildren(this);
             line.Port.LinksOnPortChanged(ChangedBounds, 0, null, NullRect, 0, null, NullRect);
         }
     }
     else
     {
         base.DoResize(view, origRect, newPoint, whichHandle, evttype, min, max);
     }
 }