Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Multi-Selecting Arrows (Read 2847 times)
mkeele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Multi-Selecting Arrows
May 27th, 2008 at 7:56pm
Print Post  
I'm using Flowchart.NET 4.1 and am having difficulty getting multiple arrows to appear selected at the same time.

Allowmultisel is set to true (though I'm assuming this applies to arrow object as well).

this.m_FlowChart.Selection.AllowMultiSel = true;

As a hack/test, in the event handler for ArrowCreated, I set all arrows to selected:

        foreach (Arrow arrow in m_FlowChart.Arrows)
        {
           arrow.Selected = true;
        }

after this call, m_FlowChart.Selection.Arrows does indeed show all arrows as being in a selected state.
However, if I immediately press delete, in the ArrowDeleting event handler, it already shows only one as being selected.

Any ideas on what I'm doing wrong?
thanks,
--Matt
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Multi-Selecting Arrows
Reply #1 - May 28th, 2008 at 9:05am
Print Post  
The selection might change just after creating an arrow if the SelectAfterCreate property is enabled. What happens if you set it to false?

Stoyan
  
Back to top
 
IP Logged
 
mkeele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Re: Multi-Selecting Arrows
Reply #2 - Jun 13th, 2008 at 2:23am
Print Post  
Thanks for the response, but it doesn't seem to work.
In the ArrowDeleting event handler, it shows all arrows (2) as selected in the first (and only call). SelectionChanged is then called and it shows one less arrow being selected. Next ArrowDeleted is called with one arrow being listed as selected.

this is after I set
this.m_FlowChart.SelectAfterCreate = false;
in InitializeComponent()

Any other ideas?
thanks,
-Matt
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Multi-Selecting Arrows
Reply #3 - Jun 13th, 2008 at 5:27am
Print Post  
Could you copy here the code for these event handlers, and also for any Activated, Deactivated, Selected and Deselected events you are handling?

Stoyan
« Last Edit: Jun 13th, 2008 at 10:17am by Stoyo »  
Back to top
 
IP Logged
 
mkeele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Re: Multi-Selecting Arrows
Reply #4 - Jun 13th, 2008 at 4:46pm
Print Post  
Nothing special in the code

public partial class CtrlMaterialView : UserControl
{
...
     private void m_FlowChart_ArrowDeleting(object sender, ArrowConfirmArgs e)
     {
        System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString("HH::mm:ss.fffffff") + ": m_FlowChart_ArrowDeleting");
     }

     private void m_FlowChart_SelectionChanged(object sender, EventArgs e)
     {
        System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString("HH::mm:ss.fffffff") + ": m_FlowChart_SelectionChanged");
     }

     private void m_FlowChart_ArrowDeleted(object sender, ArrowEventArgs e)
     {
        System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString("HH::mm:ss.fffffff") + ": m_FlowChart_ArrowDeleted");
     }
...
}

The arrows are "attached" between UserControl derived nodes containing the anchors.

public partial class CtrlNode : UserControl
{
...
   protected ControlHost host = null;
   public virtual List<AnchorData> AnchorData { get { return null; } }
   public virtual void InitAnchors(ControlHost host)
...
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Multi-Selecting Arrows
Reply #5 - Jun 15th, 2008 at 11:20am
Print Post  
This is my test project where I've tried to reproduce your issue:
https://mindfusion.eu/_samples/SelectionTest.zip

Drawing a few nodes, then the links between them, then pressing Del a few times works as expected. Could you copy to it the rest of your code related to deleting the links, and any selection-related properties initialization, to see what exactly will lead to that problem?

Stoyan
  
Back to top
 
IP Logged
 
mkeele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Re: Multi-Selecting Arrows
Reply #6 - Jun 16th, 2008 at 7:01pm
Print Post  
Thanks for you help by the way...

I think the misunderstanding is that I was hoping that they wouldn't have to click del 5 times when they have 5 arrow selected that they want to delete.

Just a feature our artists have asked for which I didn't think would be hard to implement.



  
Back to top
 
IP Logged
 
mkeele
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 27th, 2008
Re: Multi-Selecting Arrows
Reply #7 - Jun 16th, 2008 at 8:58pm
Print Post  
assumed multiple delete was supported "internally"... but went ahead and just handled the delete key up message to delete all selected arrows in active hosts... not a biggie.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Multi-Selecting Arrows
Reply #8 - Jun 17th, 2008 at 4:31am
Print Post  
There is a DelKeyAction property that you could set to None, DeleteActiveItem or DeleteSelectedItems, but I don't know if it is available in version 4.1. I suppose it defaults to DeleteActiveItem, so just one of the links is deleted when you press Del.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint