• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscaphegui翻訳comegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

ギコナビ


Commit MetaInfo

Revision72a952450ce9a36b66f1850e543506934c357420 (tree)
Time2007-05-31 00:48:21
Authorh677 <h677>
Commiterh677

Log Message

出現位置の左右上下を入れ替えた後に、ウィンドウサイズを縮小する処理を追加

Change Summary

Incremental Difference

--- a/Giko.pas
+++ b/Giko.pas
@@ -3743,8 +3743,6 @@ var
37433743 BNum, BRes: string;
37443744 threadItem: TThreadItem;
37453745 aElement : IHTMLElement;
3746- rect: TRect;
3747- purl, pflag, pdata, ptarget, handler: OleVariant;
37483746 begin
37493747 {$IFDEF DEBUG}
37503748 Writeln(IntToStr(Integer(ppDisp)));
--- a/ResPopupBrowser.pas
+++ b/ResPopupBrowser.pas
@@ -27,7 +27,7 @@ type
2727 function GetBodyStyle(OnlyTitle: Boolean = False): string;
2828 function GetWindowHeight : Integer;
2929 function GetTitle(OnlyTitle: Boolean): string;
30- function CalcRect(MaxHeight: Integer; MaxWidth: Integer; Scroll: Boolean): TRect;
30+ function CalcRect(WorkArea: TRect; Scroll: Boolean): TRect;
3131 function ResPopupBrowserClick(Sender: TObject): WordBool;
3232 function GetThread: TThreadItem;
3333 protected
@@ -181,8 +181,7 @@ begin
181181
182182 doc.Close;
183183
184- ARect := CalcRect(Screen.WorkAreaHeight, Screen.WorkAreaWidth,
185- not OnlyTitle);
184+ ARect := CalcRect(Screen.WorkAreaRect, not OnlyTitle);
186185
187186 FDispHtmlDocument := Idispatch(OleVariant(Self.ControlInterface).Document) as DispHTMLDocument;
188187 FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
@@ -256,11 +255,12 @@ begin
256255 end;
257256 end;
258257
259-function TResPopupBrowser.CalcRect(MaxHeight: Integer; MaxWidth: Integer; Scroll: Boolean): TRect;
258+function TResPopupBrowser.CalcRect(WorkArea: TRect; Scroll: Boolean): TRect;
260259 var
261260 p: TPoint;
262261 ele: IHTMLElement2;
263262 h, w, dx1, dx2, dy1, dy2: Integer;
263+ MaxWidth, MaxHeight: Integer;
264264 begin
265265 GetCursorpos(p);
266266 ele := ((Self.Document as IHTMLDocument2).body as IHTMLElement2);
@@ -279,17 +279,17 @@ begin
279279 case GikoSys.Setting.PopupPosition of
280280 gppRightTop:
281281 begin
282- dx1 := -w; dx2 := -2;
282+ dx1 := 0; dx2 := -2;
283283 dy1 := -h; dy2 := -2;
284284 end;
285285 gppRight:
286286 begin
287- dx1 := -w; dx2 := -2;
287+ dx1 := 0; dx2 := -2;
288288 dy1 := - (h div 2); dy2 := 0;
289289 end;
290290 gppRightBottom:
291291 begin
292- dx1 := -w; dx2 := -2;
292+ dx1 := 0; dx2 := -2;
293293 dy1 := 0; dy2 := +2;
294294 end;
295295 gppTop:
@@ -305,30 +305,32 @@ begin
305305 end;
306306 gppLeftTop:
307307 begin
308- dx1 := 0; dx2 := +2;
308+ dx1 := -w; dx2 := +2;
309309 dy1 := -h; dy2 := -2;
310310 end;
311311 gppLeft:
312312 begin
313- dx1 := 0; dx2 := +2;
313+ dx1 := -w; dx2 := +2;
314314 dy1 := - (h div 2); dy2 := 0;
315315 end;
316316 gppLeftBottom:
317317 begin
318- dx1 := 0; dx2 := +2;
318+ dx1 := -w; dx2 := +2;
319319 dy1 := 0; dy2 := +2;
320320 end;
321321 end;
322322 // ‰ŠúˆÊ’u‚Ɉړ®
323323 OffsetRect(Result, p.x + dx1 + dx2, p.y + dy1 + dy2);
324324
325+ MaxWidth := WorkArea.Right - WorkArea.Left;
326+ MaxHeight := WorkArea.Bottom - WorkArea.Top;
325327 // ˆÈ‰ºA‰ŠúˆÊ’u‚É–â‘肪‚ ‚é‚Æ‚«‚̈ړ®
326- if (Result.Left < 0) then begin
328+ if (Result.Left < WorkArea.Left) then begin
327329 // ‹tƒTƒCƒh‚É—]—T‚ª‚ ‚ê‚΁Ao—͈ʒu‚̍¶‰E“]Š·
328330 if (p.X * 2 < MaxWidth) then begin
329331 if ( (GikoSys.Setting.PopupPosition = gppTop) or
330332 (GikoSys.Setting.PopupPosition = gppBottom)) then begin
331- OffsetRect(Result, -Result.Left, 0);
333+ OffsetRect(Result, -Result.Left, WorkArea.Left);
332334 end else begin
333335 OffsetRect(Result, - (dx1 + 2 * dx2), 0);
334336 end;
@@ -338,39 +340,49 @@ begin
338340 Result.Right, Result.Bottom);
339341 end;
340342 end;
341- if (Result.Top < 0) then begin
343+ if (Result.Top < WorkArea.Top) then begin
342344 // ’ꑤ‚É—]—T‚ª‚ ‚ê‚΁Ao—͈ʒu‚̏㉺“]Š·
343345 if (p.Y * 2 < MaxHeight) then begin
344346 OffsetRect(Result, 0, - (dy1 + 2 * dy2));
345347 end else begin
346348 // ‰æ–Ê’[‚܂ʼnæ–ʍ‚‚ð¬‚³‚­‚·‚é
347- Result := Rect(Result.Left, 0,
349+ Result := Rect(Result.Left, WorkArea.Top,
348350 Result.Right, Result.Bottom);
349351 end;
350352 end;
351- if (Result.Right > MaxWidth) then begin
353+ if (Result.Right > WorkArea.Right) then begin
352354 // ‹tƒTƒCƒh‚É—]—T‚ª‚ ‚ê‚΁Ao—͈ʒu‚̍¶‰E“]Š·
353- if (p.X * 2 > MaxWidth) then begin
355+ if (p.X * 2 > WorkArea.Right) then begin
354356 if( (GikoSys.Setting.PopupPosition = gppTop) or
355357 (GikoSys.Setting.PopupPosition = gppBottom)) then begin
356- OffsetRect(Result, -(Result.Right - MaxWidth), 0);
358+ OffsetRect(Result, -(Result.Right - WorkArea.Right), 0);
357359 end else begin
358360 OffsetRect(Result, -w - (dx1 + 2 * dx2), 0);
359361 end;
362+ // ‹tƒTƒCƒh‚ɃI[ƒo[‚µ‚½ê‡‚͉æ–Ê’[‚Ü‚Å•‚ð¬‚³‚­‚·‚é
363+ if (Result.Left < WorkArea.Left) then begin
364+ Result := Rect(WorkArea.Left, Result.Top,
365+ Result.Right, Result.Bottom);
366+ end;
360367 end else begin
361368 // ‰æ–Ê’[‚܂ʼnæ–Ê•‚ð¬‚³‚­‚·‚é
362369 Result := Rect(Result.Left, Result.Top,
363- MaxWidth, Result.Bottom);
370+ WorkArea.Right, Result.Bottom);
364371 end;
365372 end;
366- if (Result.Bottom > MaxHeight) then begin
373+ if (Result.Bottom > WorkArea.Bottom) then begin
367374 // ã‘¤‚É—]—T‚ª‚ ‚ê‚΁Ao—͈ʒu‚̏㉺“]Š·
368- if (p.Y * 2 > MaxHeight) then begin
375+ if (p.Y * 2 > WorkArea.Bottom) then begin
369376 OffsetRect(Result, 0, -h - (dy1 + 2 * dy2));
377+ // ã‚ÉŠÑ‚¢‚½ê‡‚́A
378+ if (Result.Top < WorkArea.Top) then begin
379+ Result := Rect(Result.Left, WorkArea.Top,
380+ Result.Right, Result.Bottom);
381+ end;
370382 end else begin
371383 // ‰æ–Ê’[‚܂ʼnæ–ʍ‚‚ð¬‚³‚­‚·‚é
372384 Result := Rect(Result.Left, Result.Top,
373- Result.Right, 0);
385+ Result.Right, WorkArea.Bottom);
374386 end;
375387 end;
376388 end;
Binary files a/gikoNavi.res and b/gikoNavi.res differ