Develop and Download Open Source Software

Browse CVS Repository

Annotation of /gikonavigoeson/gikonavi/Giko.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.573 - (hide annotations) (download) (as text)
Thu Dec 22 15:41:45 2005 UTC (18 years, 4 months ago) by h677
Branch: MAIN
CVS Tags: v1_51_0_634
Changes since 1.572: +50 -53 lines
File MIME type: text/x-pascal
お気に入りでドラッグでクリックイベントが発生しないように修正

1 hi_ 1.1 unit Giko;
2    
3     interface
4    
5     uses
6     Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 h677 1.536 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils,
8 hi_ 1.4 {$IF Defined(DELPRO) }
9 yoffy 1.138 SHDocVw,
10 hi_ 1.4 MSHTML,
11     {$ELSE}
12     SHDocVw_TLB,
13     MSHTML_TLB,
14     {$IFEND}
15 h677 1.183 IdHTTP, ActiveX, ActnList, ImgList,
16 h677 1.536 ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils,
17     CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload,
18     Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent,
19     HintWindow, GikoCoolBar, GikoListView, Search, ExternalBoardManager,
20     ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,
21 h677 1.551 IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord;
22 hi_ 1.1
23 h677 1.567 const
24     NGWORDNAME_PANEL = 3;
25     THREADSIZE_PANEL = 2;
26    
27 hi_ 1.1 type
28 yoffy 1.138 TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite);
29 yoffy 1.258 TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
30 yoffy 1.280 TMinimizeType = (mtNone, mtMinimizing, mtMinimized);
31 yoffy 1.424 TResizeType = (rtNone, rtResizing);
32 hi_ 1.1
33 h677 1.551 // TBrowserRecord = class;
34 h677 1.299
35 hi_ 1.1 TGikoForm = class(TForm)
36     StatusBar: TStatusBar;
37     MainPanel: TPanel;
38     ClientPanel: TPanel;
39     TreeSplitter: TSplitter;
40     CabinetPanel: TPanel;
41     TreeView: TTreeView;
42     ThreadMainPanel: TPanel;
43     ListSplitter: TSplitter;
44     ViewPanel: TPanel;
45 yoffy 1.51 ListView: TGikoListView;
46 hi_ 1.1 ThreadPanel: TPanel;
47     MessagePanel: TPanel;
48     MessageBar: TPanel;
49     MessageHideButton: TSpeedButton;
50     MessageListView: TListView;
51     MessageSplitter: TSplitter;
52     Panel3: TPanel;
53 h677 1.541 CabinetCloseSpeedButton: TSpeedButton;
54 hi_ 1.1 ToolBar1: TToolBar;
55     CabinetSelectToolButton: TToolButton;
56     HistoryToolBar: TToolBar;
57 h677 1.541 HistoryShowToolButton: TToolButton;
58     HistoryAllClearToolButton: TToolButton;
59 hi_ 1.1 ItemIcon16: TImageList;
60     ItemIcon32: TImageList;
61 yoffy 1.2 HotToobarImageList: TImageList;
62 hi_ 1.1 ItemImageList: TImageList;
63     MainMenu: TMainMenu;
64     FileMenu: TMenuItem;
65 yoffy 1.51 DeleteMenu: TMenuItem;
66     ExitMenu: TMenuItem;
67     KidokuMenu: TMenuItem;
68 hi_ 1.1 MidokuMenu: TMenuItem;
69 yoffy 1.51 AllSelectMenu: TMenuItem;
70 hi_ 1.1 ViewMenu: TMenuItem;
71     StdToolBarMenu: TMenuItem;
72     CabinetMenu: TMenuItem;
73 yoffy 1.51 H1: TMenuItem;
74 hi_ 1.1 N4: TMenuItem;
75 yoffy 1.51 CabinetVisibleMenu: TMenuItem;
76 hi_ 1.1 MessageMenu: TMenuItem;
77     StatusBarMenu: TMenuItem;
78     MMSep03: TMenuItem;
79 yoffy 1.51 LargeIconMenu: TMenuItem;
80 hi_ 1.1 SmallIconMenu: TMenuItem;
81     ListMenu: TMenuItem;
82     DetailMenu: TMenuItem;
83 yoffy 1.51 ToolMenu: TMenuItem;
84 hi_ 1.1 Find1: TMenuItem;
85     RoundMenu: TMenuItem;
86     MMSep04: TMenuItem;
87     OptionMenu: TMenuItem;
88     HelpMenu: TMenuItem;
89     G1: TMenuItem;
90 yoffy 1.51 N1: TMenuItem;
91 hi_ 1.1 AboutMenu: TMenuItem;
92     BrowserPopupMenu: TPopupMenu;
93 yoffy 1.51 ShowThreadMenu: TMenuItem;
94 yoffy 1.2 ShowBoardMenu: TMenuItem;
95 hi_ 1.1 ListIconPopupMenu: TPopupMenu;
96     LargeIconPMenu: TMenuItem;
97     SmallIconPMenu: TMenuItem;
98     ListPMenu: TMenuItem;
99 yoffy 1.51 DetailPMenu: TMenuItem;
100 hi_ 1.1 ClosePopupMenu: TPopupMenu;
101 yoffy 1.51 CloseMenu: TMenuItem;
102 hi_ 1.1 U1: TMenuItem;
103     N3: TMenuItem;
104     B1: TMenuItem;
105     S1: TMenuItem;
106     N2: TMenuItem;
107     A1: TMenuItem;
108     L1: TMenuItem;
109     N5: TMenuItem;
110     S2: TMenuItem;
111     ListPopupMenu: TPopupMenu;
112 yoffy 1.51 ListRoundPMenu: TMenuItem;
113 hi_ 1.1 ListReservPMenu: TMenuItem;
114     LPMSep01: TMenuItem;
115 yoffy 1.51 ItemRoundPMenu: TMenuItem;
116 hi_ 1.1 LPMSep02: TMenuItem;
117 yoffy 1.2 KidokuPMenu: TMenuItem;
118 hi_ 1.1 MidokuPMenu: TMenuItem;
119     AllSelectPMenu: TMenuItem;
120     UrlCopyPMenu: TMenuItem;
121     LPMSep05: TMenuItem;
122     DeletePMenu: TMenuItem;
123     LPMSep06: TMenuItem;
124     ViewPMenu: TMenuItem;
125     LargeIconLPMenu: TMenuItem;
126     SmallIconLPMenu: TMenuItem;
127     ListLPMenu: TMenuItem;
128     DetailLPMenu: TMenuItem;
129     T1: TMenuItem;
130     B2: TMenuItem;
131     N8: TMenuItem;
132 yoffy 1.51 URLC1: TMenuItem;
133     N9: TMenuItem;
134 hi_ 1.1 N10: TMenuItem;
135     G2: TMenuItem;
136     N11: TMenuItem;
137     T3: TMenuItem;
138     L2: TMenuItem;
139     N12: TMenuItem;
140     K1: TMenuItem;
141     N13: TMenuItem;
142     N14: TMenuItem;
143     R1: TMenuItem;
144     A2: TMenuItem;
145     N15: TMenuItem;
146     KokoPopupMenu: TPopupMenu;
147     KokomadePMenu: TMenuItem;
148 yoffy 1.2 AllPMenu: TMenuItem;
149 hi_ 1.1 MenuItem1: TMenuItem;
150     MenuItem2: TMenuItem;
151     BrowserTabPopupMenu: TPopupMenu;
152 yoffy 1.51 Close1: TMenuItem;
153 hi_ 1.1 A3: TMenuItem;
154 yoffy 1.51 N16: TMenuItem;
155 hi_ 1.1 A4: TMenuItem;
156     TreePopupMenu: TPopupMenu;
157     TreeSelectThreadPupupMenu: TMenuItem;
158 yoffy 1.51 TreeSelectBoardPupupMenu: TMenuItem;
159 hi_ 1.1 TPMSep01: TMenuItem;
160     TreeSelectURLPupupMenu: TMenuItem;
161     T2: TMenuItem;
162 yoffy 1.2 L3: TMenuItem;
163 hi_ 1.1 B3: TMenuItem;
164     BrowserBottomPanel: TGikoPanel;
165     CabinetSelectPopupMenu: TPopupMenu;
166     H2: TMenuItem;
167 yoffy 1.51 ItemReservPMenu: TMenuItem;
168     RoundNamePopupMenu: TPopupMenu;
169 yoffy 1.2 N7: TMenuItem;
170 hi_ 1.1 B4: TMenuItem;
171     L4: TMenuItem;
172     K2: TMenuItem;
173 yoffy 1.51 A5: TMenuItem;
174 hi_ 1.1 A6: TMenuItem;
175 yoffy 1.51 C1: TMenuItem;
176     V1: TMenuItem;
177     N19: TMenuItem;
178 hi_ 1.1 D1: TMenuItem;
179 yoffy 1.51 D2: TMenuItem;
180     MessageImageList: TImageList;
181     ProgressBar: TProgressBar;
182     URL1: TMenuItem;
183 hi_ 1.1 NameUrlCopyPMenu: TMenuItem;
184     URLC2: TMenuItem;
185 yoffy 1.51 URLN1: TMenuItem;
186     N21: TMenuItem;
187     URLC3: TMenuItem;
188 yoffy 1.2 URLN2: TMenuItem;
189 yoffy 1.51 N23: TMenuItem;
190 yoffy 1.2 ListCoolBar: TGikoCoolBar;
191 hi_ 1.1 ListToolBar: TToolBar;
192 yoffy 1.2 BrowserCoolBar: TGikoCoolBar;
193 hi_ 1.1 BrowserToolBar: TToolBar;
194     ToolButton3: TToolButton;
195 yoffy 1.51 ToolButton9: TToolButton;
196 hi_ 1.1 ToolButton11: TToolButton;
197 yoffy 1.51 ToolButton5: TToolButton;
198 hi_ 1.1 ListNameToolBar: TToolBar;
199 yoffy 1.51 ListNameLabel: TLabel;
200 hi_ 1.1 FolderImage: TImage;
201     BrowserNameToolBar: TToolBar;
202     ItemBoardImage: TImage;
203     BrowserBoardNameLabel: TLabel;
204 yoffy 1.51 ItemImage: TImage;
205     BrowserNameLabel: TLabel;
206     D3: TMenuItem;
207     N25: TMenuItem;
208 hi_ 1.1 N26: TMenuItem;
209     D4: TMenuItem;
210     S3: TMenuItem;
211 yoffy 1.51 R2: TMenuItem;
212     TreeSelectNameURLPupupMenu: TMenuItem;
213     N27: TMenuItem;
214 hi_ 1.1 H3: TMenuItem;
215 yoffy 1.51 I1: TMenuItem;
216     BrowserTabToolBar: TToolBar;
217     BrowserTab: TTabControl;
218     About1: TMenuItem;
219     N28: TMenuItem;
220     S4: TMenuItem;
221 yoffy 1.2 N29: TMenuItem;
222     N30: TMenuItem;
223     N31: TMenuItem;
224 hi_ 1.1 L5: TMenuItem;
225 yoffy 1.51 L6: TMenuItem;
226 hi_ 1.1 A7: TMenuItem;
227 yoffy 1.51 R3: TMenuItem;
228 hi_ 1.1 FavoriteMenu: TMenuItem;
229 yoffy 1.51 N32: TMenuItem;
230 hi_ 1.1 BoardFavoriteAddMenu: TMenuItem;
231     ThreadFavoriteAddMenu: TMenuItem;
232 yoffy 1.2 N33: TMenuItem;
233 hi_ 1.1 TreeSelectFavoriteAddPupupMenu: TMenuItem;
234     FavoriteTreeView: TTreeView;
235 yoffy 1.51 StateIconImageList: TImageList;
236     TopPanel: TPanel;
237     TopRightPanel: TPanel;
238     AnimePanel: TPanel;
239 hi_ 1.1 Animate: TAnimate;
240     TopCoolPanel: TPanel;
241 yoffy 1.51 MainCoolBar: TGikoCoolBar;
242     MenuToolBar: TToolBar;
243     StdToolBar: TToolBar;
244     AddressToolBar: TToolBar;
245     AddressComboBox: TComboBox;
246     MoveToToolButton: TToolButton;
247     AddressImageList: TImageList;
248     AddressToolBarMenu: TMenuItem;
249     T4: TMenuItem;
250     Show1: TMenuItem;
251     N34: TMenuItem;
252 hi_ 1.1 T5: TMenuItem;
253     B5: TMenuItem;
254 yoffy 1.51 N35: TMenuItem;
255     A8: TMenuItem;
256     U2: TMenuItem;
257 hi_ 1.1 F1: TMenuItem;
258     PreviewTimer: TTimer;
259 yoffy 1.51 MonazillaWebPageAction1: TMenuItem;
260     N36: TMenuItem;
261     H4: TMenuItem;
262     K3: TMenuItem;
263     L7: TMenuItem;
264     N37: TMenuItem;
265     A9: TMenuItem;
266 yoffy 1.2 ChevronPopupMenu: TPopupMenu;
267     N2N1: TMenuItem;
268 hi_ 1.1 N38: TMenuItem;
269 yoffy 1.2 F2: TMenuItem;
270 yoffy 1.51 LinkToolBar: TToolBar;
271     a10: TMenuItem;
272     N39: TMenuItem;
273     T6: TMenuItem;
274     N40: TMenuItem;
275 yoffy 1.2 LinkBarPopupMenu: TPopupMenu;
276 yoffy 1.51 T7: TMenuItem;
277     ThreadPopupMenu: TPopupMenu;
278     MenuItem4: TMenuItem;
279     MenuItem5: TMenuItem;
280     MenuItem6: TMenuItem;
281 yoffy 1.2 T8: TMenuItem;
282 yoffy 1.51 URLN3: TMenuItem;
283 yoffy 1.2 SelectItemNameCopyAction1: TMenuItem;
284 yoffy 1.51 B6: TMenuItem;
285     T9: TMenuItem;
286     C2: TMenuItem;
287     SelectComboBox: TComboBox;
288     MainCoolBarPopupMenu: TPopupMenu;
289     StdToolBarVisiblePMenu: TMenuItem;
290     AddressToolBarVisiblePMenu: TMenuItem;
291     LinkToolBarVisiblePMenu: TMenuItem;
292     NG1: TMenuItem;
293     NG2: TMenuItem;
294     N43: TMenuItem;
295     N44: TMenuItem;
296     L9: TMenuItem;
297     I3: TMenuItem;
298     N45: TMenuItem;
299     B9: TMenuItem;
300     R5: TMenuItem;
301     T12: TMenuItem;
302     Show3: TMenuItem;
303     N46: TMenuItem;
304     T13: TMenuItem;
305     B10: TMenuItem;
306     N47: TMenuItem;
307     A12: TMenuItem;
308     U4: TMenuItem;
309     F4: TMenuItem;
310     N48: TMenuItem;
311     T14: TMenuItem;
312     ToolButton16: TToolButton;
313     N50: TMenuItem;
314     A11: TMenuItem;
315     S5: TMenuItem;
316     Reload: TMenuItem;
317     GoBack: TMenuItem;
318     GoFoward: TMenuItem;
319     IndividualAbon1: TMenuItem;
320     N41: TMenuItem;
321     IndividualAbon2: TMenuItem;
322 h677 1.543 AntiIndivAbonMenuItem: TMenuItem;
323 yoffy 1.51 AntiIndividualAbon: TMenuItem;
324     N49: TMenuItem;
325     N51: TMenuItem;
326     N52: TMenuItem;
327     SearchBoardName: TMenuItem;
328 yoffy 1.205 TreeSelectLogDeleteSeparator: TMenuItem;
329 yoffy 1.100 N54: TMenuItem;
330     A13: TMenuItem;
331     FavoriteTreePopupMenu: TPopupMenu;
332     FavoriteTreeRenamePopupMenu: TMenuItem;
333     FavoriteTreeNewFolderPopupMenu: TMenuItem;
334     N56: TMenuItem;
335     FavoriteTreeDeletePopupMenu: TMenuItem;
336     FavoriteToolBar: TToolBar;
337 h677 1.541 FavoriteAddToolButton: TToolButton;
338     FavoriteArrangeToolButton: TToolButton;
339 yoffy 1.100 FavoriteTreeBrowseFolderPopupMenu: TMenuItem;
340     N57: TMenuItem;
341     FavoriteTreeReloadPopupMenu: TMenuItem;
342     N58: TMenuItem;
343     FavoriteTreeURLCopyPopupMenu: TMenuItem;
344     FavoriteTreeNameCopyPopupMenu: TMenuItem;
345     FavoriteTreeLogDeletePopupMenu: TMenuItem;
346     N59: TMenuItem;
347     FavoriteTreeNameURLCopyPopupMenu: TMenuItem;
348     ToolButton20: TToolButton;
349     N60: TMenuItem;
350 yoffy 1.107 ExportFavoriteFileAction1: TMenuItem;
351 yoffy 1.142 N6: TMenuItem;
352     N17: TMenuItem;
353 h677 1.174 N18: TMenuItem;
354     N20: TMenuItem;
355 h677 1.532 N24: TMenuItem;
356 h677 1.174 N62: TMenuItem;
357 h677 1.514 N61: TMenuItem;
358 h677 1.478 N63: TMenuItem;
359 h677 1.183 N64: TMenuItem;
360 h677 1.187 dummy1: TMenuItem;
361 h677 1.570 TreeSelectLogDeletePopupMenu: TMenuItem;
362 h677 1.485 N65: TMenuItem;
363 yoffy 1.209 BBSSelectPopupMenu: TPopupMenu;
364 yoffy 1.218 PlugInMenu: TMenuItem;
365 h677 1.542 TreeSelectNamePupupMenu: TMenuItem;
366 h677 1.299 BrowserPanel: TPanel;
367 h677 1.514 SelectTimer: TTimer;
368 h677 1.340 SelectThreadSave: TMenuItem;
369 h677 1.342 N55: TMenuItem;
370 h677 1.343 N66: TMenuItem;
371     dat1: TMenuItem;
372 yoffy 1.397 OpenLogFolder: TMenuItem;
373 h677 1.346 Browser: TWebBrowser;
374 genyakun 1.353 TabSave: TMenuItem;
375 h677 1.407 TabOpen: TMenuItem;
376 yoffy 1.375 ResRangePopupMenu: TPopupMenu;
377 h677 1.547 ResRangeHundPMenuItem: TMenuItem;
378     ResRangeKokoPMenuItem: TMenuItem;
379     ResRangeNewPMenuItem: TMenuItem;
380     ResRangeAllPMenuItem: TMenuItem;
381 h677 1.570 BrowsBoradHeadAction1: TMenuItem;
382 yoffy 1.390 ThreadRangePopupMenu: TPopupMenu;
383     A15: TMenuItem;
384     L8: TMenuItem;
385 h677 1.542 N67: TMenuItem;
386 yoffy 1.390 N68: TMenuItem;
387     S6: TMenuItem;
388     N69: TMenuItem;
389 h677 1.547 ResRangeSelectPMenuItem: TMenuItem;
390 yoffy 1.415 ListColumnPopupMenu: TPopupMenu;
391 h677 1.485 N70: TMenuItem;
392     ID1: TMenuItem;
393     ID2: TMenuItem;
394     N53: TMenuItem;
395     ID3: TMenuItem;
396     N71: TMenuItem;
397 h677 1.487 N72: TMenuItem;
398     N73: TMenuItem;
399 h677 1.517 SelectComboBoxPanel: TPanel;
400     SelectComboBoxSplitter: TImage;
401 h677 1.570 ToolButton1: TToolButton;
402 h677 1.517 N74: TMenuItem;
403 genyakun 1.527 WikiFAQ: TMenuItem;
404 h677 1.542 GikoApplicationEvents: TApplicationEvents;
405 yoffy 1.251 procedure FormCreate(Sender: TObject);
406 hi_ 1.1 procedure FormDestroy(Sender: TObject);
407     procedure BrowserStatusTextChange(Sender: TObject;
408     const Text: WideString);
409     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
410     procedure TreeViewChanging(Sender: TObject; Node: TTreeNode;
411     var AllowChange: Boolean);
412     procedure ListViewKeyDown(Sender: TObject; var Key: Word;
413     Shift: TShiftState);
414     procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
415     procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
416     Button: TToolButton; State: TCustomDrawState;
417     var DefaultDraw: Boolean);
418     procedure BrowserBeforeNavigate2(Sender: TObject;
419     const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
420     Headers: OleVariant; var Cancel: WordBool);
421     procedure TreeViewCustomDraw(Sender: TCustomTreeView;
422     const ARect: TRect; var DefaultDraw: Boolean);
423     procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
424     Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
425     procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
426     procedure TreeViewDblClick(Sender: TObject);
427     procedure ListViewCustomDraw(Sender: TCustomListView;
428     const ARect: TRect; var DefaultDraw: Boolean);
429     procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
430     Shift: TShiftState; X, Y: Integer);
431     procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
432     procedure MessageListViewResize(Sender: TObject);
433 yoffy 1.138 procedure CabinetVisible( isVisible : Boolean );
434 hi_ 1.1 procedure FormResize(Sender: TObject);
435     procedure ListPopupMenuPopup(Sender: TObject);
436     procedure TreePopupMenuPopup(Sender: TObject);
437     procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
438     var Cancel: WordBool);
439     procedure ListSplitterMoved(Sender: TObject);
440     procedure BrowserTabChange(Sender: TObject);
441     procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
442     Shift: TShiftState; X, Y: Integer);
443     procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer;
444     State: TDragState; var Accept: Boolean);
445     procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer);
446     procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X,
447     Y: Integer);
448     procedure BrowserDocumentComplete(Sender: TObject;
449     const pDisp: IDispatch; var URL: OleVariant);
450     procedure RoundNamePopupMenuPopup(Sender: TObject);
451     procedure FormShow(Sender: TObject);
452     procedure BrowserTabToolBarResize(Sender: TObject);
453     procedure FavoriteMenuClick(Sender: TObject);
454 yoffy 1.2 procedure MainCoolBarResize(Sender: TObject);
455     procedure AddressToolBarResize(Sender: TObject);
456 hi_ 1.1 procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
457     Shift: TShiftState);
458 yoffy 1.2 procedure BrowserEnter(Sender: TObject);
459 hi_ 1.1 procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
460     procedure PreviewTimerTimer(Sender: TObject);
461     procedure MessageHideButtonClick(Sender: TObject);
462 h677 1.541 procedure HistoryAllClearToolButtonClick(Sender: TObject);
463 yoffy 1.2 procedure MainCoolBarBandInfo(Sender: TObject;
464     var BandInfo: PReBarBandInfoA);
465     procedure MainCoolBarChevronClick(Sender: TObject;
466 yoffy 1.51 RebarChevron: PNMRebarChevron);
467     procedure ListCoolBarBandInfo(Sender: TObject;
468     var BandInfo: PReBarBandInfoA);
469     procedure ListCoolBarChevronClick(Sender: TObject;
470     RebarChevron: PNMRebarChevron);
471     procedure BrowserCoolBarBandInfo(Sender: TObject;
472     var BandInfo: PReBarBandInfoA);
473 yoffy 1.2 procedure BrowserCoolBarChevronClick(Sender: TObject;
474 yoffy 1.51 RebarChevron: PNMRebarChevron);
475     procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
476     procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
477     WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
478     procedure SelectComboBoxChange(Sender: TObject);
479     procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
480     Shift: TShiftState);
481     procedure SelectComboBoxExit(Sender: TObject);
482     procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
483     Shift: TShiftState; X, Y: Integer);
484     procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
485     Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
486     procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
487     Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
488     procedure StatusBarResize(Sender: TObject);
489     procedure SelectComboBoxEnter(Sender: TObject);
490 yoffy 1.100 procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
491     Y: Integer);
492 yoffy 1.71 procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
493 yoffy 1.100 procedure FavoriteTreeViewEdited(Sender: TObject; Node: TTreeNode;
494     var S: String);
495     procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
496     Shift: TShiftState);
497     procedure FavoriteTreePopupMenuPopup(Sender: TObject);
498     procedure FavoriteTreeViewDblClick(Sender: TObject);
499     procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer);
500     procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton;
501     Shift: TShiftState; X, Y: Integer);
502     procedure LinkToolBarDragOver(Sender, Source: TObject; X, Y: Integer;
503     State: TDragState; var Accept: Boolean);
504     procedure FavoriteTreeViewEndDrag(Sender, Target: TObject; X,
505     Y: Integer);
506     procedure ListCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
507     var Handled: Boolean);
508     procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
509     var Handled: Boolean);
510     procedure BrowserCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
511     var Handled: Boolean);
512 yoffy 1.142 procedure FavoriteTreeBrowseBoardPopupMenuClick(Sender: TObject);
513 h677 1.174 procedure BrowserTabContextPopup(Sender: TObject; MousePos: TPoint;
514     var Handled: Boolean);
515 h677 1.187 procedure BrowserTabPopupMenuPopup(Sender: TObject);
516 yoffy 1.216 procedure BrowserTabResize(Sender: TObject);
517 h677 1.318 procedure TreeViewClick(Sender: TObject);
518 yoffy 1.236 procedure TreeViewKeyDown(Sender: TObject; var Key: Word;
519     Shift: TShiftState);
520 yoffy 1.246 procedure FavoriteTreeViewMouseDown(Sender: TObject;
521 yoffy 1.248 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
522 yoffy 1.250 procedure MessagePanelResize(Sender: TObject);
523 yoffy 1.276 procedure OnResized;
524 h677 1.539 procedure SelectTimerTimer(Sender: TObject);
525 yoffy 1.425 procedure ListViewColumnRightClick(Sender: TObject;
526 yoffy 1.415 Column: TListColumn; Point: TPoint);
527 h677 1.478 procedure ListViewCustomDrawItem(Sender: TCustomListView;
528 h677 1.463 Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
529     procedure FormActivate(Sender: TObject);
530 h677 1.472 procedure BrowserPanelResize(Sender: TObject);
531 h677 1.482 procedure MenuToolBarResize(Sender: TObject);
532     procedure ListToolBarResize(Sender: TObject);
533     procedure BrowserToolBarResize(Sender: TObject);
534 h677 1.539 procedure KokoPopupMenuPopup(Sender: TObject);
535 h677 1.517 procedure ListViewKeyUp(Sender: TObject; var Key: Word;
536     Shift: TShiftState);
537     procedure FavoriteTreeViewEditing(Sender: TObject; Node: TTreeNode;
538     var AllowEdit: Boolean);
539 h677 1.570 procedure CabinetCloseSpeedButtonClick(Sender: TObject);
540 h677 1.541 procedure FavoriteArrangeToolButtonClick(Sender: TObject);
541 h677 1.542 procedure GikoApplicationEventsMessage(var Msg: tagMSG;
542     var Handled: Boolean);
543     procedure GikoApplicationEventsDeactivate(Sender: TObject);
544     procedure GikoApplicationEventsException(Sender: TObject; E: Exception);
545 h677 1.573 procedure TreeViewCollapsing(Sender: TObject; Node: TTreeNode;
546 h677 1.548 var AllowCollapse: Boolean);
547     procedure TreeViewExpanding(Sender: TObject; Node: TTreeNode;
548     var AllowExpansion: Boolean);
549     procedure TreeViewMouseUp(Sender: TObject; Button: TMouseButton;
550     Shift: TShiftState; X, Y: Integer);
551 h677 1.573 procedure FavoriteTreeViewStartDrag(Sender: TObject;
552     var DragObject: TDragObject);
553     procedure FavoriteTreeViewMouseMove(Sender: TObject;
554     Shift: TShiftState; X, Y: Integer);
555     procedure FavoriteTreeViewExit(Sender: TObject);
556 hi_ 1.1 private
557     { Private 鐃緒申鐃緒申 }
558     FEnabledCloseButton: Boolean;
559     FClickNode: TTreeNode;
560     FHttpState: Boolean;
561     FHint: TResPopup;
562 h677 1.453 FPreviewBrowser: TWebBrowser;
563 hi_ 1.1 FPreviewURL: string;
564     FBrowserSizeHeight: Integer;
565     FBrowserSizeWidth: Integer;
566     FTabHintIndex: Integer;
567     FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
568     FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?
569     FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?
570 h677 1.517 FActiveList: TObject;
571 h677 1.299 FActiveContent: TBrowserRecord; //
572 yoffy 1.133 FActiveBBS : TBBS;
573 hi_ 1.1 FHistoryList: TList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
574     FTreeType: TGikoTreeType;
575     FWorkCount: Integer;
576     FNameCookie: string;
577     FMailCookie: string;
578     FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
579     FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?
580     FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?
581 yoffy 1.51 IsDraggingSelectComboBox : Boolean;
582     DraggingSelectComboBoxPosition : TPoint;
583 yoffy 1.54 FSearchDialog: TSearchDialog;
584 yoffy 1.100 FDropSpaceNode: TTreeNode;
585 yoffy 1.424 FDragTime : Cardinal; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?
586     FDragButton : TToolButton; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?鐃緒申Drag鐃緒申鐃緒申鐃緒申Button鐃緒申鐃緒申
587     FDragWFirst : Boolean; ///< WebTab鐃緒申D&D鐃?
588     FListViewBackGroundColor : TColor; ///< ListView鐃緒申BackGroundColor
589     FUseOddResOddColor : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申
590     FOddColor : TColor; ///< 鐃緒申鐃緒申鐃?
591     FSelectResWord : string; ///< 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
592     FIsIgnoreResize : TResizeType; ///< 鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
593     FIsMinimize : TMinimizeType; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
594     FOldFormWidth : Integer; ///< 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
595     FToolBarSettingSender : TToolBarSettingSenderType; ///< 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
596     FMouseDownPos : TPoint; ///< 鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
597 h677 1.303 FBrowsers: TList;
598 yoffy 1.424 FResRangeMenuSelect : Longint; ///< ResRangeButton 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 (鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申 ResRange 鐃緒申鐃緒申)
599 h677 1.423 FStartUp : Boolean;
600 yoffy 1.427 FIsHandledWheel : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 WM_MOUSEWHEEL 鐃緒申鐃緒申鐃緒申鐃緒申
601 h677 1.517 DiffComp: Boolean; //Add by Genyakun 鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申True鐃緒申鐃緒申鐃緒申
602 h677 1.548 FOrigenCaption: String; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
603 h677 1.565 FPreviewBrowserRect: TRect; ///< 鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
604 hi_ 1.1 procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
605     procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
606 q9_ 1.233 procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
607 hi_ 1.1 procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
608     procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
609     procedure ListClick;
610 h677 1.295 procedure ListDoubleClick(Shift: TShiftState);
611 hi_ 1.1 function Hook(var Message: TMessage): Boolean;
612     procedure AddRoundNameMenu(MenuItem: TMenuItem);
613     procedure SetMenuFont;
614     procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
615 yoffy 1.62 procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;
616     procedure FavoriteClick(Sender: TObject); overload;
617 yoffy 1.100 procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
618 hi_ 1.1 function OnDocumentContextMenu(Sender: TObject): WordBool;
619     procedure ShowTextPopup;
620     function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
621 yoffy 1.2 procedure MenuBarChevronMenu;
622     procedure LinkBarChevronMenu;
623     procedure ToolBarChevronMenu(ToolBar: TToolBar);
624 yoffy 1.100 procedure LinkToolButtonDragDrop(Sender, Source: TObject; X, Y: Integer);
625     procedure LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
626     procedure LinkToolButtonOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
627     procedure LinkToolButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
628 yoffy 1.85 procedure LinkToolButtonStartDrag(Sender: TObject; var DragObject: TDragObject);
629 yoffy 1.72 function TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode;
630 yoffy 1.100 procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );
631     procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject );
632 yoffy 1.72 procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject );
633 yoffy 1.236 //
634 yoffy 1.143 procedure SetListViewBackGroundColor(value: TColor);
635 yoffy 1.123 procedure BBSMenuItemOnClick( Sender : TObject );
636 yoffy 1.424 /// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
637 yoffy 1.216 procedure SaveCoolBarSettings;
638 h677 1.471 procedure SaveMainCoolBarSettings;
639     procedure SaveBoardCoolBarSettings;
640     procedure SaveBrowserCoolBarSettings;
641 yoffy 1.424 /// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
642 yoffy 1.216 procedure LoadCoolBarSettings;
643 yoffy 1.424 /// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
644 yoffy 1.276 procedure OnMinimize;
645 yoffy 1.424 /// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
646 yoffy 1.248 procedure OnMinimized;
647 yoffy 1.424 /// TreeView 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
648 yoffy 1.236 procedure TreeClick( Node : TTreeNode );
649 yoffy 1.424 /// TreeView 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
650 yoffy 1.236 procedure TreeDoubleClick( Node : TTreeNode );
651 yoffy 1.424 /// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
652 yoffy 1.289 procedure SetBBSMenu;
653 yoffy 1.424 /// 鐃?鐃?鐃緒申鐃緒申
654 yoffy 1.397 function GetTabURLs(AStringList: TStringList) : Boolean;
655 yoffy 1.415 /// ListColumnPopupMenu 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
656     procedure ListColumnPopupMenuOnClick( Sender : TObject );
657 yoffy 1.480 //! 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
658     procedure SetSelectWord( const text : string );
659 h677 1.535 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
660     function GetScreenCursor(): TCursor;
661     //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
662     procedure SetScreenCursor(Cursor : TCursor);
663 h677 1.547 //! 鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
664     procedure InitActionChecked();
665 h677 1.550 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
666     procedure CreateControlThread();
667     //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
668     procedure CreateBrowsers(count: Integer);
669 hi_ 1.1 protected
670     procedure CreateParams(var Params: TCreateParams); override;
671 yoffy 1.2 procedure WndProc(var Message: TMessage); override;
672 hi_ 1.1 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
673     procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
674     procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
675 yoffy 1.216
676 hi_ 1.1 public
677     { Public 鐃緒申鐃緒申 }
678 h677 1.533 LastRoundTime: TDateTime;
679     BrowserNullTab: TBrowserRecord;
680 hi_ 1.1 FControlThread: TThreadControl;
681 yoffy 1.444 procedure MoveToURL(const inURL: string);
682 h677 1.530 function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
683 hi_ 1.1 procedure ReloadBBS;
684     function GetHttpState: Boolean;
685     procedure SetEnabledCloseButton(Enabled: Boolean);
686     function GetTreeNode(Data: TObject): TTreeNode;
687     procedure ListViewAllSelect;
688     property ListStyle: TViewStyle read FListStyle write FListStyle;
689     property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
690     property ViewType: TGikoViewType read FViewType write FViewType;
691     property NameCookie: string read FNameCookie write FNameCookie;
692     property MailCookie: string read FMailCookie write FMailCookie;
693 h677 1.532 property ClickNode: TTreeNode read FClickNode write FClickNode;
694 h677 1.538 property TreeType: TGikoTreeType read FTreeType write FTreeType;
695 h677 1.534 property ActiveContent: TBrowserRecord read FActiveContent write FActiveContent;
696 h677 1.533 property ResRangeMenuSelect: Longint read FResRangeMenuSelect write FResRangeMenuSelect;
697 h677 1.534 property SelectResWord : string read FSelectResWord write FSelectResWord;
698     property BrowserSizeWidth: Integer read FBrowserSizeWidth write FBrowserSizeWidth;
699     property BrowserSizeHeight: Integer read FBrowserSizeHeight write FBrowserSizeHeight;
700     property SearchDialog: TSearchDialog read FSearchDialog write FSearchDialog;
701     property ToolBarSettingSender : TToolBarSettingSenderType
702     read FToolBarSettingSender write FToolBarSettingSender;
703 h677 1.535 property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
704 h677 1.538 property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
705     property WorkCount: Integer read FWorkCount write FWorkCount;
706 h677 1.299 procedure SetContent(inThread: TBrowserRecord);
707 hi_ 1.1 function GetActiveContent: TThreadItem;
708     function GetActiveList: TObject;
709 h677 1.533
710 hi_ 1.1 procedure SetListViewType(AViewType: TGikoViewType); overload;
711     procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
712     procedure PlaySound(SoundEventName: string);
713 yoffy 1.136 function AddHistory( FavItem: TFavoriteThreadItem ): Boolean;
714 hi_ 1.1 procedure ClearHistory;
715 yoffy 1.135 procedure SaveHistory;
716     procedure LoadHistory;
717 yoffy 1.123 procedure ShowBBSTree( inBBS : TBBS );
718 yoffy 1.248 procedure ShowBBSTreeOld( inBBS : TBBS );
719 hi_ 1.1 procedure ShowHistoryTree;
720     procedure SetHistoryTreeNode;
721     procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
722     procedure SetBrowserTabState;
723 yoffy 1.2 procedure SetToolBarPopup;
724 yoffy 1.100 procedure ShowFavoriteAddDialog( Item : TObject );
725 h677 1.433 procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
726     procedure RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);
727 yoffy 1.143 property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
728     property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
729     property OddColor : TColor read FOddColor write FOddColor;
730 yoffy 1.209 function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
731 yoffy 1.218 procedure OnPlugInMenuItem( Sender : TObject );
732 h677 1.433 procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
733     /// ListView 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申 KuroutSetting鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
734     procedure ActiveListColumnSave;
735     procedure SetActiveList(Obj: TObject);
736     property ActiveList: TObject read GetActiveList write SetActiveList;
737 h677 1.482 /// CoolBar 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
738     procedure CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
739 h677 1.485 //鐃緒申鐃緒申ID鐃緒申鐃緒申鐃緒申鐃?鐃緒申
740     procedure IndividualAbonID(Atype : Integer);
741     //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申
742     procedure IndividualAbon(Atag, Atype : Integer);
743 h677 1.532 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申 true:鐃?鐃緒申鐃緒申鐃?鐃? false:鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
744     procedure RepaintAllTabsBrowser();
745     //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
746     procedure SetLinkBar;
747     procedure FavoriteBrowseFolder( node: TTreeNode );
748     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
749     procedure DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False);
750     //鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
751     procedure DownloadList(Board: TBoard; ForceDownload: Boolean = False);
752     //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
753     procedure DeleteHistory( threadItem: TThreadItem );
754     //鐃?鐃?鐃緒申鐃緒申鐃緒申
755     procedure DeleteTab(ThreadItem: TThreadItem); overload;
756 h677 1.533 procedure DeleteTab(BrowserRecord: TBrowserRecord); overload;
757     //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
758 h677 1.552 procedure BrowserMovement(const AName: string);
759 h677 1.533 //Application鐃緒申MainForm鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
760 h677 1.534 function GetMainForm(): TComponent;
761 h677 1.533 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
762 h677 1.534 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?
763     procedure OnGestureStart(Sender: TObject);
764     //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申
765     procedure OnGestureMove(Sender: TObject);
766     //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
767     procedure OnGestureEnd(Sender: TObject);
768     /// 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
769     procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
770 h677 1.535 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃緒申
771     function EditorFormExists(): boolean;
772     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
773     procedure AllEditroFormNameTextClearClear();
774     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
775     procedure AllEditroFormMailTextClearClear();
776     //ListView鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
777     procedure SelectListItem(List: TList);
778     /// 鐃?鐃?鐃緒申鐃緒申
779     function SaveTabURLs : Boolean;
780     /// 鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申
781     function LoadTabURLs : Boolean;
782 h677 1.536 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
783     procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
784 h677 1.537 //
785     procedure ModifySelectList;
786     //
787     procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;
788     //
789     procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
790 h677 1.538 //
791 h677 1.537 procedure SetSelectRoundName(Sender: TObject);
792 h677 1.538 //
793     function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
794     //
795     function WebBrowserClick(Sender: TObject): WordBool;
796 h677 1.550 //! 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
797     procedure SetSelectComboBox();
798 hi_ 1.1 published
799     property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
800     end;
801    
802     TFavoriteMenuItem = class(TMenuItem)
803     private
804     FData : Pointer;
805     public
806     property Data: Pointer read FData write FData;
807     end;
808    
809 yoffy 1.123 TBBSMenuItem = class(TMenuItem)
810     private
811     FData : Pointer;
812     public
813     property Data: Pointer read FData write FData;
814     end;
815    
816 hi_ 1.1 TLinkToolButton = class(TToolButton)
817     private
818     FData : Pointer;
819     public
820     property Data: Pointer read FData write FData;
821     end;
822    
823     var
824     GikoForm: TGikoForm;
825    
826     implementation
827    
828     uses
829 h677 1.536 GikoUtil, IndividualAbon, Math, Kotehan, KeySetting,
830     YofUtils, ShellAPI, ToolBarUtil, ToolBarSetting,
831     GikoXMLDoc, RoundName, IniFiles, FavoriteAdd,
832 h677 1.542 FavoriteArrange, AddressHistory, Preview, Gesture,
833 yoffy 1.480 About, Option, Round, Splash, Sort, ListSelect, Imm,
834 h677 1.521 NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter,
835 h677 1.562 HTMLCreate, ListViewUtils, GikoDataModule, GikoMessage;
836 hi_ 1.1
837     const
838     BLANK_HTML: string = 'about:blank';
839 h677 1.542 BROWSER_COUNT = 5; //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
840     //D&D鐃緒申鐃?
841     DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel)
842     //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
843     HTML_FILE_NAME = 'temp_preview.html';
844     ITEM_ICON_THREADLOG1 = 6; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
845     ITEM_ICON_THREADLOG2 = 7; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
846     //鐃緒申鐃?鐃?鐃?鐃?ID
847 yoffy 1.278 USER_TREECLICK = WM_USER + 2000;
848     USER_RESIZED = WM_USER + 2001;
849     USER_MINIMIZED = WM_USER + 2002;
850     USER_SETLINKBAR = WM_USER + 2003;
851 yoffy 1.434 USER_DOCUMENTCOMPLETE = WM_USER + 2004; ///< wParam : TWebBrowser
852 hi_ 1.1 {$R *.DFM}
853    
854     procedure TGikoForm.CreateParams(var Params: TCreateParams);
855     begin
856     inherited;
857     if FormStyle in [fsNormal, fsStayOnTop] then begin
858     if BorderStyle in [bsSingle, bsSizeable] then begin
859     Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
860     Params.WndParent := 0;
861     end;
862     end;
863     end;
864    
865     procedure TGikoForm.FormCreate(Sender: TObject);
866     const
867     TVS_NOTOOLTIPS = $0080;
868     var
869     FileName: string;
870     Style: DWORD;
871     msg: string;
872     i: Integer;
873     wp: TWindowPlacement;
874     begin
875     {$IFDEF DEBUG}
876     AllocConsole;
877     Writeln('============================================================');
878     Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
879     Writeln('');
880     Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
881     Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
882     Writeln('============================================================');
883     {$ENDIF}
884 h677 1.514 FTreeType := gttNone;
885     // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
886 h677 1.471 FStartUp := true;
887 hi_ 1.1 Application.HookMainWindow(Hook);
888 h677 1.514 FIsIgnoreResize := rtResizing;
889 hi_ 1.1
890 yoffy 1.51 FSearchDialog := nil;
891 h677 1.550 CreateBrowsers(BROWSER_COUNT);
892 h677 1.303
893 h677 1.514 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
894     SetMenuFont;
895 yoffy 1.216
896 hi_ 1.1 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
897     Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
898    
899     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
900 h677 1.513 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
901 hi_ 1.1
902     EnabledCloseButton := True;
903 h677 1.176
904 hi_ 1.1 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
905     ListView.ViewStyle := GikoSys.Setting.ListStyle;
906    
907     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
908     AnimePanel.Top := 0;
909     AnimePanel.Left := 0;
910    
911     //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
912    
913     //鐃?鐃緒申鐃?鐃?鐃?鐃?
914     CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
915    
916     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
917 h677 1.539 GikoDM.MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
918     GikoDM.MsgBarVisibleActionExecute(nil);
919 hi_ 1.1 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
920    
921     //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
922 h677 1.539 GikoDM.StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
923     GikoDM.StatusBarVisibleActionExecute(nil);
924 hi_ 1.1
925     //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
926     TreeView.Items.BeginUpdate;
927 yoffy 1.100 FavoriteTreeView.Items.BeginUpdate;
928 hi_ 1.1 ListView.Items.BeginUpdate;
929     try
930     TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
931     TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
932     TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
933     TreeView.Color := GikoSys.Setting.CabinetBackColor;
934 h677 1.473 FavoriteTreeView.Font.Assign(TreeView.Font);
935 yoffy 1.67 FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
936    
937 hi_ 1.1 ListView.Font.Name := GikoSys.Setting.ListFontName;
938     ListView.Font.Size := GikoSys.Setting.ListFontSize;
939     ListView.Font.Color := GikoSys.Setting.ListFontColor;
940 h677 1.473 ListView.Font.Style := [];
941     if GikoSys.Setting.ListFontBold then
942     ListView.Font.Style := [fsbold];
943     if GikoSys.Setting.ListFontItalic then
944     ListView.Font.Style := ListView.Font.Style + [fsitalic];
945    
946 yoffy 1.418 ListViewBackGroundColor := clWhite; // 鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
947     ListViewBackGroundColor := GikoSys.Setting.ListBackColor; // 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
948 yoffy 1.236 FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
949     FOddColor := GikoSys.Setting.OddColor;
950 h677 1.109
951 hi_ 1.1 finally
952     TreeView.Items.EndUpdate;
953 yoffy 1.100 FavoriteTreeView.Items.EndUpdate;
954 hi_ 1.1 ListView.Items.EndUpdate;
955     end;
956     //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
957 h677 1.539 GikoDM.ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
958 hi_ 1.1
959     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
960     BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
961     BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
962 h677 1.473 BrowserTab.Font.Style := [];
963     if GikoSys.Setting.BrowserTabFontBold then
964     BrowserTab.Font.Style := [fsBold];
965     if GikoSys.Setting.BrowserTabFontItalic then
966     BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic];
967 yoffy 1.133 FDragWFirst := false;
968 h677 1.299 SetContent(BrowserNullTab); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
969    
970 h677 1.514 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
971     ProgressBar.Parent := StatusBar;
972     ProgressBar.Top := 2;
973     ProgressBar.Left := 0;
974     ProgressBar.Width := StatusBar.Panels[0].Width;
975     ProgressBar.Height := StatusBar.Height - 2;
976     ProgressBar.Position := 0;
977    
978     // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
979     InitializeBoardPlugIns;
980    
981     // 鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申(ReadFavorite 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
982     GikoSys.ListBoardFile;
983    
984     // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
985     SplashWindow.ProgressBar.Max := Length(BBSs) * 20;
986    
987     // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
988     for i := Length(BBSs) - 1 downto 0 do begin
989     if not BBSs[i].IsBoardFileRead then
990     GikoSys.ReadBoardFile(BBSs[i]);
991    
992     if SplashWindow <> nil then begin
993     SplashWindow.ProgressBar.StepBy(20);
994     SplashWindow.Update;
995     end;
996     end;
997     //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
998     RoundList := TRoundList.Create;
999     RoundList.LoadRoundBoardFile;
1000     RoundList.LoadRoundThreadFile;
1001    
1002     //TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申
1003     Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
1004     Style := Style or TVS_NOTOOLTIPS;
1005     SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
1006    
1007     // 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1008     TreeView.Align := alClient;
1009     FavoriteTreeView.Align := alClient;
1010     FavoriteTreeView.Visible := False;
1011    
1012     // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1013     SetBBSMenu;
1014 hi_ 1.1
1015     //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1016     wp.length := sizeof(wp);
1017     wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1018     wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1019     wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1020     wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1021     wp.showCmd := SW_HIDE;
1022     SetWindowPlacement(Handle, @wp);
1023 h677 1.514 //Self.Update;
1024 hi_ 1.1
1025     if GikoSys.Setting.WindowMax then
1026 h677 1.514 WindowState := wsMaximized;
1027 hi_ 1.1
1028     //鐃?鐃?鐃?鐃?鐃緒申
1029     try
1030     FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1031     if FileExists(FileName) then
1032     Animate.FileName := FileName;
1033     except
1034     end;
1035    
1036     //鐃?鐃?鐃?鐃?
1037     FNameCookie := '';
1038     FMailCookie := '';
1039    
1040     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1041     FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1042     FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1043    
1044 yoffy 1.420
1045     // 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?(LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1046     FHistoryList := TList.Create;
1047    
1048     // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1049     LoadHistory;
1050    
1051     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1052     FavoriteDM.SetFavTreeView(FavoriteTreeView);
1053     FavoriteDM.ReadFavorite;
1054    
1055 h677 1.539 GikoDM.ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1056     GikoDM.ArrangeAction.Execute;
1057 hi_ 1.1
1058     if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1059     case GikoSys.Setting.ListWidthState of
1060     glsMax: begin
1061     ViewPanel.Width := 1;
1062 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1063     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1064 hi_ 1.1 end;
1065     glsMin: begin
1066     ViewPanel.Width := GikoSys.Setting.ListWidth;
1067 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1068     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1069 hi_ 1.1 end;
1070     else begin
1071     ViewPanel.Width := GikoSys.Setting.ListWidth;
1072 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1073     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1074 hi_ 1.1 end;
1075     end;
1076     end else begin
1077     case GikoSys.Setting.ListHeightState of
1078     glsMax: begin
1079     ViewPanel.Height := 1;
1080 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1081     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1082 hi_ 1.1 end;
1083     glsMin: begin
1084     ViewPanel.Height := GikoSys.Setting.ListHeight;
1085 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1086     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1087 hi_ 1.1 end;
1088     else begin
1089     ViewPanel.Height := GikoSys.Setting.ListHeight;
1090 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1091     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1092 hi_ 1.1 end;
1093     end;
1094     end;
1095    
1096     //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1097 h677 1.550 CreateControlThread();
1098 hi_ 1.1
1099 yoffy 1.51 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1100     SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1101 yoffy 1.2
1102 hi_ 1.1 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1103     SetBrowserTabState;
1104    
1105     BrowserBoardNameLabel.Caption := '';
1106     BrowserNameLabel.Caption := '';
1107     FWorkCount := 0;
1108    
1109     FTabHintIndex := -1;
1110    
1111     //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1112     ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1113     BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1114    
1115 yoffy 1.236 MakeDefaultINIFile();
1116 yoffy 1.2 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1117 h677 1.539 ReadToolBarSetting(GikoDM.GikoFormActionList, StdToolBar);
1118     ReadToolBarSetting(GikoDM.GikoFormActionList, ListToolBar);
1119     ReadToolBarSetting(GikoDM.GikoFormActionList, BrowserToolBar);
1120 yoffy 1.2 SetToolBarPopup;
1121 yoffy 1.375
1122 h677 1.517 //ListToolBar鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申ComboBox鐃緒申鐃?鐃?
1123 h677 1.550 SetSelectComboBox();
1124 h677 1.514
1125     //鐃?鐃?鐃緒申鐃?鐃?鐃?
1126     AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1127    
1128     //鐃緒申鐃緒申鐃?鐃?鐃?
1129     SetLinkBar;
1130 yoffy 1.2 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1131    
1132     //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1133     if not FileExists(GikoSys.GetBoardFileName) then begin
1134     msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1135     + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1136     + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1137     MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1138 h677 1.539 GikoDM.NewBoardAction.Execute;
1139 yoffy 1.2 end;
1140    
1141     //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1142 h677 1.560 GikoSys.LoadKeySetting(GikoDM.GikoFormActionList, GikoSys.GetMainKeyFileName);
1143 yoffy 1.2
1144     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1145     // FLastRoundTime := 0;
1146    
1147     //ResHint
1148     FHint := TResPopup.Create(Self);
1149    
1150 h677 1.547 ListView.OnData := TListViewUtils.ListViewData;
1151 h677 1.529
1152 yoffy 1.100 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1153 h677 1.299 CabinetVisible( False );
1154 yoffy 1.141 if GikoSys.Setting.CabinetVisible then begin
1155     i := CabinetSelectPopupMenu.Items.Count - 1;
1156     if GikoSys.Setting.CabinetIndex = i - 1 then
1157 h677 1.539 GikoDM.CabinetHistoryAction.Execute
1158 yoffy 1.141 else if GikoSys.Setting.CabinetIndex = i then
1159 h677 1.539 GikoDM.CabinetFavoriteAction.Execute
1160 yoffy 1.141 else begin
1161     if GikoSys.Setting.CabinetIndex < Length( BBSs ) then
1162     ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] );
1163 yoffy 1.265 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 2
1164 yoffy 1.424 FIsIgnoreResize := rtResizing;
1165 h677 1.539 GikoDM.CabinetBBSAction.Execute;
1166 yoffy 1.141 end;
1167     end else begin
1168 yoffy 1.248 ShowBBSTreeOld( BBSs[ 0 ] );
1169     PostMessage( Handle, USER_TREECLICK, 0, 0 );
1170 yoffy 1.141 end;
1171 yoffy 1.67
1172 yoffy 1.2 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1173     for i := 1 to ParamCount do begin
1174     MoveToURL(ParamStr(i));
1175     end;
1176 h677 1.22
1177 h677 1.567 GikoDM.RepaintStatusBar;
1178 hi_ 1.32 StatusBarResize(Sender);
1179 h677 1.187
1180 yoffy 1.236 dummy1.Caption := ItemReservPMenu.Caption;
1181     dummy1.Hint := ItemReservPMenu.Hint;
1182 yoffy 1.216
1183 yoffy 1.236 //Samba24鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?
1184     GikoSys.SambaFileExists();
1185 h677 1.299
1186 yoffy 1.500 {$IFDEF SPAM_FILTER_ENABLED}
1187 yoffy 1.468 // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1188     GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
1189 yoffy 1.500 {$ENDIF}
1190 yoffy 1.468
1191 yoffy 1.456 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1192     MouseGesture := TMouseGesture.Create;
1193     GikoSys.Setting.Gestures.LoadGesture(
1194 h677 1.539 GikoSys.Setting.GetGestureFileName, GikoDM.GikoFormActionList );
1195 yoffy 1.456 MouseGesture.Margin := GikoSys.Setting.Gestures.Margin;
1196     MouseGesture.OnGestureStart := OnGestureStart;
1197     MouseGesture.OnGestureMove := OnGestureMove;
1198     MouseGesture.OnGestureEnd := OnGestureEnd;
1199 yoffy 1.457 if GikoSys.Setting.GestureEnabled then
1200     MouseGesture.SetHook( Handle );
1201 genyakun 1.458
1202 h677 1.483 //2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1203 h677 1.562 GikoSys.SetGikoMessage;
1204 h677 1.514
1205 genyakun 1.497 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1206     if GikoSys.Setting.AutoLogin then
1207 h677 1.539 GikoDM.LoginAction.Execute;
1208 genyakun 1.497
1209 h677 1.514 GikoSys.Setting.BeLogin := GikoSys.Setting.BeAutoLogin;
1210 h677 1.541
1211     //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1212     FavoriteAddToolButton.Caption := '鐃緒申鐃緒申...';
1213 h677 1.547 AntiIndivAbonMenuItem.Caption := '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申';
1214 h677 1.541
1215 h677 1.573
1216 yoffy 1.2 end;
1217    
1218 yoffy 1.216 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1219     procedure TGikoForm.SaveCoolBarSettings;
1220 yoffy 1.2 begin
1221    
1222 yoffy 1.424 if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then
1223 yoffy 1.216 Exit;
1224 h677 1.471 SaveMainCoolBarSettings;
1225     SaveBoardCoolBarSettings;
1226     SaveBrowserCoolBarSettings;
1227 yoffy 1.2
1228 h677 1.471 end;
1229     procedure TGikoForm.SaveMainCoolBarSettings;
1230     var
1231     i : Integer;
1232     CoolSet : TCoolSet;
1233     begin
1234 yoffy 1.216 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1235     for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1236     CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1237     CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1238     CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1239     GikoSys.Setting.MainCoolSet[i] := CoolSet;
1240     end;
1241 h677 1.471 end;
1242     procedure TGikoForm.SaveBoardCoolBarSettings;
1243     var
1244     i : Integer;
1245     CoolSet : TCoolSet;
1246     begin
1247 yoffy 1.216 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1248     for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1249     CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1250     CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1251     CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1252     GikoSys.Setting.ListCoolSet[i] := CoolSet;
1253     end;
1254 h677 1.471 end;
1255     procedure TGikoForm.SaveBrowserCoolBarSettings;
1256     var
1257     i : Integer;
1258     CoolSet : TCoolSet;
1259     begin
1260 yoffy 1.216 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1261     for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1262     CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1263     CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1264     CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1265     GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1266 yoffy 1.2 end;
1267 yoffy 1.216 end;
1268     // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1269     procedure TGikoForm.LoadCoolBarSettings;
1270     var
1271     i : Integer;
1272     CoolSet : TCoolSet;
1273     begin
1274 yoffy 1.2
1275 hi_ 1.1 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1276     MainCoolBar.Bands.BeginUpdate;
1277     try
1278 yoffy 1.216 // for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1279     for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin
1280 hi_ 1.1 CoolSet := GikoSys.Setting.MainCoolSet[i];
1281 yoffy 1.263 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1282 yoffy 1.424 FIsIgnoreResize := rtNone;
1283 yoffy 1.263 SaveCoolBarSettings;
1284     Exit;
1285     end;
1286 hi_ 1.1 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1287     MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1288 yoffy 1.264 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1289 hi_ 1.1 end;
1290     finally
1291     MainCoolBar.Bands.EndUpdate;
1292     end;
1293    
1294     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1295     ListCoolBar.Bands.BeginUpdate;
1296     try
1297 yoffy 1.216 // for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1298     for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin
1299 hi_ 1.1 CoolSet := GikoSys.Setting.ListCoolSet[i];
1300 yoffy 1.263 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1301 yoffy 1.424 FIsIgnoreResize := rtNone;
1302 yoffy 1.263 SaveCoolBarSettings;
1303     Exit;
1304     end;
1305 hi_ 1.1 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1306     ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1307     ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1308     end;
1309     finally
1310     ListCoolBar.Bands.EndUpdate;
1311     end;
1312    
1313     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1314     BrowserCoolBar.Bands.BeginUpdate;
1315     try
1316 yoffy 1.216 // for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1317 h677 1.514 for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
1318 hi_ 1.1 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1319 yoffy 1.263 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1320 yoffy 1.424 FIsIgnoreResize := rtNone;
1321 yoffy 1.263 SaveCoolBarSettings;
1322     Exit;
1323     end;
1324 hi_ 1.1 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1325     BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1326     BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1327     end;
1328     finally
1329     BrowserCoolBar.Bands.EndUpdate;
1330     end;
1331    
1332     end;
1333 yoffy 1.216 //
1334     procedure TGikoForm.FormShow(Sender: TObject);
1335     begin
1336 h677 1.471 if FStartUp then begin
1337 h677 1.423 ShowWindow(Application.Handle, SW_HIDE);
1338    
1339     //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1340     //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1341 h677 1.539 GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1342     GikoDM.StdToolBarVisibleActionExecute( nil );
1343     GikoDM.AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1344     GikoDM.AddressBarVisibleActionExecute( nil );
1345     GikoDM.LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1346     GikoDM.LinkBarVisibleActionExecute( nil );
1347     GikoDM.ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1348     GikoDM.ListToolBarVisibleActionExecute( nil );
1349     GikoDM.ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1350     GikoDM.ListNameBarVisibleActionExecute( nil );
1351     GikoDM.BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1352     GikoDM.BrowserToolBarVisibleActionExecute( nil );
1353     GikoDM.BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1354     GikoDM.BrowserNameBarVisibleActionExecute( nil );
1355 h677 1.423
1356     //鐃?鐃緒申鐃?鐃?鐃?鐃?
1357 h677 1.539 GikoDM.BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1358     GikoDM.BrowserTabVisibleActionExecute(nil);
1359 yoffy 1.216
1360 h677 1.423 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1361 h677 1.539 GikoDM.BrowserTabTopAction.Checked := True;
1362     GikoDM.BrowserTabTopActionExecute(nil);
1363 h677 1.423 end else begin
1364 h677 1.539 GikoDM.BrowserTabBottomAction.Checked := True;
1365     GikoDM.BrowserTabBottomActionExecute(nil);
1366 h677 1.423 end;
1367    
1368     if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1369 h677 1.539 GikoDM.BrowserTabTabStyleAction.Checked := True;
1370     GikoDM.BrowserTabTabStyleActionExecute(nil);
1371 h677 1.423 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1372 h677 1.539 GikoDM.BrowserTabButtonStyleAction.Checked := True;
1373     GikoDM.BrowserTabButtonStyleActionExecute(nil);
1374 h677 1.423 end else begin
1375 h677 1.539 GikoDM.BrowserTabFlatStyleAction.Checked := True;
1376     GikoDM.BrowserTabFlatStyleActionExecute(nil);
1377 h677 1.423 end;
1378 yoffy 1.216
1379 h677 1.423 // ListView 鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?
1380 yoffy 1.425 // ListView.FullDrag := True;
1381 yoffy 1.408
1382 h677 1.423 // CoolBar 鐃緒申鐃緒申
1383     LoadCoolBarSettings;
1384 yoffy 1.265
1385 h677 1.514 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1386 h677 1.517 // ResetBandInfo( ListCoolBar, ListToolBar );
1387 yoffy 1.424 FIsIgnoreResize := rtNone;
1388 h677 1.547 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1389     //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1390     InitActionChecked();
1391 genyakun 1.382
1392 h677 1.423 //FormCrete鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1393     if GikoSys.Setting.TabAutoLoadSave then begin
1394 h677 1.539 GikoDM.TabAutoLoadAction.Execute;
1395 h677 1.423 end;
1396 h677 1.547 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1397     if GikoSys.Setting.GengoSupport then begin
1398     //鐃?鐃緒申鐃?
1399     //Test鐃緒申鐃緒申
1400     end;
1401    
1402 h677 1.471 FStartUp := false;
1403 yoffy 1.397 end;
1404 yoffy 1.239 end;
1405 yoffy 1.216
1406 hi_ 1.1 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1407     begin
1408 yoffy 1.331 // if GikoForm.WindowState <> wsMinimized then
1409     // SaveCoolBarSettings;
1410 yoffy 1.236 if ( GikoSys.Setting.ShowDialogForEnd ) and
1411     (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1412     CanClose := false;
1413     Exit;
1414     end else begin
1415     CanClose := True;
1416 yoffy 1.398 if GikoSys.Setting.TabAutoLoadSave then begin
1417 h677 1.539 GikoDM.TabAutoSaveAction.Execute;
1418 yoffy 1.398 end;
1419 yoffy 1.236 end;
1420 h677 1.498 { //2ch鐃緒申鐃緒申鐃緒申鐃緒申Free
1421 h677 1.462 if GikoSys.Setting.Gengo <> nil then begin
1422     GikoSys.Setting.Gengo.Free;
1423 genyakun 1.458 end;
1424 h677 1.498 }
1425 h677 1.241 Application.UnhookMainWindow(Hook);
1426     Application.Terminate;
1427     end;
1428    
1429     procedure TGikoForm.FormDestroy(Sender: TObject);
1430     var
1431 yoffy 1.376 i : Integer;
1432 h677 1.241 // CoolSet: TCoolSet;
1433 yoffy 1.376 wp : TWindowPlacement;
1434     tmpBool : Boolean;
1435 h677 1.241 begin
1436 yoffy 1.460 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1437 yoffy 1.456 try
1438     MouseGesture.UnHook;
1439     except
1440     end;
1441 yoffy 1.236 try
1442 yoffy 1.410 ActiveListColumnSave;
1443 yoffy 1.236 except
1444     end;
1445     try
1446 h677 1.234 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1447     wp.length := sizeof(wp);
1448     GetWindowPlacement(Handle, @wp);
1449     GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1450     GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1451     GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1452     GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1453     GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1454    
1455     GikoSys.Setting.ListStyle := ListView.ViewStyle;
1456 h677 1.539 GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked;
1457 h677 1.234 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1458     GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1459     GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1460 h677 1.539 if GikoDM.ArrangeAction.Checked then
1461 h677 1.234 GikoSys.Setting.ListOrientation := gloVertical
1462     else
1463     GikoSys.Setting.ListOrientation := gloHorizontal;
1464     GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1465 yoffy 1.236 except
1466 yoffy 1.2 end;
1467 yoffy 1.378
1468     try
1469     // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1470     if not GikoSys.Setting.ResRangeHold then
1471 yoffy 1.380 GikoSys.Setting.ResRange := FResRangeMenuSelect;
1472 yoffy 1.378 except
1473     end;
1474 h677 1.483 if WindowState <> wsNormal then
1475     WindowState := wsNormal;
1476     SaveCoolBarSettings;
1477     try
1478     GikoSys.Setting.WriteWindowSettingFile;
1479     GikoSys.Setting.WriteNameMailSettingFile;
1480     except
1481     end;
1482 yoffy 1.378 // 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申 CoolBar 鐃緒申鐃緒申
1483 yoffy 1.216 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1484 h677 1.482
1485 yoffy 1.263 // 鐃緒申FormDestroy鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?2004/04/09鐃?
1486 yoffy 1.216 // CoolBar 鐃緒申鐃緒申
1487 h677 1.482 //if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then
1488 h677 1.483
1489 yoffy 1.2
1490     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1491 hi_ 1.1 try
1492 yoffy 1.236 //FavoriteDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1493 yoffy 1.2 FavoriteDM.WriteFavorite;
1494 yoffy 1.236 FavoriteDM.Clear;
1495 hi_ 1.1 except
1496     end;
1497 h677 1.483 LockWindowUpdate(Self.Handle);
1498 hi_ 1.1 try
1499     //鐃?鐃?鐃?鐃緒申鐃?鐃?
1500 h677 1.321 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1501     GikoSys.Setting.ShowDialogForAllTabClose := false;
1502 h677 1.539 GikoDM.AllTabCloseAction.Execute;
1503 h677 1.483 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1504 h677 1.299 except
1505     end;
1506 h677 1.321 try
1507     for i := FBrowsers.Count - 1 downto 0 do begin
1508     TWebBrowser(FBrowsers[i]).Free;
1509     end;
1510     FBrowsers.Clear;
1511     FBrowsers.Capacity := 0;
1512     finally
1513     FBrowsers.Free;
1514 h677 1.303 end;
1515 h677 1.299 try
1516     if BrowserNullTab <> nil then begin
1517     BrowserNullTab.Browser := nil; {*BrowserNullTab鐃緒申Browser鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
1518     *鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Free鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1519     *}
1520     BrowserNullTab.Free;
1521 hi_ 1.1 end;
1522     except
1523     end;
1524 h677 1.483
1525 h677 1.224 try
1526 yoffy 1.236 TreeView.Items.BeginUpdate;
1527 yoffy 1.380 TreeView.Items.GetFirstNode.Free;
1528 yoffy 1.236 TreeView.Items.Clear;
1529     TreeView.Items.EndUpdate;
1530 h677 1.224 except
1531     end;
1532 h677 1.230
1533 hi_ 1.1 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1534     try
1535 yoffy 1.236 //AddressHistoryDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1536 h677 1.513 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
1537 hi_ 1.1 except
1538     end;
1539    
1540 h677 1.234 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1541 hi_ 1.1 try
1542 h677 1.234 SaveHistory;
1543 hi_ 1.1 except
1544     end;
1545 yoffy 1.236 try
1546     try
1547     ClearHistory;
1548     except
1549     end;
1550     finally
1551     FHistoryList.Free;
1552     end;
1553 h677 1.221
1554 h677 1.182 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1555     try
1556     RoundList.SaveRoundFile;
1557     except
1558     end;
1559 yoffy 1.236 try
1560 h677 1.234 try
1561 yoffy 1.236 RoundList.Clear;
1562 h677 1.234 except
1563     end;
1564 yoffy 1.236 finally
1565     RoundList.Free;
1566     end;
1567 h677 1.182
1568 yoffy 1.236 try
1569 h677 1.234 try
1570     FControlThread.Terminate;
1571 yoffy 1.236 FControlThread.WaitFor;
1572 h677 1.234 except
1573 h677 1.219 end;
1574 yoffy 1.236 finally
1575     FControlThread.Free;
1576     end;
1577 h677 1.230
1578 yoffy 1.155 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1579     // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1580     // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1581 h677 1.550 for i := Length(BoardGroups) - 1 downto 0 do begin
1582 h677 1.517 //BoardGroups[i].Clear;
1583     BoardGroups[i].Free;
1584 h677 1.550 end;
1585 h677 1.514
1586 yoffy 1.126 try
1587 h677 1.220 for i := Length( BBSs ) - 1 downto 0 do begin
1588 h677 1.153 if BBSs[ i ] <> nil then
1589     BBSs[ i ].Free;
1590     BBSs[ i ] := nil;
1591     end;
1592     except
1593     end;
1594 yoffy 1.155
1595 h677 1.234 try
1596 yoffy 1.236 if FEvent <> nil then
1597     FEvent.Free;
1598 h677 1.181
1599 yoffy 1.2 //Hint鐃?鐃緒申
1600     if FHint <> nil then begin
1601     FHint.ReleaseHandle;
1602     FHint.Free;
1603     FHint := nil;
1604     end;
1605     //Preview鐃?鐃緒申
1606     if TPreviewBrowser <> nil then begin
1607     FPreviewBrowser.Free;
1608     FPreviewBrowser := nil;
1609     end;
1610     except
1611     end;
1612 h677 1.550 LockWindowUpdate(0);
1613 hi_ 1.1 end;
1614    
1615 yoffy 1.289 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1616     procedure TGikoForm.SetBBSMenu;
1617 yoffy 1.123 var
1618     i : Integer;
1619 yoffy 1.149 item : TBBSMenuItem;
1620 hi_ 1.1 begin
1621    
1622 yoffy 1.148 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1623     for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1624     try
1625     if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1626 yoffy 1.155 CabinetSelectPopupMenu.Items[ i ].Free;
1627     CabinetMenu.Items[ i ].Free;
1628 yoffy 1.289 BBSSelectPopupMenu.Items[ i ].Free;
1629 yoffy 1.148 end;
1630     except
1631     end;
1632     end;
1633 yoffy 1.289
1634     // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1635 yoffy 1.148 for i := Length( BBSs ) - 1 downto 0 do begin
1636     try
1637     item := TBBSMenuItem.Create( PopupMenu );
1638     item.Caption := BBSs[ i ].Title;
1639     item.Data := BBSs[ i ];
1640     item.OnClick := BBSMenuItemOnClick;
1641     CabinetSelectPopupMenu.Items.Insert( 0, item );
1642     item := TBBSMenuItem.Create( PopupMenu );
1643     item.Caption := BBSs[ i ].Title;
1644     item.Data := BBSs[ i ];
1645     item.OnClick := BBSMenuItemOnClick;
1646     CabinetMenu.Insert( 0, item );
1647 yoffy 1.289 item := TBBSMenuItem.Create( PopupMenu );
1648     item.Caption := BBSs[ i ].Title;
1649     item.Data := BBSs[ i ];
1650     item.OnClick := BBSMenuItemOnClick;
1651     BBSSelectPopupMenu.Items.Insert( 0, Item );
1652 yoffy 1.148 except
1653     end;
1654     end;
1655 yoffy 1.289
1656     end;
1657    
1658     procedure TGikoForm.ReloadBBS;
1659     var
1660     i : Integer;
1661 h677 1.321 tmpBool: Boolean;
1662 yoffy 1.289 begin
1663 h677 1.517 LockWindowUpdate(Self.Handle);
1664    
1665 yoffy 1.289 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1666 h677 1.321 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1667     GikoSys.Setting.ShowDialogForAllTabClose := false;
1668 h677 1.539 GikoDM.AllTabCloseAction.Execute;
1669 h677 1.321 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1670 h677 1.320 SetContent(BrowserNullTab);
1671 yoffy 1.289 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1672     TreeView.Items.Clear;
1673    
1674 h677 1.515 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1675     try
1676     RoundList.SaveRoundFile;
1677     except
1678     end;
1679     //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1680     try
1681     RoundList.Clear;
1682     except
1683     end;
1684    
1685     //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1686 h677 1.517 try
1687     SaveHistory;
1688     ClearHistory;
1689     except
1690     end;
1691 h677 1.515
1692     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1693 h677 1.517 try
1694     FavoriteDM.WriteFavorite;
1695     FavoriteDM.Clear;
1696     except
1697     end;
1698 h677 1.515
1699 h677 1.516 //鐃緒申鐃?鐃?鐃緒申鐃?PLUGIN鐃緒申鐃?鐃緒申
1700     for i := Length(BoardGroups) - 1 downto 0 do begin
1701 h677 1.517 try
1702     BoardGroups[i].Free;
1703     except
1704     end;
1705 h677 1.516 end;
1706 yoffy 1.289 //BBS鐃?鐃緒申
1707     try
1708     for i := Length( BBSs ) - 1 downto 0 do begin
1709     if BBSs[ i ] <> nil then
1710     BBSs[ i ].Free;
1711     BBSs[ i ] := nil;
1712     end;
1713     except
1714     end;
1715    
1716     ActiveList := nil;
1717    
1718     FTreeType := gttNone;
1719 h677 1.516
1720     //============鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申================================//
1721    
1722     // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1723     InitializeBoardPlugIns;
1724    
1725 yoffy 1.289 GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1726    
1727 h677 1.515 // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1728     for i := Length(BBSs) - 1 downto 0 do begin
1729     if not BBSs[i].IsBoardFileRead then
1730     GikoSys.ReadBoardFile(BBSs[i]);
1731     end;
1732    
1733 yoffy 1.289 // BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1734     SetBBSMenu;
1735    
1736 yoffy 1.123 ShowBBSTree( BBSs[ 0 ] );
1737 yoffy 1.143
1738     // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1739     LoadHistory;
1740    
1741     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1742     FavoriteDM.ReadFavorite;
1743 yoffy 1.279
1744 yoffy 1.143 SetLinkBar;
1745    
1746 h677 1.515 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1747 h677 1.514 RoundList.LoadRoundBoardFile;
1748     RoundList.LoadRoundThreadFile;
1749    
1750 h677 1.517 LockWindowUpdate(0);
1751 h677 1.476 //
1752 h677 1.539 GikoDM.TabsOpenAction.Execute;
1753 hi_ 1.1 end;
1754    
1755    
1756     procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
1757     var
1758     p: TPoint;
1759     s: string;
1760     tmp2: string;
1761     URL: string;
1762     ATitle: Boolean;
1763    
1764 yoffy 1.130 threadItem : TThreadItem;
1765     board : TBoard;
1766 yoffy 1.163 Protocol, Host, Path, Document, Port, Bookmark: string;
1767 yoffy 1.130
1768 h677 1.333 wkInt: Integer;
1769 hi_ 1.1 wkIntSt: Integer;
1770     wkIntTo: Integer;
1771     ActiveFileName: string;
1772     e: IHTMLElement;
1773     Ext: string;
1774     PathRec: TPathRec;
1775     begin
1776 h677 1.316 if not( TObject(Sender) is TWebBrowser )then
1777     Exit;
1778 hi_ 1.1 try
1779     try
1780 h677 1.316 if (TWebBrowser(Sender) <> nil) and (not TWebBrowser(Sender).Busy) and (Assigned(TWebBrowser(Sender).Document)) then begin
1781     if LowerCase(OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset) <> 'shift_jis' then begin
1782     OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset := 'shift_jis';
1783 h677 1.306 end;
1784 hi_ 1.1 end;
1785     except
1786     end;
1787     finally
1788     end;
1789     if PreviewTimer.Enabled then
1790     PreviewTimer.Enabled := False;
1791     Application.CancelHint;
1792 h677 1.333 try
1793     if GetActiveContent <> nil then
1794     ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
1795     else
1796     ActiveFileName := '';
1797     except
1798     FActiveContent := nil;
1799     Exit;
1800     end;
1801 hi_ 1.1
1802     StatusBar.Panels[1].Text := Text;
1803    
1804     if FHint <> nil then begin
1805     FHint.ReleaseHandle;
1806     FHint.ClearAllRes;
1807     end;
1808     if FPreviewBrowser <> nil then
1809     ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
1810    
1811     if not GikoSys.Setting.UnActivePopup then
1812     if not GikoForm.Active then
1813     Exit;
1814    
1815     //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
1816     //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
1817    
1818     s := '';
1819     Ext := AnsiLowerCase(ExtractFileExt(Text));
1820     if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
1821     ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
1822     if FPreviewBrowser = nil then begin
1823     FPreviewBrowser := TPreviewBrowser.Create(Self);
1824     ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
1825     TOleControl(FPreviewBrowser).Parent := nil;
1826     end;
1827 h677 1.316 FPreviewBrowser.Navigate(BLANK_HTML);//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1828 hi_ 1.1 FPreviewURL := Text;
1829     PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
1830     PreviewTimer.Enabled := True;
1831     end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
1832     if Pos('mailto:', Text) = 1 then begin
1833     s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
1834     //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
1835     GetCursorPos(p);
1836     p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
1837     p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
1838     e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
1839     if (Assigned(e)) then begin
1840 h677 1.297 tmp2 := ZenToHan(e.Get_outerText);
1841 hi_ 1.1 if (GikoSys.IsNumeric(tmp2)) then begin
1842     //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1843     wkIntSt := StrToInt(tmp2);
1844     wkIntTo := StrToInt(tmp2);
1845     //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
1846     FHint.PopupType := gptThread;
1847 h677 1.530 HTMLCreater.SetResPopupText(FHint, GetActiveContent, wkIntSt, wkIntTo, False, False);
1848 hi_ 1.1 end else begin
1849     FHint.PopupType := gptRaw;
1850     FHint.Caption := s;
1851     end;
1852     end;
1853     end else begin
1854 h677 1.319 threadItem := GetActiveContent;
1855 h677 1.530 URL := THTMLCreate.GetRespopupURL(Text, threadItem.URL);
1856 yoffy 1.274 PathRec := Gikosys.Parse2chURL2(URL);
1857 q9_ 1.354 if (PathRec.FNoParam) then begin
1858     PathRec.FSt := 1;
1859     PathRec.FTo := 1;
1860 h677 1.447 end else begin
1861 q9_ 1.352 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
1862 h677 1.447 end;
1863 yoffy 1.163 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
1864 hi_ 1.1
1865 h677 1.168 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
1866 yoffy 1.162
1867 yoffy 1.163 URL := GikoSys.GetBrowsableThreadURL( URL );
1868 yoffy 1.274 wkIntSt := PathRec.FSt;
1869     wkIntTo := PathRec.FTo;
1870 hi_ 1.1
1871     if (wkIntSt = 0) and (wkIntTo = 0) then begin
1872     wkIntSt := 1;
1873     wkIntTo := 1;
1874     end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
1875     wkIntSt := wkIntTo;
1876     end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
1877     wkIntTo := wkIntSt;
1878     end else if wkIntSt > wkIntTo then begin
1879 h677 1.333 wkInt := wkIntTo;
1880 hi_ 1.1 wkIntTo := wkIntSt;
1881 h677 1.333 wkIntSt := wkInt;
1882 hi_ 1.1 end;
1883 h677 1.299 if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
1884 yoffy 1.274 ATitle := false
1885     else
1886     ATitle := true;
1887 hi_ 1.1
1888 yoffy 1.160 threadItem := BBSsFindThreadFromURL( URL );
1889 h677 1.170
1890 yoffy 1.163 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
1891     board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
1892 yoffy 1.274 if board <> nil then begin
1893     if not board.IsThreadDatRead then
1894     GikoSys.ReadSubjectFile( board );
1895 yoffy 1.270 threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
1896 yoffy 1.274 end;
1897 yoffy 1.130 end;
1898 h677 1.319
1899 yoffy 1.130 if threadItem <> nil then begin
1900 yoffy 1.127 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
1901 h677 1.512 //URL鐃緒申鐃緒申鐃緒申鐃緒申/鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1902     if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin
1903     wkIntSt := 1;
1904     wkIntTo := 1;
1905     end;
1906 yoffy 1.127 FHint.PopupType := gptThread;
1907 h677 1.530 HTMLCreater.SetResPopupText(FHint, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
1908 yoffy 1.127 end;
1909 hi_ 1.1 end;
1910 h677 1.168 end;
1911 hi_ 1.1
1912     if FHint.PopupType = gptRaw then begin
1913     if FHint.Caption <> '' then
1914     ShowTextPopup;
1915     end else begin
1916 yoffy 1.2 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
1917 hi_ 1.1 ShowTextPopup;
1918     end;
1919     end;
1920     end;
1921    
1922     procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
1923     var
1924     SysMenu: HMenu;
1925     begin
1926     FEnabledCloseButton := Enabled;
1927     SysMenu := GetSystemMenu(Handle, False);
1928    
1929     if Enabled then begin
1930     EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1931     end else begin
1932     EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
1933     end;
1934    
1935     DrawMenuBar(Handle);
1936     end;
1937    
1938     procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
1939     var AllowChange: Boolean);
1940     begin
1941 q9_ 1.369 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1942     // if FTreeType = gtt2ch then
1943     // FSortIndex := -1;
1944 hi_ 1.1 end;
1945    
1946     procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
1947     Shift: TShiftState);
1948 yoffy 1.428 var
1949     pos : TPoint;
1950 hi_ 1.1 begin
1951 yoffy 1.236 if GetActiveList is TBoard then begin
1952 yoffy 1.428 case Key of
1953     VK_BACK:; // UpFolderButtonClick(Sender);
1954     VK_SPACE: ListDoubleClick(Shift);
1955     VK_RETURN: ListClick;
1956     VK_APPS:
1957     begin
1958     if ListView.Selected <> nil then begin
1959     pos.X := ListView.Column[ 0 ].Width;
1960     pos.Y := ListView.Selected.Top;
1961     end else begin
1962     pos.X := ListView.Left;
1963     pos.Y := ListView.Top;
1964     end;
1965     Windows.ClientToScreen( ListView.Handle, pos );
1966     ListPopupMenu.Popup( pos.X, pos.Y );
1967     end;
1968 yoffy 1.236 end;
1969     end else begin // TBBS, TCategory
1970 yoffy 1.428 case Key of
1971     VK_BACK:; // UpFolderButtonClick(Sender);
1972     VK_SPACE: ListClick;
1973     VK_RETURN: ListDoubleClick(Shift);
1974     VK_APPS:
1975     begin
1976     if ListView.Selected <> nil then begin
1977     pos.X := ListView.Column[ 0 ].Width;
1978     pos.Y := ListView.Selected.Top;
1979     end else begin
1980     pos.X := ListView.Left;
1981     pos.Y := ListView.Top;
1982     end;
1983     Windows.ClientToScreen( ListView.Handle, pos );
1984     ListPopupMenu.Popup( pos.X, pos.Y );
1985     end;
1986 yoffy 1.236 end;
1987 hi_ 1.1 end;
1988     end;
1989    
1990     function TGikoForm.GetHttpState: Boolean;
1991     begin
1992     Result := FHttpState;
1993     end;
1994    
1995     procedure TGikoForm.ListViewColumnClick(Sender: TObject;
1996     Column: TListColumn);
1997 yoffy 1.413 var
1998     id, idx : Integer;
1999     orderList : TList;
2000 h677 1.570 vSortIndex : Integer;
2001     vSortOrder : Boolean;
2002 hi_ 1.1 begin
2003 h677 1.530 idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
2004 h677 1.570 if TObject( FActiveList ) is TBBS then begin
2005     orderList := GikoSys.Setting.BBSColumnOrder;
2006     vSortIndex := GikoSys.Setting.BBSSortIndex;
2007     vSortOrder := GikoSys.Setting.BBSSortOrder;
2008     end else if TObject( FActiveList ) is TCategory then begin
2009     orderList := GikoSys.Setting.CategoryColumnOrder;
2010     vSortIndex := GikoSys.Setting.CategorySortIndex;
2011     vSortOrder := GikoSys.Setting.CategorySortOrder;
2012     end else if TObject( FActiveList ) is TBoard then begin
2013     orderList := GikoSys.Setting.BoardColumnOrder;
2014     vSortIndex := GikoSys.Setting.BoardSortIndex;
2015     vSortOrder := GikoSys.Setting.BoardSortOrder;
2016     end else
2017 yoffy 1.413 Exit;
2018    
2019     id := Integer( orderList[ idx ] );
2020    
2021 h677 1.570
2022     if vSortIndex = id then
2023     vSortOrder := not vSortOrder
2024 h677 1.464 else begin
2025 h677 1.572 vSortOrder := id = 0;
2026 h677 1.570 end;
2027 h677 1.572
2028 h677 1.570 TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, vSortOrder);
2029 hi_ 1.1 end;
2030    
2031     procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2032     Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2033     var
2034     ARect: TRect;
2035     begin
2036 yoffy 1.2 DefaultDraw := True;
2037     Exit;
2038 hi_ 1.1 DefaultDraw := False;
2039     if (cdsSelected in State) or (cdsHot in State) then begin
2040     Sender.Canvas.Brush.Color := clHighlight;
2041     Sender.Canvas.Font.Color := clHighlightText;
2042     end else begin
2043     Sender.Canvas.Brush.Color := clBtnFace;
2044     Sender.Canvas.Font.Color := clBtnText;
2045     end;
2046     ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2047     Sender.Canvas.FillRect(ARect);
2048     DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2049     end;
2050    
2051     function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2052     var
2053     Nodes: TTreeNodes;
2054     i: integer;
2055     begin
2056     Nodes := TreeView.Items;
2057    
2058     for i := 0 to Nodes.Count - 1 do begin
2059     if Nodes.Item[i].Data = Data then begin
2060     Result := Nodes.Item[i];
2061     Exit;
2062     end;
2063     end;
2064     Result := nil;
2065     end;
2066    
2067     procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2068     const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2069     Headers: OleVariant; var Cancel: WordBool);
2070     var
2071     sNo: string;
2072     p: TPoint;
2073 yoffy 1.56 const
2074     kMenuName: string = 'menu:';
2075 hi_ 1.1 begin
2076 yoffy 1.56
2077     if Pos(kMenuName, URL) <> 0 then begin
2078 yoffy 1.100 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2079    
2080 hi_ 1.1 if not GikoSys.IsNumeric(sNo) then Exit;
2081    
2082     Cancel := True;
2083     GetCursorpos(p);
2084     KokoPopupMenu.Tag := StrToInt(sNo);
2085     KokoPopupMenu.Popup(p.x, p.y);
2086     end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2087     Cancel := not GikoSys.Setting.OpenMailer;
2088     end;
2089 yoffy 1.56
2090 hi_ 1.1 end;
2091    
2092     procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2093     const ARect: TRect; var DefaultDraw: Boolean);
2094     var
2095     NodeRect: TRect;
2096     i, j: Integer;
2097     IsBoardNode: Boolean;
2098     Cnt: Integer;
2099     CntText: string;
2100     TextWidth: Integer;
2101     TextRect: TRect;
2102     Board: TBoard;
2103     Category: TCategory;
2104     Bitmap: TBitmap;
2105     NodeWidth: Integer;
2106     begin
2107     DefaultDraw := True;
2108    
2109     if FTreeType = gttHistory then Exit;
2110    
2111     TreeView.Canvas.Font.Color := clBlue;
2112     IsBoardNode := False;
2113 h677 1.95 for i := 0 to TreeView.Items.Count - 1 do begin
2114 yoffy 1.51 Cnt := 0;
2115 hi_ 1.1 if not TreeView.Items[i].IsVisible then
2116     continue;
2117    
2118     if TObject(TreeView.Items[i].Data) is TCategory then begin
2119     if TreeView.Items[i].Expanded then
2120     continue;
2121    
2122     IsBoardNode := False;
2123     Category := TCategory(TreeView.Items[i].Data);
2124     for j := 0 to Category.Count - 1 do begin
2125     Board := Category.Items[j];
2126     if Board <> nil then begin
2127     if Board.UnRead > 0 then begin
2128     Cnt := 1;
2129     Break;
2130     end;
2131     end;
2132     end;
2133     if Cnt <> 1 then
2134     continue;
2135     end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2136     IsBoardNode := True;
2137     Board := TBoard(TreeView.Items[i].Data);
2138 h677 1.514
2139 hi_ 1.1 Cnt := Board.UnRead;
2140     if Cnt <= 0 then
2141     continue;
2142     end else
2143     continue;
2144    
2145     Bitmap := TBitmap.Create;
2146     try
2147     Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2148     Bitmap.Canvas.Font.Style := [fsBold];
2149     NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2150     finally
2151     Bitmap.Free;
2152     end;
2153    
2154     NodeRect := TreeView.Items[i].DisplayRect(True);
2155    
2156     if IsBoardNode then
2157     CntText := '(' + IntToStr(Cnt) + ')'
2158 h677 1.95 else if Cnt = 1 then
2159 hi_ 1.1 CntText := '(+)';
2160 h677 1.95
2161 hi_ 1.1
2162     TextWidth := TreeView.Canvas.TextWidth(CntText);
2163    
2164     TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2165     NodeRect.Top,
2166     NodeRect.Left + NodeWidth + TextWidth + 8,
2167     NodeRect.Bottom);
2168     DrawText(TreeView.Canvas.Handle,
2169     PChar(CntText),
2170     -1,
2171     TextRect,
2172     DT_SINGLELINE or DT_VCENTER);
2173     end;
2174     TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2175     end;
2176    
2177     procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2178     Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2179     var
2180     Board: TBoard;
2181     Category: TCategory;
2182     i: Integer;
2183     begin
2184     DefaultDraw := True;
2185    
2186     if FTreeType = gttHistory then Exit;
2187    
2188     TreeView.Canvas.Font.Style := [];
2189     if Node <> nil then begin
2190     if TObject(Node.Data) is TCategory then begin
2191     Category := TCategory(Node.Data);
2192     for i := 0 to Category.Count - 1 do begin
2193     Board := Category.Items[i];
2194     if Board <> nil then begin
2195     if Board.UnRead > 0 then begin
2196     TreeView.Canvas.Font.Style := [fsBold];
2197     Break;
2198     end;
2199     end;
2200     end;
2201     end else if TObject(Node.Data) is TBoard then begin
2202     Board := TBoard(Node.Data);
2203     if Board.UnRead > 0 then
2204     TreeView.Canvas.Font.Style := [fsBold];
2205     end;
2206     end;
2207     end;
2208    
2209     procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2210     begin
2211     TreeView.Invalidate;
2212    
2213 yoffy 1.123 if TObject(Node.Data) is TBBS then begin
2214     TBBS(Node.Data).NodeExpand := True;
2215 hi_ 1.1 end else if TObject(Node.Data) is TCategory then begin
2216     TCategory(Node.Data).NodeExpand := True;
2217     end else if TObject(Node.Data) is TBoard then begin
2218     TBoard(Node.Data).NodeExpand := True;
2219     end;
2220     end;
2221    
2222     procedure TGikoForm.ListViewAllSelect;
2223     begin
2224     ListView.SetFocus;
2225     ListView.SelectAll;
2226     end;
2227 h677 1.548 // *************************************************************************
2228     //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
2229     // *************************************************************************
2230 hi_ 1.1 procedure TGikoForm.TreeViewDblClick(Sender: TObject);
2231 h677 1.553 var
2232     pos : TPoint;
2233     rect: TRect;
2234 hi_ 1.1 begin