mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 20:29:14 +02:00
Remove TFPMemo flickering of selected text while mouse button is still pressed.
This commit is contained in:
parent
3c7a114c0b
commit
3be1c08516
@ -3724,7 +3724,7 @@ var DontClear : boolean;
|
|||||||
end;
|
end;
|
||||||
type TCCAction = (ccCheck,ccClear,ccDontCare);
|
type TCCAction = (ccCheck,ccClear,ccDontCare);
|
||||||
var
|
var
|
||||||
StartP,P: TPoint;
|
StartP,P,PrevP: TPoint;
|
||||||
E: TEvent;
|
E: TEvent;
|
||||||
OldEvent : PEvent;
|
OldEvent : PEvent;
|
||||||
CCAction: TCCAction;
|
CCAction: TCCAction;
|
||||||
@ -3753,13 +3753,20 @@ begin
|
|||||||
GetMousePos(P);
|
GetMousePos(P);
|
||||||
StartP:=P;
|
StartP:=P;
|
||||||
SetCurPtr(P.X,P.Y);
|
SetCurPtr(P.X,P.Y);
|
||||||
|
PrevP.X:=-1; { first time previous point is different }
|
||||||
repeat
|
repeat
|
||||||
GetMousePos(P);
|
GetMousePos(P);
|
||||||
|
if (P.X<>PrevP.X) or (P.Y<>PrevP.Y) then
|
||||||
|
begin
|
||||||
|
Lock;
|
||||||
SetCurPtr(P.X,P.Y);
|
SetCurPtr(P.X,P.Y);
|
||||||
|
PrevP:=P;
|
||||||
if PointOfs(P)<PointOfs(StartP)
|
if PointOfs(P)<PointOfs(StartP)
|
||||||
then SetSelection(P,StartP)
|
then SetSelection(P,StartP)
|
||||||
else SetSelection(StartP,P);
|
else SetSelection(StartP,P);
|
||||||
DrawView;
|
DrawView;
|
||||||
|
UnLock;
|
||||||
|
end;
|
||||||
until not MouseEvent(Event, evMouseMove+evMouseAuto);
|
until not MouseEvent(Event, evMouseMove+evMouseAuto);
|
||||||
DrawView;
|
DrawView;
|
||||||
ClearEvent(Event);
|
ClearEvent(Event);
|
||||||
|
Loading…
Reference in New Issue
Block a user