View Issue Details

IDProjectCategoryView StatusLast Update
0001492JEDI VCL00 JVCL Componentspublic2004-03-20 01:33
ReportervladsAssigned Touser72 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001492: TJvTrayIcon to distinguish single-click and a double-click
DescriptionDouble-clicking the right mouse button actually generates four messages: WM_RBUTTONDOWN, WM_RBUTTONUP, WM_RBUTTONDBLCLK, and WM_RBUTTONUP again.

Solution:

Create a timer which is started on the first click, set the timeout value to something a bit longer than the double-click, then connect the timeout() signal
to a slot of your own. When a double click event is received you simply stop the timer. If the custom slot is visited you know that a single click was done.
Additional InformationThis is my implementation comments with { Vlad S}
TagsNo tags attached.

Activities

2004-03-18 09:56

 

JvTrayIcon_diff.zip (33,306 bytes)

user72

2004-03-18 14:23

  ~0003384

This is the same behavior as single/dblclick with the left button, isn't it? I don't really like changing the default Windows behavior, especially not using a timer...

Comments?

remkobonte

2004-03-18 15:03

developer   ~0003385

Last edited: 2004-03-18 15:04

You could consider a tray icon as a non default windows item. That is, I know tray icons that respond both to, and differently to, single and double clicks.

Another issue is that you get the following events while double-clicking a tray icon:

OnClick, OnDblClick, OnClick.

Normally you would get:

OnClick, OnDblClick.

edited on: 03-18-04 15:04

edited on: 03-18-04 15:04

user72

2004-03-18 15:24

  ~0003387

>Another issue is that you get the
>following events while double-clicking a tray icon:
So are you really saying that we should have a timer for left click/dblclick as well?

remkobonte

2004-03-18 15:50

developer   ~0003388

>So are you really saying that we should have a timer for left click/dblclick as well?

It is ugly, but *if* you want to make a distinction between single and double clicks, then there is no other way (that I know). Maybe make it an option <g>.

But the second thing is a bug: If you double-click the trayicon, two click events are fired (and one double click event).

user72

2004-03-19 00:54

  ~0003389

Fortunately, Vlad's fix works for all buttons. I'll add it, then

vlads

2004-03-19 06:44

reporter   ~0003391

There are an option to improve my fix.
Timer should start at first mouse click (Mouse Down) because this is when System timer for dbl click starts.

user72

2004-03-19 07:56

  ~0003393

Done

user72

2004-03-20 01:33

  ~0003402

Updated in CVS

Issue History

Date Modified Username Field Change
2004-03-18 09:56 vlads New Issue
2004-03-18 09:56 vlads File Added: JvTrayIcon_diff.zip
2004-03-18 14:23 user72 Note Added: 0003384
2004-03-18 14:23 user72 Assigned To => user72
2004-03-18 14:23 user72 Status new => feedback
2004-03-18 15:03 remkobonte Note Added: 0003385
2004-03-18 15:04 remkobonte Note Edited: 0003385
2004-03-18 15:04 remkobonte Note Edited: 0003385
2004-03-18 15:24 user72 Note Added: 0003387
2004-03-18 15:50 remkobonte Note Added: 0003388
2004-03-19 00:54 user72 Note Added: 0003389
2004-03-19 06:44 vlads Note Added: 0003391
2004-03-19 07:56 user72 Note Added: 0003393
2004-03-20 01:33 user72 Status feedback => resolved
2004-03-20 01:33 user72 Resolution open => fixed
2004-03-20 01:33 user72 Note Added: 0003402