Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Cancel interaction with ESC and start another one (Read 1367 times)
Cornel
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 23
Joined: Dec 17th, 2008
Cancel interaction with ESC and start another one
Mar 9th, 2010 at 8:09am
Print Post  
Hi,
I need to cancel the interaction using ESC key and for this I used diagram.Interaction.CancelNow().

It worked, but when I start another interaction it starts from the point the cancelled interaction started instead of current mouse position.
What to do (version 5.3.3)?

Thanks,
Cornel
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Cancel interaction with ESC and start another
Reply #1 - Mar 9th, 2010 at 10:13am
Print Post  
Hi,

For now you could cancel it as shown below:

Code
Select All
private void diagramView_KeyDown(object sender, KeyEventArgs e)
{
	if (e.KeyCode == Keys.Escape && diagram.Interaction != null)
	{
		diagram.Interaction.Cancel(diagram);
		diagram.Interaction = new InteractionState(null, 0, Action.None);
		diagramView.Invalidate();
	}
} 



The Interaction Cancel/CancelNow methods are mostly for internal use by the View classes and validation events. We'll implement some official method for canceling the interaction in the next release.

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


I love YaBB 1G - SP1!

Posts: 23
Joined: Dec 17th, 2008
Re: Cancel interaction with ESC and start another
Reply #2 - Mar 9th, 2010 at 10:41am
Print Post  
It worked ok.

Thanks,
Cornel
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint