Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic move after zoom (Read 3321 times)
Amanda Hillier
Guest


move after zoom
Aug 1st, 2006 at 9:28pm
Print Post  
Stupid question, but I can't figure out how to move the root box in a flowchart to a specific location after the user has performed either the zoomin or zoomout methods.  Can you please help

Thanks
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: move after zoom
Reply #1 - Aug 2nd, 2006 at 6:05am
Print Post  
If what you need is to move a box to a location in the visible region of the flowchart, use the ClientToDoc method to find the logical coordinates of a pixel in the control's client area. Let's say you need to move a box to the (5,5) pixel in the visible area:

Point clientPos = new Point(5, 5);
PointF docPos = fc.ClientToDoc(clientPos);
box.Move(docPos);

HTH
  
Back to top
 
IP Logged
 
Amanda Hillier
Guest


Re: move after zoom
Reply #2 - Aug 2nd, 2006 at 2:12pm
Print Post  
I tried your suggestion but it still doesn't move it to where I want.  Here's what I'm looking for:

I have placed a panel over the far upper left corner of the flowchart for users to interact with when building the text they want in a box.  This mean that I need the root box to be positioned under this panel.  When I zoom the boxes automatically move to the upper left corner as they become progressively smaller.  Eventually, the boxes move underneath the panel and are now invisible.  I need to keep re-positioning the root box back under the panel so the boxes are always visible.  When I set up the rootbox I place it at point 5,40 (which is just below the panel).  I tried using the clientToDoc and the DocToClient with parameters 5,40 but it isn't moving to where I want it.  Any suggestions?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: move after zoom
Reply #3 - Aug 2nd, 2006 at 2:50pm
Print Post  
When you move the box to 5,40 without zoom - is that 5,40 in millimeters?
  
Back to top
 
IP Logged
 
Amanda Hillier
Guest


Re: move after zoom
Reply #4 - Aug 2nd, 2006 at 5:53pm
Print Post  
I use the statement:

_rootBox.Move(5,40);

I also use this statement when creating the box:

_rootBox = this.fcDecisionTree.CreateBox(5,40, 25, 15);

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: move after zoom
Reply #5 - Aug 3rd, 2006 at 6:56am
Print Post  
so 5,40 is millimeters if you haven't changed the MeasureUnit property. When your form loads, call fc.DocToClient() to convert that point to pixels. Then before moving the root box, convert the pixels value back to millimeters with ClientToDoc and move the box.

HTH
  
Back to top
 
IP Logged
 
Amanda Hillier
Guest


Re: move after zoom
Reply #6 - Aug 3rd, 2006 at 12:54pm
Print Post  
That fixed it - thanks for your help!!
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: move after zoom
Reply #7 - Aug 3rd, 2006 at 1:33pm
Print Post  
it's my pleasure  Grin
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint