mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 16:40:54 +02:00
gtk2 intf: clean up
git-svn-id: trunk@21201 -
This commit is contained in:
parent
16af7e11b4
commit
365837b53b
@ -1527,10 +1527,12 @@ function gtkMouseBtnPress(widget: PGtkWidget; event: pgdkEventButton;
|
|||||||
|
|
||||||
var
|
var
|
||||||
DesignOnlySignal: boolean;
|
DesignOnlySignal: boolean;
|
||||||
|
AWinControl: TWinControl;
|
||||||
|
{$IFDEF GTK1}
|
||||||
CaptureWidget: PGtkWidget;
|
CaptureWidget: PGtkWidget;
|
||||||
EventXY: TPoint;
|
EventXY: TPoint;
|
||||||
MappedXY: TPoint;
|
MappedXY: TPoint;
|
||||||
AWinControl: TWinControl;
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
Result := CallBackDefaultReturn;
|
Result := CallBackDefaultReturn;
|
||||||
MousePositionValid := False;
|
MousePositionValid := False;
|
||||||
@ -1564,13 +1566,13 @@ begin
|
|||||||
if DesignOnlySignal then exit;
|
if DesignOnlySignal then exit;
|
||||||
if not ControlGetsMouseDownBefore(TControl(Data), Widget) then Exit;
|
if not ControlGetsMouseDownBefore(TControl(Data), Widget) then Exit;
|
||||||
|
|
||||||
CaptureWidget := PGtkWidget(AWinControl.Handle);
|
|
||||||
if Event^.button = 1 then
|
if Event^.button = 1 then
|
||||||
begin
|
begin
|
||||||
EventXY := Point(TruncToInt(Event^.X), TruncToInt(Event^.Y));
|
|
||||||
MappedXY := TranslateGdkPointToClientArea(Event^.Window, EventXY, CaptureWidget);
|
|
||||||
{$IFDEF Gtk1}
|
{$IFDEF Gtk1}
|
||||||
// gtk2: the LCL will capture itself if DragMode=dmAutomatic
|
// gtk2: the LCL will capture itself if DragMode=dmAutomatic
|
||||||
|
CaptureWidget := PGtkWidget(AWinControl.Handle);
|
||||||
|
EventXY := Point(TruncToInt(Event^.X), TruncToInt(Event^.Y));
|
||||||
|
MappedXY := TranslateGdkPointToClientArea(Event^.Window, EventXY, CaptureWidget);
|
||||||
SetCaptureControl(AWinControl, MappedXY);
|
SetCaptureControl(AWinControl, MappedXY);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
//CaptureMouseForWidget(CaptureWidget,mctGTKIntf);
|
//CaptureMouseForWidget(CaptureWidget,mctGTKIntf);
|
||||||
|
Loading…
Reference in New Issue
Block a user