Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Get scrollbars to show when MeasureUnit is pixel (Read 4376 times)
jtexter3
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 28th, 2008
Get scrollbars to show when MeasureUnit is pixel
May 28th, 2008 at 5:01pm
Print Post  
I have a FlowChart.NET component as the main control in a MdiChild form, and I have MeasureUnit set to Pixel.  I have multiple nodes on the diagram which are roots of trees.  Whenever I drag the root over so that the child nodes are not visible, the scroll bars do not show up automatically.  I have tried many solutions, but have not been able to get them to show.  Is this a bug?  Or do I need to add some magic when I have MeasureUnit set to Pixel?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get scrollbars to show when MeasureUnit is pix
Reply #1 - May 28th, 2008 at 5:18pm
Print Post  
Set a larger Diagram.Bounds value, or enable AutoResize.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jtexter3
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 28th, 2008
Re: Get scrollbars to show when MeasureUnit is pix
Reply #2 - May 28th, 2008 at 5:29pm
Print Post  
Okay, I did this by using the following code:

RectangleF diagramBounds = ScriptDiagram.Bounds;

diagramBounds.Width = Screen.PrimaryScreen.Bounds.Width;
diagramBounds.Height = Screen.PrimaryScreen.Bounds.Height;

ScriptDiagram.Bounds = diagramBounds;

That gets the scroll bars to show up, but if drag items out of the viewable region, the scoll bar does not update.  If I add a call to ResizeToFitAllItems, then the scroll bars disappear all together.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get scrollbars to show when MeasureUnit is pix
Reply #3 - May 28th, 2008 at 5:38pm
Print Post  
Don't the scrollbars update if you set AutoResize to AllDirections or RightAndDown, and then drag a node?
  
Back to top
 
IP Logged
 
jtexter3
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 28th, 2008
Re: Get scrollbars to show when MeasureUnit is pix
Reply #4 - May 28th, 2008 at 6:59pm
Print Post  
No, they do not.  I am using ControlNodes, and handling the dragging logic myself by adjusting the location of the node on the form.  I suppose this is what's causing the issue.  Is there a function I can call after I relocated a node to get the scroll bars to update?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get scrollbars to show when MeasureUnit is pix
Reply #5 - May 29th, 2008 at 7:28am
Print Post  
AutoResize and ResizeToFitItems should work, as long as ControlNode.Bounds corresponds to the hosted control's Location. If you are setting Location yourself, are you also updating the node's Bounds?

Stoyan
  
Back to top
 
IP Logged
 
jtexter3
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 28th, 2008
Re: Get scrollbars to show when MeasureUnit is pix
Reply #6 - May 29th, 2008 at 1:23pm
Print Post  
Yes, I am.  The code I"m using to move the control is:

RectangleF bounds = node.Bounds;
bounds.Location = newLocation;
node.Bounds = bounds;

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get scrollbars to show when MeasureUnit is pix
Reply #7 - May 29th, 2008 at 1:33pm
Print Post  
Have you added the child nodes to the diagram? They might be drawn on screen as a part of the tree group, but if you haven't added them to Diagram.Nodes, they will be ignored when calculating the new diagram size.

Stoyan
  
Back to top
 
IP Logged
 
jtexter3
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 28th, 2008
Re: Get scrollbars to show when MeasureUnit is pix
Reply #8 - Jun 24th, 2008 at 1:14pm
Print Post  
I'm still having this issue.  If I add an item at the end that goes off the screen, the scroll bar shows up correctly.  However, whenever I move the root of the tree where child nodes are outside of the viewable area, the scrollbars do not show up.  Although I'm adjusting the Bounds of the root node, and the child nodes are being drawn correctly, it appears their bounds are not being updated, or the diagram is not getting the correct notifications from Arrange to show the scroll bars
  
Back to top
 
IP Logged
 
jtexter3
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 28th, 2008
Re: Get scrollbars to show when MeasureUnit is pix
Reply #9 - Jun 24th, 2008 at 1:30pm
Print Post  
Okay, I figured it out.  After moving the control, I wasn't calling Arrange on the various tree layout objects.  Once I did that, everything is working as expected.
  
Back to top
 
IP Logged
 
jtexter3
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 28th, 2008
Re: Get scrollbars to show when MeasureUnit is pix
Reply #10 - Jun 30th, 2008 at 2:14pm
Print Post  
It turns out this still isn't resolved.  If I have a link from a child node to another node in the viewable area, then the scroll bars show up.  But if I only have a single tree layout, it does not work.   If I move the root of the tree, do I need to update the bounds for all child nodes as well?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get scrollbars to show when MeasureUnit is pix
Reply #11 - Jun 30th, 2008 at 2:56pm
Print Post  
Usually moving the root node does not move the child nodes, unless you have used AttachTo to create a group. After moving the root, you could reapply TreeLayout to move the children as well. After applying a layout, call ResizeToFitItems to update the diagram.Bounds.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint