Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to edit nodes in Containers? (Read 2586 times)
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
how to edit nodes in Containers?
Sep 4th, 2007 at 3:20pm
Print Post  
Hi guys - i apologise if this is a really stupid question. I have created a container and added 2 tableNodes to it. Before i added the nodes I was able to edit and link them. But after i added them to the container they no longer seemed to receive any of my input. Could you perhaps tell me what ive done wrong? Or what i need to specify.

Another question regarding containers. Can they be resized by the user? I looked at EnabledHandles but could not get the container to resize. I have also disabled autoshrink.

Thanks a heap everyone.
Kind regards
Mat
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to edit nodes in Containers?
Reply #1 - Sep 4th, 2007 at 3:42pm
Print Post  
Hi Mat,

I have tested that and can't see any problem neither with modifying contained tables, nor drawing links between them. Are you using the official 5.0 version, or one of the preview / beta versions? What Behavior, ModificationStart, EnabledHandles and HandlesStyle values are you using?

The default HandlesStyle of containers is set to MoveOnly. Set it to another value, e.g. DashFrame, to allow resizing containers interactively. In addition, enable the resize-related bits in EnabledHandles.


Stoyan
  
Back to top
 
IP Logged
 
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Re: how to edit nodes in Containers?
Reply #2 - Sep 5th, 2007 at 6:49am
Print Post  
Hi Stoyo - thanks for getting back to me. Here is the code that I used. Your suggestion of using dashFrame fixed the resize issue. But I still cant select the table once its inside the container. If I add a shapeNode then I can select and move it. But one thing i noticed was that I could not select the links i created from the shapeNode. I am using the trial version in the downloads section. Does this mean I dont have the right version? Another strange issue is that the table is only visible if i select the container...

Thanks once again Smiley

Code
Select All
//Create Table
            TableNode tn = new TableNode(diagram);
            tn.Expandable = true;
            tn.Caption = "Acts";
            tn.RowCount = 1;
            tn.ColumnCount = 1;

            // Create an anchor pattern to be assigned to the table
           AnchorPattern pattern = new AnchorPattern(
                new AnchorPoint[]


            {



            new AnchorPoint(0, 0, true, true, Color.Blue, 0),


            });
           tn.AnchorPattern = pattern;



            //Create container
            ContainerNode con = new ContainerNode();
            con.Caption = "Container";
            con.AutoShrink = false;
            con.EnabledHandles = AdjustmentHandles.Move | AdjustmentHandles.ResizeBottomRight;
            con.HandlesStyle = HandlesStyle.DashFrame;
            con.AnchorPattern = new AnchorPattern(
                new AnchorPoint[]


            {



            new AnchorPoint(0, 0, true, true, Color.Blue, 0),


            });
            con.Add(tn); //Add table

            //Add both to diagram
            diagram.Nodes.Add(tn);
            diagram.Nodes.Add(con);   

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to edit nodes in Containers?
Reply #3 - Sep 5th, 2007 at 7:40am
Print Post  
Hi Mat,

The problem happens because the table ZIndex is lower than the container's one. To fix it, add the table to the container after both have been added to the diagram:

//Add both to diagram
diagram.Nodes.Add(con); 
diagram.Nodes.Add(tn);
con.Add(tn); //Add table

Then the table will be automatically moved above the container it in the diagram's Z order. Otherwise you can explicitly set the table's ZIndex or call ZTop after adding both nodes to the diagram.

As a rule of thumb, before doing operations that affect multiple items, it is safer to add them to the diagram first.

Just having Add(con) called before Add(tn) also makes the table's ZIndex higher than the container's one:

con.Add(tn); //Add table
diagram.Nodes.Add(con);   
diagram.Nodes.Add(tn);

though the first variant is better.

Stoyan
  
Back to top
 
IP Logged
 
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Re: how to edit nodes in Containers?
Reply #4 - Sep 5th, 2007 at 8:19am
Print Post  
Ah got it. Thanks Stoyo, big help my friend Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint