Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Node selection area and its edges (Read 3947 times)
Adeed Khalid
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Aug 3rd, 2018
Node selection area and its edges
Aug 3rd, 2018 at 12:58pm
Print Post  
Hi there,
1-I want to select node other than its center point too)like selecting and dragging any where on that node)
-For this i am creating the node by dragging it on diagram
2-How can I stop the edges of the node from getting rounded, it gets curved when i open the saved diagram second time
-For this the node creation code is given below
                                            var customShapeP2 = new Shape(new[]
                               {
                                          new LineTemplate(0, 0, 0, 100),
                                          new LineTemplate(0, 100, 100, 100),
                                          new LineTemplate(100, 100, 100, 0),
                                          new LineTemplate(100, 0, 0, 0)
                                 }, 0, "position");
                        customShapeP2.Id = "textBlock-textBlock";
                        ShapeNode shapeNode = diagram.Factory.CreateShapeNode(0, 0, 318 * width, 20, customShapeP2);
                        shapeNode.TextPadding = th;
                                 shapeNode.FontSize = 9;

                                   Rect rectImg;
                                 rectImg = shapeNode.Shape.ImageRectangle;
                                 rectImg.Height = 20;
                                 rectImg.Width = 318 * width;
                                 Rect rectBound = shapeNode.Bounds;
                                 rectBound.Height = 20;
                                 rectBound.Width = 318 * width;
                                 shapeNode.Bounds = rectBound;
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3443
Joined: Oct 19th, 2005
Re: Node selection area and its edges
Reply #1 - Aug 3rd, 2018 at 3:29pm
Print Post  
Hi,

1. Try different values of node.HandlesStyle property, such as EasyMove, DashFrame, etc. Also check the effect of setting diagram.ModificationStart = AutoHandles.

2. Saved diagrams only store the shape id, and when loading the node will reset to default shape if that shape id has not been registered. Try moving the customShapeP2 definition to your application's initialization code before trying to load diagram files.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Adeed Khalid
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Aug 3rd, 2018
Re: Node selection area and its edges
Reply #2 - Aug 7th, 2018 at 5:12am
Print Post  
Hi,
    Thanks the first one is working fine now, but second one which was about the shape corner is still doing the same, no difference even after defining the customShapeP2 before the diagram loading...
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3443
Joined: Oct 19th, 2005
Re: Node selection area and its edges
Reply #3 - Aug 7th, 2018 at 8:38am
Print Post  
Hi,

Try passing "textBlock-textBlock" directly as argument to Shape constructor instead of changing it later from "position". The constructor stores id->shape mappings in internal dictionary and when ShapeNodes load they will look in this dictionary to find respective shape.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Adeed Khalid
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Aug 3rd, 2018
Re: Node selection area and its edges
Reply #4 - Aug 7th, 2018 at 12:11pm
Print Post  
Hi,
    I am using the diagram control as a UserControl and its working in a tabitem, so when i close and reopen tabitem it works fine but when i open diagram after closing and reopening my main application then the shape corner gets curved.  <Shape Id="xyz" />  what ever id I assign, it changes to this  <Shape Id="RoundRect" />.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3443
Joined: Oct 19th, 2005
Re: Node selection area and its edges
Reply #5 - Aug 8th, 2018 at 7:26am
Print Post  
You'll need to define the "xyz" shape before running the user control's code that loads or builds the diagram. Maybe define it from application's static constructor if you aren't sure which of your controls will be loading a diagram first.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint