Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic User is not allowed to expand the canvas area (Read 3045 times)
Saroj Kumar Sahu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Jun 4th, 2013
User is not allowed to expand the canvas area
Jun 4th, 2013 at 7:00am
Print Post  
Hi,

I am relatively new to diagramming in Mind Fusion and I'm using version3.0.
Can anyone tell me how to make automatic scrolling while user simple select the canvas
and move the mouse(this is possible in version 2.0.)
I'm able to scroll while dragging item with the mouse.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: User is not allowed to expand the canvas area
Reply #1 - Jun 4th, 2013 at 7:20am
Print Post  
Hi,

Scrolling by dragging the canvas can be done by setting Behavior = Pan or by holding down the ALT key. Expanding the canvas area will work only when dragging items or drawing selection rectangles, if the AutoResize property is enabled.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Saroj Kumar Sahu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Jun 4th, 2013
Re: User is not allowed to expand the canvas area
Reply #2 - Jun 4th, 2013 at 8:39am
Print Post  
Hello sir,
Thanks for your quick reply.
Expanding the canvas area is working only when dragging items but Expanding the canvas area with drawing selection rectangles is not working for me.
Behavior = Behavior.Modify;
when i comment this behavior then its working.
can you plz tell me why its happening Shocked.

Thanks
« Last Edit: Jun 4th, 2013 at 11:57am by Saroj Kumar Sahu »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: User is not allowed to expand the canvas area
Reply #3 - Jun 4th, 2013 at 11:26am
Print Post  
Hi,

Actually AutoResize while drawing new selection is no longer supported, because people complained about it -
http://mindfusion.eu/Forum/YaBB.pl?num=1260855648/8#8

Now you get only auto-scrolling for the selection rectangle. If you need to resize, you could set diagram.Bounds to the union of diagram's and selection.Bounds, e.g. from the OnMouseMove override of a custom behavior class.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Saroj Kumar Sahu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Jun 4th, 2013
Re: User is not allowed to expand the canvas area
Reply #4 - Jun 4th, 2013 at 12:08pm
Print Post  
Hi,
Thanks for reply again.
so basically its not possible to Expanding the canvas area with drawing selection rectangles without custom class.
and you said that If you need to resize, you could set diagram.Bounds to the union of diagram's and selection.Bounds, e.g. from the OnMouseMove override of a custom behavior class.can you tell me how to do that (how to set diagram.Bounds to the union of diagram's and selection.Bounds) ?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: User is not allowed to expand the canvas area
Reply #5 - Jun 4th, 2013 at 2:01pm
Print Post  
Hi,

If you were using say the standard Modify behavior, now replace it with this custom class instead:

Code
Select All
diagram.CustomBehavior = new MyModifyBehavior(diagram);

class MyModifyBehavior : ModifyBehavior
{
	protected internal MyModifyBehavior(Diagram diagram) :
		base(diagram)
	{
	}

	protected override void OnMouseMove(Point mousePosition)
	{
		base.OnMouseMove(mousePosition);

		if (Diagram.Interaction != null &&
			Diagram.Interaction.CurrentItem is Selection &&
			Diagram.Interaction.Action == Action.Create)
		{
			if (!Diagram.Bounds.Contains(Diagram.Selection.Bounds))
			{
				var r = Diagram.Bounds;
				r.Union(Diagram.Selection.Bounds);
				Diagram.Bounds = r;
			}
		}
	}
}
 



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