Exemple #1
0
        private void ProcessMouseOverMiddleImage(object sender, Point pt, Relationship relationship, bool isEnd1)
        {
            RelationshipEditorForm.Fill(relationship, isEnd1);
            pt = ((LinkLine)sender).MidPoint;
            pt.Offset(-1 * RelationshipEditorForm.Width / 2, -1 * RelationshipEditorForm.Height / 2);
            //RelationshipEditorForm.Location = pt;

            //////////////////////////

            int y = pt.Y + RelationshipEditorForm.Height / 2 - ScrollPosition.Y;

            if (pt.Y + RelationshipEditorForm.Height / 2 - ScrollPosition.Y < this.Height)
            {
                pt.Offset(0, -1 * ScrollPosition.Y);
                RelationshipEditorForm.Location = pt;
            }
            else
            {
                //pt.Offset(0, -1 * RefEditorForm.Height - endRectangle.Height + offset * 2);
                pt.Y = this.Height - RelationshipEditorForm.Height - 2;
                RelationshipEditorForm.Location = pt;
            }


            RelationshipEditorForm.Visible = true;
            RelationshipEditorForm.Refresh();
        }
        void OriginatingLineStyle_MiddleImageClick(object sender, MouseEventArgs e)
        {
            int   offset = 0;
            Point pt     = e.Location;

            pt.Offset(offset, offset);

            //if (endRectangle != CurrentEndRectangle || !RelationshipEditorForm.Visible)
            //{
            //CurrentEndRectangle = endRectangle;
            LinkLine     line         = (LinkLine)sender;
            Relationship relationship = (Relationship)line.DataObject;

            RelationshipEditorForm.Fill(relationship);
            //RelationshipEditorForm.Fill((ReferenceImpl)lineEndWithFocus.Line.DataObject, lineEndWithFocus.EndType == ShapeCanvas.LineEndWithFocus.EndTypes.Start);

            //if (pt.X + RelationshipEditorForm.Width < this.Width)
            //    RelationshipEditorForm.Location = pt;
            //else
            //{
            //    pt.Offset(-1 * RelationshipEditorForm.Width + endRectangle.Width + offset * 2, 0);
            //    RelationshipEditorForm.Location = pt;
            //}
            //if (pt.Y + RelationshipEditorForm.Height < this.Height)
            //    RelationshipEditorForm.Location = pt;
            //else
            //{
            //    pt.Offset(0, -1 * RelationshipEditorForm.Height - endRectangle.Height + offset * 2);
            //    RelationshipEditorForm.Location = pt;
            //}
            pt = ((LinkLine)sender).MidPoint;
            pt.Offset(-1 * RelationshipEditorForm.Width / 2, -1 * RelationshipEditorForm.Height / 2);
            RelationshipEditorForm.Location = pt;
            RelationshipEditorForm.Visible  = true;
            RelationshipEditorForm.Refresh();
            //}
        }