mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:19:22 +02:00
gtk: don't apply SubstractScroll for gtk1 widgetset
git-svn-id: trunk@20428 -
This commit is contained in:
parent
6bd157f740
commit
3c4f8ff042
@ -1132,7 +1132,9 @@ begin
|
||||
MappedXY := TranslateGdkPointToClientArea(Event^.Window,
|
||||
Point(TruncToInt(Event^.X), TruncToInt(Event^.Y)),
|
||||
PGtkWidget(AWinControl.Handle));
|
||||
{$ifndef gtk1}
|
||||
MappedXY := SubtractScoll(PGtkWidget(AWinControl.Handle), MappedXY);
|
||||
{$endif}
|
||||
|
||||
ShiftState := GTKEventStateToShiftState(Event^.State);
|
||||
with Msg do
|
||||
@ -1429,7 +1431,9 @@ begin
|
||||
ShiftState := GTKEventStateToShiftState(Event^.State);
|
||||
MappedXY := TranslateGdkPointToClientArea(Event^.Window, EventXY,
|
||||
PGtkWidget(AWinControl.Handle));
|
||||
{$ifndef gtk1}
|
||||
MappedXY := SubtractScoll(PGtkWidget(AWinControl.Handle), MappedXY);
|
||||
{$endif}
|
||||
//DebugLn('DeliverMouseDownMessage ',DbgSName(AWinControl),' Mapped=',dbgs(MappedXY.X),',',dbgs(MappedXY.Y),' Event=',dbgs(EventXY.X),',',dbgs(EventXY.Y));
|
||||
|
||||
if event^.Button in [4, 5] then
|
||||
@ -1687,7 +1691,9 @@ begin
|
||||
MappedXY := TranslateGdkPointToClientArea(Event^.Window,
|
||||
Point(TruncToInt(Event^.X), TruncToInt(Event^.Y)),
|
||||
PGtkWidget(AWinControl.Handle));
|
||||
{$ifndef gtk1}
|
||||
MappedXY := SubtractScoll(PGtkWidget(AWinControl.Handle), MappedXY);
|
||||
{$endif}
|
||||
//DebugLn(['DeliverMouseUpMessage ',GetWidgetDebugReport(Widget),' ',dbgsName(AWinControl),' ',dbgs(MappedXY)]);
|
||||
|
||||
case event^.Button of
|
||||
|
@ -451,6 +451,7 @@ function GetWidgetOrigin(TheWidget: PGtkWidget): TPoint;
|
||||
function GetWidgetClientOrigin(TheWidget: PGtkWidget): TPoint;
|
||||
function TranslateGdkPointToClientArea(SourceWindow: PGdkWindow;
|
||||
SourcePos: TPoint; DestinationWidget: PGtkWidget): TPoint;
|
||||
function SubtractScoll(AWidget: PGtkWidget; APosition: TPoint): TPoint;
|
||||
|
||||
// mouse capturing
|
||||
procedure CaptureMouseForWidget(Widget: PGtkWidget; Owner: TMouseCaptureType);
|
||||
|
@ -128,6 +128,7 @@ begin
|
||||
ShiftState := GTKEventStateToShiftState(Event^.State);
|
||||
MappedXY:=TranslateGdkPointToClientArea(Event^.Window,EventXY,
|
||||
PGtkWidget(AWinControl.Handle));
|
||||
MappedXY := SubtractScoll(PGtkWidget(AWinControl.Handle), MappedXY);
|
||||
//DebugLn('gtkMouseWheelCB ',DbgSName(AWinControl),' Mapped=',dbgs(MappedXY.X),',',dbgs(MappedXY.Y),' Event=',dbgs(EventXY.X),',',dbgs(EventXY.Y));
|
||||
|
||||
// this is a mouse wheel event
|
||||
|
Loading…
Reference in New Issue
Block a user