Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic To Define Overviewing Area (Read 3573 times)
bemorem
YaBB Newbies
*
Offline


MacPro Xeon Quad

Posts: 44
Joined: May 3rd, 2007
To Define Overviewing Area
Dec 22nd, 2008 at 8:44am
Print Post  
Hi,

We need to Define the Overviewing Area .

"Overviewing Area" is a location and size of Area including a center-node(ie. current node) in flowchart.

How can we implement this ?

Thanks & Merry Christmas~!

  

HW: MacPro Xeon Quad/ 4GB RAM&&OS: WinXP sp3 / .NET 3.5&&Dev: VS 2008 C# sp1&&flowchart .Net ver 4.3.x&&
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: To Define Overviewing Area
Reply #1 - Dec 22nd, 2008 at 8:55am
Print Post  
Hi,

Create a RectangleF centered around the current-node Bounds and call DiagramView.ZoomToRect.

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


MacPro Xeon Quad

Posts: 44
Joined: May 3rd, 2007
Re: To Define Overviewing Area
Reply #2 - Dec 22nd, 2008 at 10:46am
Print Post  
I'm using the overview1 control in another form.

So, I need to synchronizing the overview1 and flowchart.

when click the box, only the neighboring area of box must be shown in overview. --;

Merry X-mas.





  

HW: MacPro Xeon Quad/ 4GB RAM&&OS: WinXP sp3 / .NET 3.5&&Dev: VS 2008 C# sp1&&flowchart .Net ver 4.3.x&&
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: To Define Overviewing Area
Reply #3 - Dec 22nd, 2008 at 1:46pm
Print Post  
This method is available only for DiagramView. The following might work for Overview:

1) set Diagram.Bounds to the rectangle centered around the current node
2) enable Overview.FitAll; this should make the tracking rectangle as big as the overview window
3) save Overview.ScaleFactor into some field
4) disable FitAll and restore the original Diagram.Bounds
5) set Overview.ScaleFactor to the saved value

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


MacPro Xeon Quad

Posts: 44
Joined: May 3rd, 2007
Re: To Define Overviewing Area
Reply #4 - Dec 23rd, 2008 at 1:56am
Print Post  
Code
Select All
	  private void flowChart1_BoxClicked(object sender, BoxMouseArgs e)
	  {

		RectangleF rect1 = new RectangleF();

		rect1.Location = e.Box.BoundingRect.Location;
		rect1.Size = e.Box.BoundingRect.Size;

		flowChart1.Bounds = Rectangle.Round(rect1);

		FormClip frmclip = new FormClip();
		frmclip.overview1.Document = flowChart1;
		// fitall
		frmclip.overview1.FitAll = true;
		// save scale factor
		float sf1=frmclip.overview1.ScaleFactor;
		// recover bounds
		frmclip.overview1.FitAll = false;
		frmclip.overview1.Bounds = Rectangle.Round(rect1);
		// recover scale factor
		frmclip.overview1.ScaleFactor = sf1;

		frmclip.Show();

	  }
 



My Code is the Above.

But not work correct.

what's wrong?

result screen shot is here.
http://pic7.ohpy.com/up/elbbs/2008/12/23/161924/1167068144/mid_%BD%C7%C6%D0.png

And My Intend is
http://pic7.ohpy.com/up/elbbs/2008/12/23/161924/1523656014/mid_%B8%F1%C7%A5.gif



  

HW: MacPro Xeon Quad/ 4GB RAM&&OS: WinXP sp3 / .NET 3.5&&Dev: VS 2008 C# sp1&&flowchart .Net ver 4.3.x&&
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: To Define Overviewing Area
Reply #5 - Dec 23rd, 2008 at 6:17am
Print Post  
If you are using FlowChart.NET v4, set flowChart1.DocExtents and not flowChart1.Bounds. The aim is to trick the overview to give you what ScaleFactor would fit the rectangle specified by you, and that can be done by temporarily setting the flowchart's document area to that rectangle and enabling FitAll.

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


MacPro Xeon Quad

Posts: 44
Joined: May 3rd, 2007
Re: To Define Overviewing Area
Reply #6 - Dec 23rd, 2008 at 7:53am
Print Post  
Code
Select All
  private void flowChart1_BoxClicked(object sender, BoxMouseArgs e)

  {



RectangleF rect1 = new RectangleF();



rect1 = e.Box.BoundingRect;


rect1.Inflate(100, 100);



RectangleF rr = flowChart1.DocExtents;


flowChart1.DocExtents = Rectangle.Round(rect1);





FormClip frmclip = new FormClip();


frmclip.overview1.Document = flowChart1;





frmclip.overview1.FitAll = true;



float sf1=frmclip.overview1.ScaleFactor;



frmclip.overview1.FitAll = false;


frmclip.overview1.Bounds = Rectangle.Round(rect1);



frmclip.overview1.ScaleFactor = sf1;




frmclip.Show();



// UnRemarking Here is 2nd After result


//flowChart1.DocExtents = rr;

  } 



I tried with docextents.

Result here: "before clicking node"
http://pic7.ohpy.com/up/elbbs/2008/12/23/161924/2109052096/mid_before.gif

"After Clicking Node"
- correct overview, but flowchart's graphic is shifted.
http://pic7.ohpy.com/up/elbbs/2008/12/23/161924/1824715853/mid_after.gif

"After Clicking Node: 2nd case"
- UnCorrect overview, but flowchart's graphic is unchanged.
http://pic7.ohpy.com/up/elbbs/2008/12/23/161924/1380709908/mid_after2.gif

I want Correct Overview and Unchanged Flowchart's Graphic at the same time.
  

HW: MacPro Xeon Quad/ 4GB RAM&&OS: WinXP sp3 / .NET 3.5&&Dev: VS 2008 C# sp1&&flowchart .Net ver 4.3.x&&
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: To Define Overviewing Area
Reply #7 - Dec 23rd, 2008 at 10:54am
Print Post  
Setting DocExtents might also change the ScrollX and ScrollY values, so try saving and restoring them too.
  
Back to top
 
IP Logged
 
bemorem
YaBB Newbies
*
Offline


MacPro Xeon Quad

Posts: 44
Joined: May 3rd, 2007
Re: To Define Overviewing Area
Reply #8 - Dec 24th, 2008 at 1:21am
Print Post  
Thanks, It works correctly.
  

HW: MacPro Xeon Quad/ 4GB RAM&&OS: WinXP sp3 / .NET 3.5&&Dev: VS 2008 C# sp1&&flowchart .Net ver 4.3.x&&
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint