|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Thu Dec 20, 2007 10:22 pm Post subject: Detecting a double click in a %gr region |
|
|
I'm experimenting with a call-back function for a %gr region. Here is the first effort:
INTEGER FUNCTION GR_FN()
CHARACTER*(30) CBR
INCLUDE <WINDOWS.INS>
write (*,*) ' In GR_FN'
CBR = CLEARWIN_STRING@('CALLBACK_REASON')
write (*,*) CBR
IX = CLEARWIN_INFO@('GRAPHICS_MOUSE_X')
IY = CLEARWIN_INFO@('GRAPHICS_MOUSE_Y')
write(*,*) IX, IY
GR_FN = 1
END
I get a MOUSE_LEFT_CLICK both before and after a MOUSE_DOUBLE_CLICK - exactly as stated by the documentation. When I see the initial MOUSE_LEFT_CLICK, how do I determine if that was the user's intention, or is there a MOUSE_DOUBLE_CLICK in the offing? Is there anyone who can help with a snippet of code or an explanation of how they deal with this please?
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Fri Dec 21, 2007 12:11 pm Post subject: |
|
|
ClearWin+ is simply relaying to you the mouse events that it receives.
A double click action is transmitted as the first click, then, if the time interval is suitably small, the second click is translated into a double click event.
The design of the user interface should allow for a user's poor attempt at a double click or a faulty mouse button. So a single click event must be either compatible or benign. For example, in an editor, a single click could set a selection whilst a double click extends the selection. In this case the initial single click is applied but is redundant when followed by a second click in rapid succession.
In other words it is not a good idea to make a single click mean something quite different from a double click. The single click event should be implemented anyway and then followed by the double click event.
If you still want to isolate the single click event then you will need to program a timer into your code and set your own tollerance between the two received events. But even then you will have a tricky programming task because you will have to implement an isolated single click retrospectively. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Sat Dec 22, 2007 2:34 pm Post subject: |
|
|
Paul,
It is useful being told that something is difficult, because nothing is more frustrating than programming and debugging something for weeks, only to find out that there is a routine already in existence called something like "get_filtered_mouse_click_and decypher_it@(result)"!
Deciding what a user would find most logical and convenient to do in a specific situation isn't always easy. I think that I'll avoid double-clicks in the short term.
Eddie |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|