Recent

Author Topic: TScrollbox MouseUp coordinates  (Read 3254 times)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
TScrollbox MouseUp coordinates
« on: November 05, 2018, 07:35:54 pm »
I have some controls (Align = alTop) within a TScrollBox.

On MacOS with Cocoa, the MouseUp and MouseDown events report the position without respecting the scroll state, while on Windows (win32) and Linux (gtk2), the positions are correct.

I can add a workaround:
Code: [Select]
procedure TMyTable.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: integer);
begin
   inherited MouseUp(Button, Shift, X, Y);
   {$IFDEF Darwin}
   if Assigned(Parent) then begin
      if Parent is TScrollBox then begin
         Y += TScrollBox(Parent).VertScrollBar.Position;
      end;
   end;
   {$ENDIF Darwin}
   ...
But of course it would be better if controls would behave identical across widgetsets, at least in such basic things :)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: TScrollbox MouseUp coordinates
« Reply #1 on: November 05, 2018, 11:29:15 pm »
This looks like a bug: Please report on  the bugtracker

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: TScrollbox MouseUp coordinates
« Reply #2 on: November 06, 2018, 08:59:02 pm »
Done; reported. Linking in case search leads someone here:
https://bugs.freepascal.org/view.php?id=34516

Sorry for having posted here first :)

 

TinyPortal © 2005-2018