Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Howto Cycle Overlapping Arrow Selection?? (Read 2835 times)
mkeele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Howto Cycle Overlapping Arrow Selection??
Sep 22nd, 2008 at 11:08pm
Print Post  
We have two boxes and two arrows that go from each to the other (on top of each other). The arrows have text (representing UI events) associated with them. The user needs to be able to see the event names on each of these arrows, but when we display the text of all selected arrows, it's obviously garbled and unrecognizable.

How can I "cycle" through the arrows?.. ie first click selects first in z-depth.. second selects next arrow in z-depth, etc.

I'm getting an arrowdeselected immediately after the arrowselecting event is handled.... thus resetting the arrows display string to empty.

BTW: Version 4.1



private void m_PageGraphChart_ArrowSelecting(object sender, ArrowConfirmArgs e)
{
// Update the property grid with the selected edge
UIEdge uiEdge = e.Arrow.Tag as UIEdge;
if (uiEdge != null)
{
// here
string output = uiEdge.EventString + "ZOrder: " + e.Arrow.ZIndex.ToString();
System.Diagnostics.Debug.WriteLine(output);
m_UIPropertiesControl.SelectedObject = uiEdge;
e.Arrow.Text = uiEdge.EventString;
}
}

private void m_PageGraphChart_ArrowDeselected(object sender, ArrowEventArgs e)
{
// Update the property grid with the selected edge
if (e.Arrow.Selected && e.Arrow.Tag == m_UIPropertiesControl.SelectedObject)
{
m_UIPropertiesControl.SelectedObject = null;
}
e.Arrow.Text = "";
}

thanks,
--Matt
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Howto Cycle Overlapping Arrow Selection??
Reply #1 - Sep 23rd, 2008 at 7:30am
Print Post  
You will get ArrowClicked event for the top-most arrow. From the event handler you could iterate over the Objects collection (whose order corresponds to the Z-order of diagram elements) and use the ContainsPoint method to find out the arrow with lowest Z at the mouse location. Now select it programmatically, call its ZTop method to bring it to front, and display its properties. Next time the user clicks at the same location, your search will find the other arrow, which is at a lower Z position.

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


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Re: Howto Cycle Overlapping Arrow Selection??
Reply #2 - Sep 24th, 2008 at 9:07pm
Print Post  
Can't seem to find the ContainsPoint() method in the 4.1 docs... is this a static member of the Selection class?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Howto Cycle Overlapping Arrow Selection??
Reply #3 - Sep 25th, 2008 at 6:57am
Print Post  
It should be a method of ChartObject, but I can't remember if it's available in V4.1.
  
Back to top
 
IP Logged
 
mkeele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Re: Howto Cycle Overlapping Arrow Selection??
Reply #4 - Sep 25th, 2008 at 5:58pm
Print Post  
It appears ChartObject is undocumented in 4.1 and doesn't have a ContainsPoint() method....  Cry
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Howto Cycle Overlapping Arrow Selection??
Reply #5 - Sep 25th, 2008 at 7:44pm
Print Post  
ChartObject is the base class for diagram items in version 4.x. ContainsPoint should be there, but it might be internal. I can see you have the source code, so you could make the method public and rebuild the assemblies.

Stoyan
  
Back to top
 
IP Logged
 
mkeele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Re: Howto Cycle Overlapping Arrow Selection??
Reply #6 - Sep 25th, 2008 at 8:02pm
Print Post  
Gotcha.. thanks...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint