OSDN Git Service

マルチモニタ向けの修正(未確認)
authorh677 <h677>
Sun, 14 Oct 2007 04:23:30 +0000 (04:23 +0000)
committerh677 <h677>
Sun, 14 Oct 2007 04:23:30 +0000 (04:23 +0000)
ResPopupBrowser.pas

index f42e50d..6039ba3 100644 (file)
@@ -189,8 +189,9 @@ begin
                 + ADocument + '<a name="bottom"></a></body></html>');
 
         doc.Close;
-
-        ARect := CalcRect(Screen.WorkAreaRect, not OnlyTitle);
+        // \83}\83\8b\83`\83\82\83j\83^\91Î\89\9e
+        ARect := CalcRect(Screen.MonitorFromPoint(p).WorkareaRect,
+                        not OnlyTitle);
 
         FDispHtmlDocument := Idispatch(OleVariant(Self.ControlInterface).Document) as DispHTMLDocument;
         FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
@@ -340,22 +341,22 @@ begin
     // \88È\89º\81A\8f\89\8aú\88Ê\92u\82É\96â\91è\82ª\82 \82é\82Æ\82«\82Ì\88Ú\93®
     if (Result.Left < WorkArea.Left) then begin
         // \8bt\83T\83C\83h\82É\97]\97T\82ª\82 \82ê\82Î\81A\8fo\97Í\88Ê\92u\82Ì\8d\89E\93]\8a·
-        if (p.X * 2 < MaxWidth) then begin
+        if ((p.X - WorkArea.Left) * 2 < MaxWidth) then begin
             if ( (GikoSys.Setting.PopupPosition = gppTop) or
                 (GikoSys.Setting.PopupPosition = gppBottom)) then begin
-                OffsetRect(Result, -Result.Left, WorkArea.Left);
+                OffsetRect(Result, -Result.Left, 0);
             end else begin
                 OffsetRect(Result, - (dx1 + 2 * dx2), 0);
             end;
         end else begin
             // \89æ\96Ê\92[\82Ü\82Å\89æ\96Ê\95\9d\82ð\8f¬\82³\82­\82·\82é
-            Result := Rect(0, Result.Top,
+            Result := Rect(WorkArea.Left, Result.Top,
                 Result.Right, Result.Bottom);
         end;
     end;
     if (Result.Top < WorkArea.Top) then begin
         // \92ê\91¤\82É\97]\97T\82ª\82 \82ê\82Î\81A\8fo\97Í\88Ê\92u\82Ì\8fã\89º\93]\8a·
-        if (p.Y * 2 < MaxHeight) then begin
+        if ((p.Y - WorkArea.Top) * 2 < MaxHeight) then begin
             OffsetRect(Result, 0, - (dy1 + 2 * dy2));
         end else begin
             // \89æ\96Ê\92[\82Ü\82Å\89æ\96Ê\8d\82\82ð\8f¬\82³\82­\82·\82é
@@ -365,7 +366,7 @@ begin
     end;
     if (Result.Right > WorkArea.Right) then begin
         // \8bt\83T\83C\83h\82É\97]\97T\82ª\82 \82ê\82Î\81A\8fo\97Í\88Ê\92u\82Ì\8d\89E\93]\8a·
-        if (p.X * 2 > WorkArea.Right) then begin
+        if ((p.X - WorkArea.Left) * 2 > WorkArea.Right) then begin
             if( (GikoSys.Setting.PopupPosition = gppTop) or
                 (GikoSys.Setting.PopupPosition = gppBottom)) then begin
                 OffsetRect(Result, -(Result.Right - WorkArea.Right), 0);
@@ -385,7 +386,7 @@ begin
     end;
     if (Result.Bottom > WorkArea.Bottom) then begin
         // \8fã\91¤\82É\97]\97T\82ª\82 \82ê\82Î\81A\8fo\97Í\88Ê\92u\82Ì\8fã\89º\93]\8a·
-        if (p.Y * 2 > WorkArea.Bottom) then begin
+        if ((p.Y - WorkArea.Top) * 2 > WorkArea.Bottom) then begin
             OffsetRect(Result, 0, -h - (dy1 + 2 * dy2));
             // \8fã\82É\8aÑ\82¢\82½\8fê\8d\87\82Í\81A
             if (Result.Top < WorkArea.Top) then begin