Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7406

IsDoubleClick not working in StandardMouseSelect of CustomClickSelectingTool

$
0
0

@AndyP wrote:

Hi,
I want to check if the mouse was doubleclicked im StandardMouseSelect of ClickSelectingTool but it doesn't work:

Here is the code

public class CustomClickSelectingTool : ClickSelectingTool
{

    protected override void StandardMouseSelect()
    {
        // remember selected group before MouseSelect
        var selectedGroup = Diagram.SelectedGroup;
        var oldSelectedParts = Diagram.SelectedParts.ToList();  // Kopie machen!

        base.StandardMouseSelect();

        // check after MouseSelect
        var selectedPart = Diagram.SelectedPart;
        if (selectedPart != null)
        {
            if (oldSelectedParts.Contains(selectedPart)) return;

            if (selectedGroup == null || !Equals(selectedGroup, selectedPart.ContainingSubGraph))
            {
                if (selectedPart.ContainingSubGraph != null)
                {
                    if (IsDoubleClick())
                    {
                        selectedPart.IsSelected = false;
                        selectedPart.ContainingSubGraph.IsSelected = true;
                    }
                }
            }
        }
    }
}

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7406