mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 02:49:06 +02:00
gtk: formatting
git-svn-id: trunk@20659 -
This commit is contained in:
parent
0de0f63bc5
commit
0a4a8d01f4
@ -1323,7 +1323,7 @@ var
|
|||||||
|
|
||||||
function LastClickInTime: boolean;
|
function LastClickInTime: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=((now - LastMouse.TheTime) <= ((1/86400)*(DblClickTime/1000)));
|
Result := ((now - LastMouse.TheTime) <= ((1/86400)*(DblClickTime/1000)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TestIfMultiClick: boolean;
|
function TestIfMultiClick: boolean;
|
||||||
@ -1336,10 +1336,10 @@ var
|
|||||||
var
|
var
|
||||||
IsMultiClick: boolean;
|
IsMultiClick: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result := False;
|
||||||
|
|
||||||
if (LastMouse.Down) and
|
if (LastMouse.Down) and
|
||||||
(not (gdk_event_get_type(Event) in [gdk_2button_press,gdk_3button_press]))
|
(not (gdk_event_get_type(Event) in [gdk_2button_press, gdk_3button_press]))
|
||||||
then begin
|
then begin
|
||||||
{$IFDEF VerboseMouseBugfix}
|
{$IFDEF VerboseMouseBugfix}
|
||||||
DebugLn(' NO CLICK: LastMouse.Down=',dbgs(LastMouse.Down),
|
DebugLn(' NO CLICK: LastMouse.Down=',dbgs(LastMouse.Down),
|
||||||
@ -1349,52 +1349,50 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
MessI.Keys := MessI.Keys or BtnKey;
|
MessI.Keys := MessI.Keys or BtnKey;
|
||||||
|
IsMultiClick := TestIfMultiClick;
|
||||||
IsMultiClick:=TestIfMultiClick;
|
|
||||||
|
|
||||||
case gdk_event_get_type(Event) of
|
case gdk_event_get_type(Event) of
|
||||||
|
gdk_2button_press:
|
||||||
gdk_2button_press:
|
// the gtk itself has detected a double click
|
||||||
// the gtk itself has detected a double click
|
if (LastMouse.ClickCount>=2)
|
||||||
if (LastMouse.ClickCount>=2)
|
|
||||||
and IsMultiClick
|
|
||||||
then begin
|
|
||||||
// the double click was already detected and sent to the LCL
|
|
||||||
// -> skip this message
|
|
||||||
exit;
|
|
||||||
end else begin
|
|
||||||
LastMouse.ClickCount:=2;
|
|
||||||
end;
|
|
||||||
|
|
||||||
gdk_3button_press:
|
|
||||||
// the gtk itself has detected a triple click
|
|
||||||
if (LastMouse.ClickCount>=3)
|
|
||||||
and IsMultiClick
|
|
||||||
then begin
|
|
||||||
// the triple click was already detected and sent to the LCL
|
|
||||||
// -> skip this message
|
|
||||||
exit;
|
|
||||||
end else begin
|
|
||||||
LastMouse.ClickCount:=3;
|
|
||||||
end;
|
|
||||||
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
inc(LastMouse.ClickCount);
|
|
||||||
|
|
||||||
if (LastMouse.ClickCount<=4)
|
|
||||||
and IsMultiClick
|
and IsMultiClick
|
||||||
then begin
|
then begin
|
||||||
// multi click
|
// the double click was already detected and sent to the LCL
|
||||||
{$IFDEF VerboseMouseBugfix}
|
// -> skip this message
|
||||||
DebugLn(' MULTI CLICK: ',dbgs(now),'-',dbgs(LastMouse.TheTime),'<= ',
|
exit;
|
||||||
dbgs((1/86400)*(DblClickTime/1000)));
|
|
||||||
{$ENDIF}
|
|
||||||
end else begin
|
end else begin
|
||||||
// normal click
|
LastMouse.ClickCount:=2;
|
||||||
LastMouse.ClickCount:=1;
|
end;
|
||||||
|
|
||||||
|
gdk_3button_press:
|
||||||
|
// the gtk itself has detected a triple click
|
||||||
|
if (LastMouse.ClickCount>=3)
|
||||||
|
and IsMultiClick
|
||||||
|
then begin
|
||||||
|
// the triple click was already detected and sent to the LCL
|
||||||
|
// -> skip this message
|
||||||
|
exit;
|
||||||
|
end else begin
|
||||||
|
LastMouse.ClickCount:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
inc(LastMouse.ClickCount);
|
||||||
|
|
||||||
|
if (LastMouse.ClickCount<=4)
|
||||||
|
and IsMultiClick
|
||||||
|
then begin
|
||||||
|
// multi click
|
||||||
|
{$IFDEF VerboseMouseBugfix}
|
||||||
|
DebugLn(' MULTI CLICK: ',dbgs(now),'-',dbgs(LastMouse.TheTime),'<= ',
|
||||||
|
dbgs((1/86400)*(DblClickTime/1000)));
|
||||||
|
{$ENDIF}
|
||||||
|
end else begin
|
||||||
|
// normal click
|
||||||
|
LastMouse.ClickCount:=1;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
{$IFDEF VerboseMouseBugfix}
|
{$IFDEF VerboseMouseBugfix}
|
||||||
DebugLn(' ClickCount=',dbgs(LastMouse.ClickCount));
|
DebugLn(' ClickCount=',dbgs(LastMouse.ClickCount));
|
||||||
@ -1404,7 +1402,7 @@ var
|
|||||||
LastMouse.Window := Event^.Window;
|
LastMouse.Window := Event^.Window;
|
||||||
LastMouse.WindowPoint := EventXY;
|
LastMouse.WindowPoint := EventXY;
|
||||||
LastMouse.Down := True;
|
LastMouse.Down := True;
|
||||||
LastMouse.Component:=AWinControl;
|
LastMouse.Component := AWinControl;
|
||||||
|
|
||||||
//DebugLn('DeliverMouseDownMessage ',DbgSName(AWinControl),' Mapped=',dbgs(MappedXY.X),',',dbgs(MappedXY.Y),' Event=',dbgs(EventXY.X),',',dbgs(EventXY.Y),' ',dbgs(LastMouse.ClickCount));
|
//DebugLn('DeliverMouseDownMessage ',DbgSName(AWinControl),' Mapped=',dbgs(MappedXY.X),',',dbgs(MappedXY.Y),' Event=',dbgs(EventXY.X),',',dbgs(EventXY.Y),' ',dbgs(LastMouse.ClickCount));
|
||||||
case LastMouse.ClickCount of
|
case LastMouse.ClickCount of
|
||||||
@ -1416,7 +1414,7 @@ var
|
|||||||
MessI.Msg := LM_NULL;
|
MessI.Msg := LM_NULL;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result:=true;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user