Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Deselecting links/node on MouseUp (Read 2042 times)
egreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Aug 21st, 2008
Deselecting links/node on MouseUp
Apr 25th, 2009 at 11:06am
Print Post  
Hi,

I wrote a code that would allow a user to select an area to zoom in to by pressing the shift-key and dragging the mouse over the area.
The zoom-in works fine, however I try to deselect all the links and nodes which are automatically selected by Flowchart due to the Selection rectangle haing been created, but my DeselectAllObjects() method doesn't seem to have any effect.


private void diagramView1_MouseUp(object sender, MouseEventArgs e)
{

if (_active_key == Keys.Shift)
{
diagramView1.ZoomToRect(this.diagram1.Selection.Bounds);
}
_active_key = Keys.A;
}

private void DeselectAllObjects()
{
foreach (DiagramNode node in this.diagram1.Nodes)
{
node.Selected = false;
}
foreach (DiagramLink link in this.diagram1.Links)
{
link.Selected = false;
}
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Deselecting links/node on MouseUp
Reply #1 - Apr 26th, 2009 at 9:44am
Print Post  
At what point is that DeselectAllObjects method invoked?
  
Back to top
 
IP Logged
 
egreen
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 11
Joined: Aug 21st, 2008
Re: Deselecting links/node on MouseUp
Reply #2 - Apr 26th, 2009 at 12:14pm
Print Post  
oops. must have erased that part from the code snippet.
i'm calling it right after ZoomToRect inside the MouseUp method.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Deselecting links/node on MouseUp
Reply #3 - Apr 27th, 2009 at 8:33am
Print Post  
Perhaps MouseUp is raised before the items are selected, so clearing the selection from there does not work. You could handle the NodeSelecting and LinkSelecting validation events and set e.Cancel = true when your application is in zoom mode.

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