• 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

Revisionc3d505de14a5980a1492414543fbd1a8df4a6147 (tree)
Time2007-05-12 11:46:10
Authorh677 <h677>
Commiterh677

Log Message

以前のヒントを使ったポップアップを廃止
タイトルしか出ないときに、スクロールバーが出ないように変更
画面サイズをワークエリアで設定するように変更

Change Summary

Incremental Difference

--- a/Giko.pas
+++ b/Giko.pas
@@ -16,7 +16,7 @@ uses
1616 ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils,
1717 CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload,
1818 Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent,
19- HintWindow, GikoCoolBar, GikoListView, Search, ExternalBoardManager,
19+ {HintWindow,} GikoCoolBar, GikoListView, Search, ExternalBoardManager,
2020 ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,
2121 IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem,
2222 ShellAPI,Preview, HistoryList, ResPopupBrowser;
@@ -560,7 +560,6 @@ type
560560 FEnabledCloseButton: Boolean;
561561 FClickNode: TTreeNode;
562562 FHttpState: Boolean;
563- FHint: TResPopup;
564563 FPreviewBrowser: TPreviewBrowser;
565564 FPreviewURL: string;
566565 FBrowserSizeHeight: Integer;
@@ -620,7 +619,6 @@ type
620619 procedure FavoriteClick(Sender: TObject); overload;
621620 procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
622621 function OnDocumentContextMenu(Sender: TObject): WordBool;
623- procedure ShowTextPopup;
624622 function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
625623 procedure MenuBarChevronMenu;
626624 procedure LinkBarChevronMenu;
@@ -1245,9 +1243,6 @@ begin
12451243 //ÅI„‰ñŽžŠÔ
12461244 // FLastRoundTime := 0;
12471245
1248- //ResHint
1249- FHint := TResPopup.Create(Self);
1250-
12511246 ListView.OnData := TListViewUtils.ListViewData;
12521247
12531248 // ÅŒã‚É‘I‘ð‚³‚ê‚½ƒLƒƒƒrƒlƒbƒg‚Ì•œŒ³
@@ -1687,12 +1682,8 @@ begin
16871682 if FEvent <> nil then
16881683 FEvent.Free;
16891684
1690- //Hint”jŠü
1691- if FHint <> nil then begin
1692- FHint.ReleaseHandle;
1693- FHint.Free;
1694- FHint := nil;
1695- end;
1685+ // TODO ƒŒƒXƒ|ƒbƒvƒAƒbƒv‚Ì”jŠü
1686+
16961687 //Preview”jŠü
16971688 if TPreviewBrowser <> nil then begin
16981689 FPreviewBrowser.Free;
@@ -1917,11 +1908,6 @@ begin
19171908 end;
19181909 StatusBar.Panels[1].Text := Text2;
19191910
1920- if FHint <> nil then begin
1921- FHint.ReleaseHandle;
1922- FHint.ClearAllRes;
1923- end;
1924-
19251911 if FPreviewBrowser <> nil then
19261912 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
19271913
@@ -1964,21 +1950,20 @@ begin
19641950 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
19651951 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
19661952 if (Assigned(e)) then begin
1953+ if (FResPopupBrowser = nil) then begin
1954+ FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
1955+ ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
1956+ end;
19671957 tmp2 := ZenToHan(e.Get_outerText);
19681958 if (GikoSys.IsNumeric(tmp2)) then begin
19691959 //‚“‚̓ŒƒX”ԍ†‚Á‚Û‚¢‚Á‚·B
19701960 wkIntSt := StrToInt64(tmp2);
19711961 wkIntTo := StrToInt64(tmp2);
1972- //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
1973- FHint.PopupType := gptThread;
1974- if (FResPopupBrowser = nil) then begin
1975- FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
1976- ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
1977- end;
1962+ FResPopupBrowser.PopupType := gptThread;
19781963 HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, GetActiveContent, wkIntSt, wkIntTo, False, False);
19791964 end else begin
1980- FHint.PopupType := gptRaw;
1981- FHint.Caption := s;
1965+ FResPopupBrowser.PopupType := gptRaw;
1966+ FResPopupBrowser.Title := s;
19821967 end;
19831968 end;
19841969 end else begin
@@ -2034,22 +2019,22 @@ begin
20342019 wkIntSt := 1;
20352020 wkIntTo := 1;
20362021 end;
2037- FHint.PopupType := gptThread;
20382022 if (FResPopupBrowser = nil) then begin
20392023 FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
20402024 ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
20412025 end;
2026+ FResPopupBrowser.PopupType := gptThread;
20422027 HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
20432028 end;
20442029 end;
20452030 end;
2046-
2047- if FHint.PopupType = gptRaw then begin
2048- if FHint.Caption <> '' then
2049- ShowTextPopup;
2050- end else begin
2051- if (FHint.ResCount <> 0) or (FHint.Title <> '') then
2052- ShowTextPopup;
2031+ if (FResPopupBrowser = nil) then begin
2032+ FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
2033+ ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
2034+ end;
2035+ if FResPopupBrowser.PopupType = gptRaw then begin
2036+ if FResPopupBrowser.Title <> '' then
2037+ FResPopupBrowser.CreateNewBrowser.TitlePopup;
20532038 end;
20542039 end;
20552040 end;
@@ -4790,12 +4775,9 @@ procedure TGikoForm.WMSetCursor(var Message: TWMSetCursor);
47904775 var
47914776 Pos : TPoint;
47924777 begin
4793- if (FHint <> nil) and (IsWindowVisible(FHint.Handle)) then begin
4794- FHint.ReleaseHandle;
4795- FHint.ClearAllRes;
4796- end;
47974778 if PreviewTimer.Enabled then
47984779 PreviewTimer.Enabled := False;
4780+
47994781 if (FResPopupBrowser <> nil) and (IsWindowVisible(FResPopupBrowser.Handle)) then begin
48004782 FResPopupBrowser.Clear;
48014783 end;
@@ -4843,14 +4825,12 @@ begin
48434825 ThreadItem := GetActiveContent;
48444826 if ThreadItem <> nil then begin
48454827 Num := StrToInt64(s);
4846- //FHint.PopupType := gptThread;
48474828 if (FResPopupBrowser = nil) then begin
48484829 FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel);
48494830 ShowWindow(FResPopupBrowser.Handle, SW_HIDE);
48504831 end;
4832+ FResPopupBrowser.PopupType := gptThread;
48514833 HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False);
4852- //if FHint.ResCount <> 0 then
4853- // ShowTextPopup;
48544834 Result := False;
48554835 end else
48564836 Result := True;
@@ -4860,46 +4840,6 @@ begin
48604840 end;
48614841 end;
48624842
4863-procedure TGikoForm.ShowTextPopup;
4864-var
4865- p: TPoint;
4866- ARect: TRect;
4867-begin
4868-// if Trim(s) = '' then
4869-// Exit;
4870- try
4871- FHint.Font.Name := GikoSys.Setting.HintFontName;
4872- FHint.Font.Size := GikoSys.Setting.HintFontSize;
4873- FHint.Font.Color := GikoSys.Setting.HintFontColor;
4874- FHint.Color := GikoSys.Setting.HintBackColor;
4875- FHint.HeaderBold := GikoSys.Setting.ResPopupHeaderBold;
4876- GetCursorpos(p);
4877- if FHint.PopupType = gptRaw then
4878- ARect := FHint.CalcHintRect(Screen.Width, FHint.Caption, nil)
4879- else
4880- ARect := FHint.CalcHintRect(Screen.Width, '', nil);
4881- case GikoSys.Setting.PopupPosition of
4882- gppRightTop: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - (ARect.Bottom - ARect.Top) - 15);
4883- gppRight: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - ((ARect.Bottom - ARect.Top) div 2));
4884- gppRightBottom: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y + 15);
4885- gppTop: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - (ARect.Bottom - ARect.Top) - 15);
4886- gppCenter: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - ((ARect.Bottom - ARect.Top) div 2));
4887- gppBottom: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y + 15);
4888- gppLeftTop: OffsetRect(ARect, p.x + 15, p.y - (ARect.Bottom - ARect.Top) - 15);
4889- gppLeft: OffsetRect(ARect, p.x + 15, p.y - ((ARect.Bottom - ARect.Top) div 2));
4890- gppLeftBottom: OffsetRect(ARect, p.x + 15, p.y + 15); //ƒMƒRƒiƒrƒXƒŒ ƒp[ƒg‚P‚Ì453Ž‚ÉŠ´ŽÓ
4891- end;
4892- //FHint.ActivateHint(ARect, s);
4893- if FHint.PopupType = gptRaw then
4894- FHint.ActivateHint(ARect, FHint.Caption)
4895- else
4896- FHint.ActivateHint(ARect, '');
4897- except
4898- FHint.ReleaseHandle;
4899- FHint.ClearAllRes;
4900- end;
4901-end;
4902-
49034843 procedure TGikoForm.HistoryAllClearToolButtonClick(Sender: TObject);
49044844 const
49054845 DEL_MSG = '‘S—š—ð‚ðíœ‚µ‚Ü‚·B‚æ‚낵‚¢‚Å‚·‚©H';
@@ -7284,12 +7224,11 @@ begin
72847224 Application.ProcessMessages;
72857225 if not Application.Terminated then begin
72867226 if PreviewTimer.Enabled then
7287- PreviewTimer.Enabled := False;
7288- //ƒtƒH[ƒJƒX‚ª‘¼‚̃AƒvƒŠ‚É•Ï‚í‚Á‚½‚Æ‚«‚Ƀqƒ“ƒg‚ðÁ‹Ž
7289- if FHint <> nil then begin
7290- FHint.ReleaseHandle;
7291- FHint.ClearAllRes;
7292- end;
7227+ PreviewTimer.Enabled := False;
7228+ //ƒtƒH[ƒJƒX‚ª‘¼‚̃AƒvƒŠ‚É•Ï‚í‚Á‚½‚Æ‚«‚Ƀ|ƒbƒvƒAƒbƒvÁ‹Ž
7229+ if FResPopupBrowser <> nil then
7230+ FResPopupBrowser.Clear;
7231+
72937232 //ƒvƒŒƒrƒ…[‚ð‰B‚·
72947233 if FPreviewBrowser <> nil then
72957234 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
--- a/HTMLCreate.pas
+++ b/HTMLCreate.pas
@@ -15,7 +15,7 @@ uses
1515 {HttpApp,} YofUtils, {URLMon,} BoardGroup, {gzip,} {Dolib,}
1616 {bmRegExp,} AbonUnit, MojuUtils, Setting,
1717 ExternalBoardManager, ExternalBoardPlugInMain{,}
18- {Sort,} ,GikoBayesian, HintWindow, ActiveX, ResPopupBrowser;
18+ {Sort,} ,GikoBayesian, {HintWindow,} ActiveX, ResPopupBrowser;
1919
2020 type
2121
@@ -1316,8 +1316,12 @@ begin
13161316 end;
13171317 end;
13181318 end;
1319- if (Html.Count > 0) or (Hint.Title <> '') then begin
1319+ if (Html.Count > 0) then begin
13201320 Hint.Write('<DL>' + Html.Text + '</DL>');
1321+ end else begin
1322+ if (Title) and (Hint.Title <> '') then begin
1323+ Hint.TitlePopup;
1324+ end;
13211325 end;
13221326 end;
13231327 finally
--- a/ResPopupBrowser.pas
+++ b/ResPopupBrowser.pas
@@ -2,7 +2,7 @@ unit ResPopupBrowser;
22 interface
33 uses
44 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
5- ActiveX, OleCtrls, HintWindow,
5+ ActiveX, OleCtrls, {HintWindow,}
66 {$IF Defined(DELPRO) }
77 SHDocVw,
88 MSHTML
@@ -13,27 +13,33 @@ uses
1313 ;
1414
1515 type
16+ TGikoPopupType = (gptRaw, gptThread);
17+
1618 TResPopupBrowser = class(TWebBrowser)
1719 private
1820 FChild :TResPopupBrowser;
21+ FParent:TResPopupBrowser;
1922 FTitle :String;
2023 FPopupType: TGikoPopupType;
21- function GetBodyStyle(): string;
24+ function GetBodyStyle(OnlyTitle: Boolean = False): string;
2225 function GetWindowHeight : Integer;
26+ function GetTitle(OnlyTitle: Boolean): string;
27+ function CalcRect(MaxHeight: Integer; MaxWidth: Integer; Scroll: Boolean): TRect;
2328 protected
2429 procedure CreateParams(var Params: TCreateParams); override;
2530 public
2631 constructor Create(AOwner: TComponent); override;
2732 destructor Destroy; override;
2833 property Child: TResPopupBrowser read FChild;
34+ property Parent:TResPopupBrowser read FParent write FParent;
2935 property Title: String read FTitle write FTitle;
3036 function CreateNewBrowser: TResPopupBrowser;
31- procedure Write(ADocument: String);
37+ procedure Write(ADocument: String; OnlyTitle: Boolean = False);
3238 procedure Clear;
3339 procedure ChildClear;
3440 procedure NavigateBlank;
35- function CalcRect(MaxHeight: Integer; MaxWidth: Integer): TRect;
36- property PopupType: TGikoPopupType read FPopupType write FPopupType;
41+ property PopupType: TGikoPopupType read FPopupType write FPopupType;
42+ procedure TitlePopup;
3743 end;
3844
3945 implementation
@@ -67,18 +73,20 @@ begin
6773 Result := FChild;
6874 end;
6975 end else begin
70- FChild := TResPopupBrowser.Create(Self);
71- TOleControl(FChild).Parent := nil;
72- FChild.NavigateBlank;
73- FChild.OnEnter := GikoForm.BrowserEnter;
74- FChild.OnBeforeNavigate2 := GikoForm.BrowserBeforeNavigate2;
75- FChild.OnStatusTextChange := GikoForm.BrowserStatusTextChange;
76- FChild.OnNewWindow2 := GikoForm.BrowserNewWindow2;
77- ShowWindow(FChild.Handle, SW_HIDE);
76+ FChild := TResPopupBrowser.Create(Self);
77+ TOleControl(FChild).Parent := nil;
78+ FChild.Parent := Self;
79+ FChild.NavigateBlank;
80+ FChild.OnEnter := GikoForm.BrowserEnter;
81+ FChild.OnBeforeNavigate2 := GikoForm.BrowserBeforeNavigate2;
82+ FChild.OnStatusTextChange := GikoForm.BrowserStatusTextChange;
83+ FChild.OnNewWindow2 := GikoForm.BrowserNewWindow2;
84+ ShowWindow(FChild.Handle, SW_HIDE);
7885 Result := FChild;
7986 end;
8087 end else begin
8188 TOleControl(Self).Parent := nil;
89+ FParent := nil;
8290 Self.NavigateBlank;
8391 Self.OnEnter := GikoForm.BrowserEnter;
8492 Self.OnBeforeNavigate2 := GikoForm.BrowserBeforeNavigate2;
@@ -98,40 +106,56 @@ begin
98106 Forms.Application.ProcessMessages;
99107 end;
100108 end;
101-procedure TResPopupBrowser.Write(ADocument: String);
109+procedure TResPopupBrowser.TitlePopup;
110+begin
111+ Write('', True);
112+end;
113+procedure TResPopupBrowser.Write(ADocument: String; OnlyTitle: Boolean = False);
102114 var
103115 doc: Variant;
104116 ARect: TRect;
105117 begin
118+ Self.OnStatusTextChange := nil;
106119 try
107- // ‚¢‚Á‚½‚ñk¬
108- SetWindowPos(Self.Handle, HWND_TOP,
109- 0, 0, 50 , 50,
110- SWP_NOMOVE or SWP_NOACTIVATE or SWP_HIDEWINDOW);
111-
112- doc := Idispatch( olevariant(Self.ControlInterface).Document) as IHTMLDocument2;
113- doc.open;
114- doc.charset := 'Shift_JIS';
115- doc.Write('<html><head>'#13#10 +
116- '<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">'#13#10 +
117- '<span id="hTitle">' + Title +'</span>'+ GetBodyStyle + '</head><body>' +
118- ADocument + '<a name="bottom"></a></body></html>');
119- doc.Close;
120-
121- ARect := CalcRect(Screen.Height, Screen.Width);
122- SetWindowPos(Self.Handle, HWND_TOP,
123- ARect.Left, ARect.Top,
124- (ARect.Right - ARect.Left) ,
125- (ARect.Bottom - ARect.Top),
126- SWP_NOACTIVATE or SWP_HIDEWINDOW);
127- ShowWindow(Self.Handle, SW_SHOWNOACTIVATE);
128- Self.Visible := True;
129- except
120+ try
121+ // ‚¢‚Á‚½‚ñk¬
122+ SetWindowPos(Self.Handle, HWND_TOP,
123+ 0, 0, 50 , 50,
124+ SWP_NOMOVE or SWP_NOACTIVATE or SWP_HIDEWINDOW);
125+
126+ doc := Idispatch( olevariant(Self.ControlInterface).Document) as IHTMLDocument2;
127+ doc.open;
128+ doc.charset := 'Shift_JIS';
129+ doc.Write('<html><head>'#13#10 +
130+ '<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">'#13#10
131+ + GetBodyStyle(OnlyTitle) + '</head><body>'
132+ + GetTitle(OnlyTitle)
133+ + ADocument + '<a name="bottom"></a></body></html>');
134+ doc.Close;
135+
136+ ARect := CalcRect(Screen.WorkAreaHeight, Screen.WorkAreaWidth,
137+ not OnlyTitle);
138+ SetWindowPos(Self.Handle, HWND_TOP,
139+ ARect.Left, ARect.Top,
140+ (ARect.Right - ARect.Left) ,
141+ (ARect.Bottom - ARect.Top),
142+ SWP_NOACTIVATE or SWP_HIDEWINDOW);
143+
144+ ShowWindow(Self.Handle, SW_SHOWNOACTIVATE);
145+ Self.Visible := True;
146+ except
147+ end;
148+ finally
149+ Self.OnStatusTextChange := GikoForm.BrowserStatusTextChange;
130150 end;
131151
132152 end;
133-
134-function TResPopupBrowser.GetBodyStyle(): string;
153+function TResPopupBrowser.GetTitle(OnlyTitle: Boolean): string;
154+begin
155+ Result := '<span id="hTitle">' + Title +'</span>';
156+ if OnlyTitle then Result := Result + '<BR>';
157+end;
158+function TResPopupBrowser.GetBodyStyle(OnlyTitle: Boolean = False): string;
135159 var
136160 i : Integer;
137161 begin
@@ -153,6 +177,8 @@ begin
153177 Result := Result + 'background-color:#' +
154178 IntToHex( (i shr 16) or (i and $ff00) or ((i and $ff) shl 16), 6 ) + ';';
155179 end;
180+ if OnlyTitle then
181+ Result := Result + 'overflow: hidden; ';
156182
157183 Result := Result + '}';
158184 if GikoSys.Setting.ResPopupHeaderBold then begin
@@ -178,7 +204,7 @@ begin
178204 end;
179205 end;
180206
181-function TResPopupBrowser.CalcRect(MaxHeight: Integer; MaxWidth: Integer): TRect;
207+function TResPopupBrowser.CalcRect(MaxHeight: Integer; MaxWidth: Integer; Scroll: Boolean): TRect;
182208 var
183209 p: TPoint;
184210 ele: IHTMLElement2;
@@ -186,8 +212,13 @@ var
186212 begin
187213 GetCursorpos(p);
188214 ele := ((Self.Document as IHTMLDocument2).body as IHTMLElement2);
189- h := GetWindowHeight + 10;
190- w := ele.scrollWidth + 25;
215+ if Scroll then begin
216+ h := GetWindowHeight + 10;
217+ w := ele.scrollWidth + 25
218+ end else begin
219+ h := GetWindowHeight + 5;
220+ w := ele.scrollWidth + 10;
221+ end;
191222 Result := Rect(0, 0, w, h);
192223 case GikoSys.Setting.PopupPosition of
193224 gppRightTop: OffsetRect(Result, p.x - w - 2, p.y - h - 2);
Binary files a/gikoNavi.res and b/gikoNavi.res differ