Browse Source

+ Handle dragging correctly even if mouse doesn't send mouse move events.

git-svn-id: trunk@6226 -
daniel 18 years ago
parent
commit
d5662d71a8
1 changed files with 12 additions and 0 deletions
  1. 12 0
      fv/views.pas

+ 12 - 0
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