mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 06:49:13 +02:00
+ Handle dragging correctly even if mouse doesn't send mouse move events.
git-svn-id: trunk@6226 -
This commit is contained in:
parent
53d640777a
commit
d5662d71a8
12
fv/views.pas
12
fv/views.pas
@ -2910,6 +2910,7 @@ begin
|
|||||||
if (PWindow(Owner)^.Flags and wfClose <> 0) and
|
if (PWindow(Owner)^.Flags and wfClose <> 0) and
|
||||||
(State and sfActive <> 0) and (Mouse.X >= 2) and (Mouse.X <= 4) then
|
(State and sfActive <> 0) and (Mouse.X >= 2) and (Mouse.X <= 4) then
|
||||||
begin
|
begin
|
||||||
|
{Close button clicked.}
|
||||||
repeat
|
repeat
|
||||||
MakeLocal(Event.Where, Mouse);
|
MakeLocal(Event.Where, Mouse);
|
||||||
if (Mouse.X >= 2) and (Mouse.X <= 4) and (Mouse.Y = 0) then
|
if (Mouse.X >= 2) and (Mouse.X <= 4) and (Mouse.Y = 0) then
|
||||||
@ -2933,6 +2934,7 @@ begin
|
|||||||
(Mouse.X >= Size.X - 5) and
|
(Mouse.X >= Size.X - 5) and
|
||||||
(Mouse.X <= Size.X - 3)) then
|
(Mouse.X <= Size.X - 3)) then
|
||||||
begin
|
begin
|
||||||
|
{Zoom button clicked.}
|
||||||
if not Event.Double then
|
if not Event.Double then
|
||||||
repeat
|
repeat
|
||||||
MakeLocal(Event.Where, Mouse);
|
MakeLocal(Event.Where, Mouse);
|
||||||
@ -4442,6 +4444,11 @@ begin
|
|||||||
Inc(Event.Where.Y, P.Y);
|
Inc(Event.Where.Y, P.Y);
|
||||||
MoveGrow(Event.Where, Size);
|
MoveGrow(Event.Where, Size);
|
||||||
until not MouseEvent(Event, evMouseMove);
|
until not MouseEvent(Event, evMouseMove);
|
||||||
|
{We need to process the mouse-up event, since not all terminals
|
||||||
|
send drag events.}
|
||||||
|
Inc(Event.Where.X, P.X);
|
||||||
|
Inc(Event.Where.Y, P.Y);
|
||||||
|
MoveGrow(Event.Where, Size);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
P.X := Size.X - Event.Where.X;
|
P.X := Size.X - Event.Where.X;
|
||||||
@ -4451,6 +4458,11 @@ begin
|
|||||||
Inc(Event.Where.Y, P.Y);
|
Inc(Event.Where.Y, P.Y);
|
||||||
MoveGrow(Origin, Event.Where);
|
MoveGrow(Origin, Event.Where);
|
||||||
until not MouseEvent(Event, evMouseMove);
|
until not MouseEvent(Event, evMouseMove);
|
||||||
|
{We need to process the mouse-up event, since not all terminals
|
||||||
|
send drag events.}
|
||||||
|
Inc(Event.Where.X, P.X);
|
||||||
|
Inc(Event.Where.Y, P.Y);
|
||||||
|
MoveGrow(Origin, Event.Where);
|
||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user