Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Question about drag-and-drop of tree. (Read 5002 times)
Joanna
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: May 15th, 2006
Question about drag-and-drop of tree.
May 26th, 2006 at 6:53am
Print Post  
What I want to realize is that:
At the left, there is a tree of components library, and each childitem is a groupitem by a box with picture and a box with text.

At the right, there is another client with a flowchart.

And I want to drag-and-drop the childitems into the right client and hock them into a system.

But now I have some questions:
1. When I drag-and drop the Icons, the arrow between the root and child also is also moving, how can I set them into static without moving, just like the really drag-and-drop in the really world?

2. When I Expand or Collapsed the items, the boxes with picture work well, but the boxes with text that is group to the boxes with picture does work. That is to say, when I collapsed the root item, all the pictures are collapsed, but all the text are not collapsed. How can I solve this promble?

Hope for your help, thank you! Smiley

And then
I want to drag the childitem into the right

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Question about drag-and-drop of tree.
Reply #1 - May 26th, 2006 at 7:19am
Print Post  
You could follow the method demonstrated in the Palette example. It creates two layers of boxes in the palette - the upper layer provides the icons that are used for drag-and-drop. The boxes in the layer below display labels and stay in place while the icons above are dragged. The arrows should be connected to the boxes in the lower layer so they do not move.

At this time expanding/collapsing does not propagate through groups but only through arrows. To work around that handle the BoxExpanded/Collapsed events, and in the handler iterate the label boxes, setting their Visible property to the same value as that of the picture boxes' Visible.

Stoyan
  
Back to top
 
IP Logged
 
Joanna
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: May 15th, 2006
Re: Question about drag-and-drop of tree.
Reply #2 - May 28th, 2006 at 11:15pm
Print Post  
Hi, Stoyo

I have try to follow the way domonstrated in the palette example, but the lower layer should set to be locked intend to no moving, in that way, the arrows connected between these lower boxes are also locked. Then they cannot be expanding/collapsing. Then how can I do next?

As for the second question, the tree I want to build is that each childitem is group by a box with picture and a box with text.
The problem is that when I collapsing the tree, the boxes with pictures are collapsed, but the boxes with text are not collapsed. Then how can I collapsing/expanding the boxes with pictures and the boxes with text together, just like the real tree do?

Thank you! Smiley

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Question about drag-and-drop of tree.
Reply #3 - May 29th, 2006 at 5:42am
Print Post  
Hi,

Instead of locking the items, try setting the HandlesMask to 0 - that will allow some interaction with them but not moving or resizing.

This should answer the second question:
Quote:
At this time expanding/collapsing does not propagate through groups but only through arrows. To work around that handle the BoxExpanded/Collapsed events, and in the handler iterate the label boxes, setting their Visible property to the same value as that of the picture boxes' Visible.


Instead of using groups, you could try the tsBelow text style to display labels below icons.

Stoyan
  
Back to top
 
IP Logged
 
Joanna
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: May 15th, 2006
Re: Question about drag-and-drop of tree.
Reply #4 - May 29th, 2006 at 6:19am
Print Post  
Hi, Stoyo

Thank you very much, I will try!

As for the second question, I want to show the text in the left of the icons but not below the icons, so the tsBelow maynot work. SmileyBut now I have got some understanding on your suggestion in the Quote, I will try, and really thank you very much! Smiley

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Question about drag-and-drop of tree.
Reply #5 - May 29th, 2006 at 6:27am
Print Post  
Hi,

You might create wider boxes and set their text alignment to left and image alignment to right. You could also create a ShapeTemplate object and define its text area to ensure the text won't overlap the image. Assign the ShapeTemplate to the Shape property of boxes.

Stoyan
  
Back to top
 
IP Logged
 
Joanna
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: May 15th, 2006
Re: Question about drag-and-drop of tree.
Reply #6 - May 29th, 2006 at 7:18am
Print Post  
Ok, thank you! I will try this.

But now I have another question: When the boxes can be expandable, there will be a icon like this "+"showing in the right edge of the box. How can I set this icon in the left edge of the box, just like the tree in the VC project? Is there any property to set this style?

I looked for the User Guider document, but have not found. Hope for your help. Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Question about drag-and-drop of tree.
Reply #7 - May 29th, 2006 at 7:21am
Print Post  
At this time you can only choose from a list of predefined locations for the +/- buttons - try some of the ExpandBtnPos values.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint