We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Addint and removing ports on bounds change

Thread ID:

Created:

Updated:

Platform:

Replies:

35931 Oct 14,2005 06:07 AM Oct 26,2005 07:43 AM Windows Forms 2
loading
Tags: Diagram
Sachin
Asked On October 14, 2005 06:07 AM

Hi I have a long line symbol running across the doagram whose ports to be added acording to its width when resized. I am using the following code in bounds changed event.... protected override void OnBoundsChanged(BoundsEventArgs evtArgs) { for(int j = this.Ports.Count ; j>0; j--) { this.Ports.Remove(this.Ports[j-1]); } for(int i = 0;i

Meera Fathima [Syncfusion]
Replied On October 20, 2005 01:35 AM

Hi Sachin, As per my update on the Direc Trac incident #21544, I will try to come up with a solution as soon as possible. And to draw the Start Cap/End Cap for a line, you can use the Line class FirstEndPointDecorator/LastEndPointDecorator properties. My apologies for the delay. Thanks for your support to Syncfusion. Regards, Meera.

Meera Fathima [Syncfusion]
Replied On October 26, 2005 07:43 AM

Hi Sachin, I am sorry about this delay in getting back to you on this issue.The LineStyle class has only the EndCap property and StartCap property was leftout.A QA report regarding this issue has been logged, and we will fix the issue in a future release of the product. The incident id is #954. You can see the report details using our web based tracking system. The workaround for adding the StartCap would be to subclass the Line class, override the Line.Draw(...) method and add the start cap to the Pen after it gets created. Referring the Line.cs file will help you to work with this. As for adding the new ports, it is necessary to get hold of the symbol''s transformation matrix, and apply an inverse transform on the point to be used for the port.The following revised implementation of your OnBoundsChanged() method shows how to go about it, protected override void OnBoundsChanged(BoundsEventArgs evtArgs) { base.OnBoundsChanged (evtArgs); for(int j = this.Ports.Count ; j>0; j--) { this.Ports.Remove(this.Ports[j-1]); } float xoffset = this.X; while(xoffset < (this.X + this.Width)) { PointF ptworld = new PointF(xoffset, this.Location.Y + this.Height / 2); PointF[] pts = new PointF[] {ptworld}; Matrix worldxform = this.WorldTransform; worldxform.Invert(); worldxform.TransformPoints(pts); CirclePort cPort = new CirclePort(pts[0]); this.Ports.Add(cPort); xoffset += 10f; } } I hope the above information will help you. Please let me know if you need further assistance on this issue. Thanks for your patience and support. Regards, Meera.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;