Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with Scroll Bars (Read 1278 times)
msperling
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jul 1st, 2010
Problem with Scroll Bars
Jul 7th, 2010 at 8:29pm
Print Post  
I am evaluating MindFusion Diagramming for .net. It is working very well, except for one problem I am having. My diagramview scrollbars are behaving oddly. The showscrollbars property is true. The vertical scroll bar appears even if I use ZoomToFit to display my diagram. The horizontal scroll bar, however, does not appear even if I zoom beyond the ZoomToFit scale. The only way I can get the horizontal scroll bar to appear is by using autoscroll - i.e moving the mouse to the right beyond the diagramview. At that point the horizontal scroll bar appears. It is still visible after a subsequent ZoomToFit call. The code I am using to layout the diagram is the following:

//arrange the nodes
SpringLayout sl = new SpringLayout();
sl.IterationCount = 1000;
sl.NodeDistance = 30;
sl.MinimizeCrossings = true;
int w = diagramView1.Size.Width;
int h = diagramView1.Size.Height;
RectangleF rf = new RectangleF(0,0,w,h);
sl.LayoutArea = rf;
sl.RandomSeed = 0;
sl.Arrange(diagram1);
diagramView1.ZoomToFit();
zoomFactor.Value = (decimal)diagramView1.ZoomFactor;

Another question I have concerns the non deterministic nature of the layout algorithm. Even though I am setting the seed in the above code, the nodes lay out differently each time. Is there a way I can guarantee a consistent layout.

Thanks for your help.
Mike
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with Scroll Bars
Reply #1 - Jul 8th, 2010 at 12:37am
Print Post  
Hi,

If RandomSeed == 0 the generator is seeded with the current time; try setting it to a value greater than 0.

Call ResizeToFitItems after running the layout to show the scrollbars as expected. Alternatively you could set SpringLayout.LayoutArea = diagram.Bounds so that the arranged nodes stay within the current diagram area.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint