Friday, February 10, 2012
Google Custom Search

ClearCanvas Highlights

Download our Open Source software
Watch some Videos
Get the Source
Check out our Licensing
Join our  Forums
Some Research: OICR IPP-Trials

Our Community

Membership Membership:
Latest New User Latest: 孙磊
New Today New Today: 1
New Yesterday New Yesterday: 27
User Count Overall: 20591

People Online People Online:
Visitors Visitors: 17
Members Members: 0
Total Total: 17

Online Now Online Now:

ClearCanvas Community Forums

CancelStartOnDoubleClick enumeration actually turns OFF double click functionality
Last Post 2010-04-18 12:58 PM by stewart. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
sthacher
New Member
New Member
Posts:3

--
2010-03-26 10:25 AM  

In ClearCanvas.ImageViewer.InputManagement.TileController.cs:

the CanStartNewHandler() method does a check to see if double click is enabled with a call to CanStartOnDoubleClick(handler).

If our mouse button behaviour is enumerated to "CancelStartOnDoubleClick", the above method should return true.  Instead it is backwards and actually returns false:

        private static bool CanStartOnDoubleClick(IMouseButtonHandler handler)
        {
            return false == CancelStartOnDoubleClick(handler);
        }

So in order to turn on double click functionality, I actually had to set my MouseButtonHandlerBehaviour to None, which is actually backwards from what is described in the enumeration comments.

Tags: TileController, MouseButtonHandlerBehaviour, CancelStartOnDoubleClick, Double, Click
stewart
Senior Member
Senior Member
Posts:2033

--
2010-04-01 02:13 PM  
Hi, here's the documentation I wrote for the CancelStartOnDoubleClick enum:

" Because a click must happen before a double-click, this allows an IMouseButtonHandler to opt-out after gaining initial capture (via IMouseButtonHandler.Start) and have the framework call MouseButtonHandler.Cancel in order to allow another handler to process the double-click."

I think you've misunderstood what that enum is for - it doesn't ENABLE double-click, but rather it does the opposite. Most tools capture the mouse on the first click, essentially stopping any double-click tools from working. So, all tools that don't intend to handle a double click (which is most of them) SET this flag as part of it's behaviour. By default, the flag is on because most tools are not double-click tools.

Here's the constructor for a double-click enabled tool in CC:

public ExplodeImageBoxTool()
{
//this tool is activated on a double-click
base.Behaviour &= ~MouseButtonHandlerBehaviour.CancelStartOnDoubleClick;
}

Hope this helps,
Stewart
Real-time support available to Clinical Edition and Team Edition customers
sthacher
New Member
New Member
Posts:3

--
2010-04-05 06:26 PM  
Hi Stewart,

Thank you for your response!
I had tried that method, and I'm trying it once again today with no success. I've placed the line to activate double click in my tool's constructor, and if I understand correctly, the Cancel() method in that tool should be called when a double click event occurs. Is my understanding correct? All that is happening for me on a double click is my Start() method is called twice, both times with an IMouseInformation.ClickCount = 1. Am I missing something here? Thanks,

Steven
stewart
Senior Member
Senior Member
Posts:2033

--
2010-04-18 12:58 PM  
Steven, when you activate a tool for double-click, it should not have it's Cancel method called, but rather a different tool would (for example, the StackTool). The framework would then go on to call Start on your tool, with ClickCount=2.

Hope this helps,
Stewart
Real-time support available to Clinical Edition and Team Edition customers
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2011 ClearCanvas Inc.