gtk: don't apply SubstractScroll for gtk1 widgetset

git-svn-id: trunk@20428 -
This commit is contained in:
paul 2009-06-05 09:20:11 +00:00
parent 6bd157f740
commit 3c4f8ff042
3 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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);

View File

@ -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