mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 02:38:13 +02:00
added workaround for MouseCapture function
git-svn-id: trunk@6874 -
This commit is contained in:
parent
b33ad8e14d
commit
9e25f05d21
@ -2146,6 +2146,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomSynEdit.MouseMove(Shift: TShiftState; X, Y: Integer);
|
procedure TCustomSynEdit.MouseMove(Shift: TShiftState; X, Y: Integer);
|
||||||
|
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
function MouseIsCaptured: boolean;
|
||||||
|
// Not all interfaces have a fixed mousecapture like windows.
|
||||||
|
// this is a heuristic
|
||||||
|
begin
|
||||||
|
Result:=MouseCapture or Focused;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
var
|
var
|
||||||
Z: integer;
|
Z: integer;
|
||||||
begin
|
begin
|
||||||
@ -2165,15 +2175,16 @@ begin
|
|||||||
If Cursor <> crDefault then
|
If Cursor <> crDefault then
|
||||||
Cursor := crDefault;
|
Cursor := crDefault;
|
||||||
|
|
||||||
if {$IFNDEF SYN_LAZARUS}MouseCapture and{$ENDIF}
|
if {$IFDEF SYN_LAZARUS}MouseIsCaptured{$ELSE}MouseCapture{$ENDIF}
|
||||||
(sfWaitForDragging in fStateFlags) then begin
|
and (sfWaitForDragging in fStateFlags) then begin
|
||||||
if (Abs(fMouseDownX - X) >= GetSystemMetrics(SM_CXDRAG))
|
if (Abs(fMouseDownX - X) >= GetSystemMetrics(SM_CXDRAG))
|
||||||
or (Abs(fMouseDownY - Y) >= GetSystemMetrics(SM_CYDRAG))
|
or (Abs(fMouseDownY - Y) >= GetSystemMetrics(SM_CYDRAG))
|
||||||
then begin
|
then begin
|
||||||
Exclude(fStateFlags, sfWaitForDragging);
|
Exclude(fStateFlags, sfWaitForDragging);
|
||||||
BeginDrag(false);
|
BeginDrag(false);
|
||||||
end;
|
end;
|
||||||
end else if (ssLeft in Shift) {$IFNDEF SYN_LAZARUS}and MouseCapture{$ENDIF}
|
end else if (ssLeft in Shift)
|
||||||
|
and {$IFDEF SYN_LAZARUS}MouseIsCaptured{$ELSE}MouseCapture{$ENDIF}
|
||||||
then begin
|
then begin
|
||||||
//DebugLn(' TCustomSynEdit.MouseMove CAPTURE Mouse=',X,',',Y,' Caret=',CaretX,',',CaretY,', BlockBegin=',BlockBegin.X,',',BlockBegin.Y,' BlockEnd=',BlockEnd.X,',',BlockEnd.Y,' Client=',ClientWidth-ScrollBarWidth,',',ClientHeight-ScrollBarWidth);
|
//DebugLn(' TCustomSynEdit.MouseMove CAPTURE Mouse=',X,',',Y,' Caret=',CaretX,',',CaretY,', BlockBegin=',BlockBegin.X,',',BlockBegin.Y,' BlockEnd=',BlockEnd.X,',',BlockEnd.Y,' Client=',ClientWidth-ScrollBarWidth,',',ClientHeight-ScrollBarWidth);
|
||||||
if (X >= fGutterWidth)
|
if (X >= fGutterWidth)
|
||||||
|
Loading…
Reference in New Issue
Block a user