Recent

Author Topic: MouseMove is not called for ScrolledWinControl  (Read 1655 times)

Alexander Sviridenkov

  • Newbie
  • Posts: 4
MouseMove is not called for ScrolledWinControl
« on: December 11, 2017, 04:08:14 pm »
Looks like there is a bug is ScrolledWinControl on Linux. MouseMove is not called when mouse is below "initial" window rectangle and left button is pressed.
How to reproduce:

Code: Pascal  [Select][+][-]
  1. TTestWindow = class(TScrollingWinControl)
  2.   public
  3.     procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
  4.   end;      
  5.  
  6. procedure TTestWindow.MouseMove(Shift: TShiftState; X, Y: Integer);
  7. begin
  8.   inherited MouseMove(Shift, X, Y);
  9.   TForm(Owner).Caption := inttostr(GetTickCount)+' '+ inttostr(integer(Shift));
  10. end;
  11.  
  12.  
  13. procedure TForm1.FormCreate(Sender: TObject);
  14. var W:  TTestWindow;
  15. begin
  16.   W := TTestWindow.Create(Self);
  17.   W.Parent := Self;
  18.   W.Align := alClient;
  19.   W.HorzScrollBar.Visible := true;
  20.   W.VertScrollBar.Visible := true;
  21.   W.VertScrollBar.Page := ClientHeight;
  22.   W.VertScrollBar.Range := 2000;
  23. end;
  24.  
  25.  

1. Start application.
2. Press left button somewhere and move mouse - caption is changed.
3. Scroll to bottom.
4. Press left button somewhere and move mouse - caption is not changed.

Is there any workaround for this?

Ubuntu, Lazarus 1.9.0, FPC 3.0.2.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: MouseMove is not called for ScrolledWinControl
« Reply #1 on: December 11, 2017, 04:21:24 pm »
Hello Alexander Sviridenkov,
Welcome to the forum.

No problem here on my test on Ubuntu Mate 17.10 Lazarus 1.8.0RC5 64-bit Gtk2. The caption is always changed if I move the mouse even scrolled to the bottom.

I provide the compilable source in the Test.zip below for anyone interested to test.
« Last Edit: December 11, 2017, 04:25:38 pm by Handoko »

 

TinyPortal © 2005-2018