View Issue Details

IDProjectCategoryView StatusLast Update
0002337JEDI VCL00 JVCL Componentspublic2004-11-30 10:33
ReporteranonymousAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 BETA 2 
Target VersionFixed in Version3.00 RC 1 
Summary0002337: TJvMouseGestureHook blocks application
DescriptionMouse Gesture demo. Add popup menu and insert some menu items to it. Then assign that popupmenu to TMemo.

(Right mouse button must be selected as default for drawing such gesture)
Run application and selecte ...Hook as default. Then draw mose gesture over Memo. After you release mouse button popup menu is displayed an then application freeezes for > 20 seconds.
TagsNo tags attached.

Activities

anonymous

2004-11-24 08:28

viewer   ~0005696

"Run application and selecte ...Hook as default" should be
Run application and select "All controls via AppEvents" as detection method.

user72

2004-11-25 09:44

  ~0005706

Obviously, using the right mouse button as the mouse gesture activator and at the same time assigning a popup to the memo, is asking for trouble.

I don't see that we can do anything about it. In short: don't combine the two.

Unless you can come up with a viable approach to combine the two, I am afraid we will have to close this issue with a "won't fix" status.

anonymous

2004-11-25 09:56

viewer   ~0005711

Well not excactly.

If you see how mouse gestures are implemented in e.g Firefox you'll se that mouse click and drag messages are "eaten" if gesture is executed. e.g no menu is displayed.

user72

2004-11-28 07:13

  ~0005741

The problem seems to be that when the popup is displayed, the message pump for the menu is never started, but I haven't been able to determine why.

user72

2004-11-28 09:40

  ~0005743

Try this:

{$IFDEF VCL}
function JvMouseGestureHook(Code: Integer; wParam: Word; lParam: Longword): Longword; stdcall;
var
  locY: Integer;
  locX: Integer;
begin
  if (Code < 0) or not (JvMouseGestureHookActive) then
  begin
    Result := CallNextHookEx(JvCurrentHook, Code, wParam, lParam);
    Exit;
  end;
  Result := Code;

  with PMouseHookStruct(lParam)^ do
  begin
    locX := pt.X;
    locY := pt.Y;
  end;

  if wParam = WM_MOUSEMOVE then
    JvMouseGestureInterpreter.TrailMouseGesture(locX, locY);
  if wParam = JvMouseButtonDown then
    JvMouseGestureInterpreter.StartMouseGesture(locX, locY)
  else
  if wParam = JvMouseButtonUp then
    JvMouseGestureInterpreter.EndMouseGesture;
  Result := CallNextHookEx(JvCurrentHook, Code, wParam, lParam); // NEW!
end;
{$ENDIF VCL}

obones

2004-11-30 04:43

administrator   ~0005781

Please try with the latest zip files and tell us if the problem is fixed. These files are available here:

http://jvcl.sf.net/daily/
http://jcl.sf.net/daily/

If we don't hear from you in the next 7 days, we will consider this issue fixed.

anonymous

2004-11-30 07:52

viewer   ~0005784

Thanks!!

Adding:
Result := CallNextHookEx(JvCurrentHook, Code, wParam, lParam); // NEW!
solved the problem.

Thanks for support guys.

user72

2004-11-30 10:33

  ~0005790

Glad to hear that since I was out of ideas if that one hadn't worked :)

Updated in CVS

Issue History

Date Modified Username Field Change
2004-11-24 08:25 anonymous New Issue
2004-11-24 08:28 anonymous Note Added: 0005696
2004-11-25 09:44 user72 Note Added: 0005706
2004-11-25 09:44 user72 Status new => feedback
2004-11-25 09:56 anonymous Note Added: 0005711
2004-11-28 07:13 user72 Note Added: 0005741
2004-11-28 09:40 user72 Note Added: 0005743
2004-11-30 04:43 obones Note Added: 0005781
2004-11-30 07:52 anonymous Note Added: 0005784
2004-11-30 10:33 user72 Status feedback => resolved
2004-11-30 10:33 user72 Resolution open => fixed
2004-11-30 10:33 user72 Assigned To => user72
2004-11-30 10:33 user72 Note Added: 0005790
2004-11-30 10:33 user72 Assigned To user72 =>