Develop and Download Open Source Software

Browse CVS Repository

Contents of /gikonavigoeson/gikonavi/Giko.pas

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


Revision 1.684 - (show annotations) (download) (as text)
Wed Dec 31 03:46:27 2008 UTC (15 years, 3 months ago) by h677
Branch: MAIN
CVS Tags: v1_59_0_777, v1_59_0_778, v1_59_1_778, v1_60_0_780, v1_60_0_779, v1_59_2_785
Branch point for: Bb59
Changes since 1.683: +23 -21 lines
File MIME type: text/x-pascal
終了時に、フォームが通常と異なる場合、フォームを元に戻して設定を保存する処理を
Destroy中に追加。OnCloseQuery中は、フォームを元に戻すことまではしないようにした。

1 unit Giko;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils,
8 {$IF Defined(DELPRO) }
9 SHDocVw,
10 MSHTML,
11 {$ELSE}
12 SHDocVw_TLB,
13 MSHTML_TLB,
14 {$IFEND}
15 IdHTTP, ActiveX, ActnList, ImgList,
16 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 IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem,
22 ShellAPI,Preview, HistoryList, ResPopupBrowser, ExtPreviewDatamodule;
23
24 const
25 NGWORDNAME_PANEL = 3;
26 THREADSIZE_PANEL = 2;
27 USER_RESPOPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser
28
29 type
30
31 TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
32 TMinimizeType = (mtNone, mtMinimizing, mtMinimized);
33 TResizeType = (rtNone, rtResizing);
34
35 // TBrowserRecord = class;
36
37 TGikoForm = class(TForm)
38 StatusBar: TStatusBar;
39 MainPanel: TPanel;
40 ClientPanel: TPanel;
41 TreeSplitter: TSplitter;
42 CabinetPanel: TPanel;
43 TreeView: TTreeView;
44 ThreadMainPanel: TPanel;
45 ListSplitter: TSplitter;
46 ViewPanel: TPanel;
47 ListView: TGikoListView;
48 ThreadPanel: TPanel;
49 MessagePanel: TPanel;
50 MessageBar: TPanel;
51 MessageHideButton: TSpeedButton;
52 MessageListView: TListView;
53 MessageSplitter: TSplitter;
54 Panel3: TPanel;
55 CabinetCloseSpeedButton: TSpeedButton;
56 ToolBar1: TToolBar;
57 CabinetSelectToolButton: TToolButton;
58 HistoryToolBar: TToolBar;
59 HistoryShowToolButton: TToolButton;
60 HistoryAllClearToolButton: TToolButton;
61 ItemIcon16: TImageList;
62 ItemIcon32: TImageList;
63 HotToobarImageList: TImageList;
64 ItemImageList: TImageList;
65 MainMenu: TMainMenu;
66 FileMenu: TMenuItem;
67 DeleteMenu: TMenuItem;
68 ExitMenu: TMenuItem;
69 KidokuMenu: TMenuItem;
70 MidokuMenu: TMenuItem;
71 AllSelectMenu: TMenuItem;
72 ViewMenu: TMenuItem;
73 StdToolBarMenu: TMenuItem;
74 CabinetMenu: TMenuItem;
75 H1: TMenuItem;
76 N4: TMenuItem;
77 CabinetVisibleMenu: TMenuItem;
78 MessageMenu: TMenuItem;
79 StatusBarMenu: TMenuItem;
80 MMSep03: TMenuItem;
81 LargeIconMenu: TMenuItem;
82 SmallIconMenu: TMenuItem;
83 ListMenu: TMenuItem;
84 DetailMenu: TMenuItem;
85 ToolMenu: TMenuItem;
86 Find1: TMenuItem;
87 RoundMenu: TMenuItem;
88 MMSep04: TMenuItem;
89 OptionMenu: TMenuItem;
90 HelpMenu: TMenuItem;
91 G1: TMenuItem;
92 N1: TMenuItem;
93 AboutMenu: TMenuItem;
94 BrowserPopupMenu: TPopupMenu;
95 ShowThreadMenu: TMenuItem;
96 ShowBoardMenu: TMenuItem;
97 ListIconPopupMenu: TPopupMenu;
98 LargeIconPMenu: TMenuItem;
99 SmallIconPMenu: TMenuItem;
100 ListPMenu: TMenuItem;
101 DetailPMenu: TMenuItem;
102 ClosePopupMenu: TPopupMenu;
103 CloseMenu: TMenuItem;
104 U1: TMenuItem;
105 N3: TMenuItem;
106 B1: TMenuItem;
107 S1: TMenuItem;
108 N2: TMenuItem;
109 A1: TMenuItem;
110 L1: TMenuItem;
111 N5: TMenuItem;
112 S2: TMenuItem;
113 ListPopupMenu: TPopupMenu;
114 ListRoundPMenu: TMenuItem;
115 ListReservPMenu: TMenuItem;
116 LPMSep01: TMenuItem;
117 ItemRoundPMenu: TMenuItem;
118 LPMSep02: TMenuItem;
119 KidokuPMenu: TMenuItem;
120 MidokuPMenu: TMenuItem;
121 AllSelectPMenu: TMenuItem;
122 UrlCopyPMenu: TMenuItem;
123 LPMSep05: TMenuItem;
124 DeletePMenu: TMenuItem;
125 LPMSep06: TMenuItem;
126 ViewPMenu: TMenuItem;
127 LargeIconLPMenu: TMenuItem;
128 SmallIconLPMenu: TMenuItem;
129 ListLPMenu: TMenuItem;
130 DetailLPMenu: TMenuItem;
131 T1: TMenuItem;
132 B2: TMenuItem;
133 N8: TMenuItem;
134 URLC1: TMenuItem;
135 N9: TMenuItem;
136 N10: TMenuItem;
137 G2: TMenuItem;
138 N11: TMenuItem;
139 T3: TMenuItem;
140 L2: TMenuItem;
141 N12: TMenuItem;
142 K1: TMenuItem;
143 N13: TMenuItem;
144 N14: TMenuItem;
145 R1: TMenuItem;
146 A2: TMenuItem;
147 N15: TMenuItem;
148 KokoPopupMenu: TPopupMenu;
149 KokomadePMenu: TMenuItem;
150 AllPMenu: TMenuItem;
151 MenuItem1: TMenuItem;
152 MenuItem2: TMenuItem;
153 BrowserTabPopupMenu: TPopupMenu;
154 Close1: TMenuItem;
155 A3: TMenuItem;
156 N16: TMenuItem;
157 A4: TMenuItem;
158 TreePopupMenu: TPopupMenu;
159 TreeSelectThreadPupupMenu: TMenuItem;
160 TreeSelectBoardPupupMenu: TMenuItem;
161 TPMSep01: TMenuItem;
162 TreeSelectURLPupupMenu: TMenuItem;
163 T2: TMenuItem;
164 L3: TMenuItem;
165 B3: TMenuItem;
166 BrowserBottomPanel: TGikoPanel;
167 CabinetSelectPopupMenu: TPopupMenu;
168 H2: TMenuItem;
169 ItemReservPMenu: TMenuItem;
170 RoundNamePopupMenu: TPopupMenu;
171 N7: TMenuItem;
172 B4: TMenuItem;
173 L4: TMenuItem;
174 K2: TMenuItem;
175 A5: TMenuItem;
176 A6: TMenuItem;
177 C1: TMenuItem;
178 V1: TMenuItem;
179 N19: TMenuItem;
180 D1: TMenuItem;
181 D2: TMenuItem;
182 MessageImageList: TImageList;
183 ProgressBar: TProgressBar;
184 URL1: TMenuItem;
185 NameUrlCopyPMenu: TMenuItem;
186 URLC2: TMenuItem;
187 URLN1: TMenuItem;
188 N21: TMenuItem;
189 URLC3: TMenuItem;
190 URLN2: TMenuItem;
191 N23: TMenuItem;
192 ListCoolBar: TGikoCoolBar;
193 ListToolBar: TToolBar;
194 BrowserCoolBar: TGikoCoolBar;
195 BrowserToolBar: TToolBar;
196 ListNameToolBar: TToolBar;
197 ListNameLabel: TLabel;
198 FolderImage: TImage;
199 BrowserNameToolBar: TToolBar;
200 ItemBoardImage: TImage;
201 BrowserBoardNameLabel: TLabel;
202 ItemImage: TImage;
203 BrowserNameLabel: TLabel;
204 D3: TMenuItem;
205 N25: TMenuItem;
206 N26: TMenuItem;
207 D4: TMenuItem;
208 S3: TMenuItem;
209 R2: TMenuItem;
210 TreeSelectNameURLPupupMenu: TMenuItem;
211 N27: TMenuItem;
212 H3: TMenuItem;
213 I1: TMenuItem;
214 BrowserTabToolBar: TToolBar;
215 BrowserTab: TTabControl;
216 About1: TMenuItem;
217 N28: TMenuItem;
218 S4: TMenuItem;
219 N29: TMenuItem;
220 N30: TMenuItem;
221 N31: TMenuItem;
222 L5: TMenuItem;
223 L6: TMenuItem;
224 A7: TMenuItem;
225 R3: TMenuItem;
226 FavoriteMenu: TMenuItem;
227 N32: TMenuItem;
228 BoardFavoriteAddMenu: TMenuItem;
229 ThreadFavoriteAddMenu: TMenuItem;
230 N33: TMenuItem;
231 TreeSelectFavoriteAddPupupMenu: TMenuItem;
232 FavoriteTreeView: TTreeView;
233 StateIconImageList: TImageList;
234 TopPanel: TPanel;
235 TopRightPanel: TPanel;
236 AnimePanel: TPanel;
237 Animate: TAnimate;
238 TopCoolPanel: TPanel;
239 MainCoolBar: TGikoCoolBar;
240 MenuToolBar: TToolBar;
241 StdToolBar: TToolBar;
242 AddressToolBar: TToolBar;
243 AddressComboBox: TComboBox;
244 MoveToToolButton: TToolButton;
245 AddressImageList: TImageList;
246 AddressToolBarMenu: TMenuItem;
247 T4: TMenuItem;
248 Show1: TMenuItem;
249 N34: TMenuItem;
250 T5: TMenuItem;
251 B5: TMenuItem;
252 N35: TMenuItem;
253 A8: TMenuItem;
254 U2: TMenuItem;
255 F1: TMenuItem;
256 PreviewTimer: TTimer;
257 MonazillaWebPageAction1: TMenuItem;
258 N36: TMenuItem;
259 H4: TMenuItem;
260 K3: TMenuItem;
261 L7: TMenuItem;
262 N37: TMenuItem;
263 A9: TMenuItem;
264 ChevronPopupMenu: TPopupMenu;
265 N2N1: TMenuItem;
266 N38: TMenuItem;
267 F2: TMenuItem;
268 LinkToolBar: TToolBar;
269 a10: TMenuItem;
270 N39: TMenuItem;
271 T6: TMenuItem;
272 N40: TMenuItem;
273 LinkBarPopupMenu: TPopupMenu;
274 T7: TMenuItem;
275 ThreadPopupMenu: TPopupMenu;
276 MenuItem4: TMenuItem;
277 MenuItem5: TMenuItem;
278 MenuItem6: TMenuItem;
279 T8: TMenuItem;
280 URLN3: TMenuItem;
281 SelectItemNameCopyAction1: TMenuItem;
282 B6: TMenuItem;
283 T9: TMenuItem;
284 NameCopyPMenu: TMenuItem;
285 SelectComboBox: TComboBox;
286 MainCoolBarPopupMenu: TPopupMenu;
287 StdToolBarVisiblePMenu: TMenuItem;
288 AddressToolBarVisiblePMenu: TMenuItem;
289 LinkToolBarVisiblePMenu: TMenuItem;
290 NG1: TMenuItem;
291 NG2: TMenuItem;
292 N43: TMenuItem;
293 N44: TMenuItem;
294 L9: TMenuItem;
295 I3: TMenuItem;
296 N45: TMenuItem;
297 B9: TMenuItem;
298 R5: TMenuItem;
299 T12: TMenuItem;
300 Show3: TMenuItem;
301 N46: TMenuItem;
302 T13: TMenuItem;
303 B10: TMenuItem;
304 N47: TMenuItem;
305 A12: TMenuItem;
306 U4: TMenuItem;
307 F4: TMenuItem;
308 N48: TMenuItem;
309 T14: TMenuItem;
310 N50: TMenuItem;
311 A11: TMenuItem;
312 S5: TMenuItem;
313 Reload: TMenuItem;
314 GoBack: TMenuItem;
315 GoFoward: TMenuItem;
316 IndividualAbon1: TMenuItem;
317 N41: TMenuItem;
318 IndividualAbon2: TMenuItem;
319 AntiIndivAbonMenuItem: TMenuItem;
320 AntiIndividualAbon: TMenuItem;
321 N49: TMenuItem;
322 N51: TMenuItem;
323 N52: TMenuItem;
324 SearchBoardName: TMenuItem;
325 TreeSelectLogDeleteSeparator: TMenuItem;
326 N54: TMenuItem;
327 A13: TMenuItem;
328 FavoriteTreePopupMenu: TPopupMenu;
329 FavoriteTreeRenamePopupMenu: TMenuItem;
330 FavoriteTreeNewFolderPopupMenu: TMenuItem;
331 N56: TMenuItem;
332 FavoriteTreeDeletePopupMenu: TMenuItem;
333 FavoriteToolBar: TToolBar;
334 FavoriteAddToolButton: TToolButton;
335 FavoriteArrangeToolButton: TToolButton;
336 FavoriteTreeBrowseFolderPopupMenu: TMenuItem;
337 N57: TMenuItem;
338 FavoriteTreeReloadPopupMenu: TMenuItem;
339 N58: TMenuItem;
340 FavoriteTreeURLCopyPopupMenu: TMenuItem;
341 FavoriteTreeNameCopyPopupMenu: TMenuItem;
342 FavoriteTreeLogDeletePopupMenu: TMenuItem;
343 N59: TMenuItem;
344 FavoriteTreeNameURLCopyPopupMenu: TMenuItem;
345 N60: TMenuItem;
346 ExportFavoriteFileAction1: TMenuItem;
347 N6: TMenuItem;
348 N17: TMenuItem;
349 N18: TMenuItem;
350 N20: TMenuItem;
351 N24: TMenuItem;
352 N62: TMenuItem;
353 N61: TMenuItem;
354 N63: TMenuItem;
355 N64: TMenuItem;
356 dummy1: TMenuItem;
357 TreeSelectLogDeletePopupMenu: TMenuItem;
358 N65: TMenuItem;
359 BBSSelectPopupMenu: TPopupMenu;
360 PlugInMenu: TMenuItem;
361 TreeSelectNamePupupMenu: TMenuItem;
362 BrowserPanel: TPanel;
363 SelectTimer: TTimer;
364 SelectThreadSave: TMenuItem;
365 N55: TMenuItem;
366 N66: TMenuItem;
367 dat1: TMenuItem;
368 OpenLogFolder: TMenuItem;
369 Browser: TWebBrowser;
370 TabSave: TMenuItem;
371 TabOpen: TMenuItem;
372 ResRangePopupMenu: TPopupMenu;
373 ResRangeHundPMenuItem: TMenuItem;
374 ResRangeKokoPMenuItem: TMenuItem;
375 ResRangeNewPMenuItem: TMenuItem;
376 ResRangeAllPMenuItem: TMenuItem;
377 BrowsBoradHeadAction1: TMenuItem;
378 ThreadRangePopupMenu: TPopupMenu;
379 A15: TMenuItem;
380 L8: TMenuItem;
381 N67: TMenuItem;
382 N68: TMenuItem;
383 S6: TMenuItem;
384 N69: TMenuItem;
385 ResRangeSelectPMenuItem: TMenuItem;
386 ListColumnPopupMenu: TPopupMenu;
387 N70: TMenuItem;
388 ID1: TMenuItem;
389 ID2: TMenuItem;
390 N53: TMenuItem;
391 ID3: TMenuItem;
392 N71: TMenuItem;
393 N72: TMenuItem;
394 N73: TMenuItem;
395 SelectComboBoxPanel: TPanel;
396 SelectComboBoxSplitter: TImage;
397 N74: TMenuItem;
398 WikiFAQ: TMenuItem;
399 GikoApplicationEvents: TApplicationEvents;
400 N22: TMenuItem;
401 N42: TMenuItem;
402 DAT2: TMenuItem;
403 N75: TMenuItem;
404 DAT3: TMenuItem;
405 N76: TMenuItem;
406 FavoriteTreeItemNameCopyPopupMenu: TMenuItem;
407 N77: TMenuItem;
408 N78: TMenuItem;
409 SaveThreadFile: TMenuItem;
410 N79: TMenuItem;
411 HTML1: TMenuItem;
412 DAT4: TMenuItem;
413 N80: TMenuItem;
414 SameBoardThreadItem: TMenuItem;
415 N81: TMenuItem;
416 N82: TMenuItem;
417 IDNG1: TMenuItem;
418 IDNG2: TMenuItem;
419 ResPopupClearTimer: TTimer;
420 TaskTrayPopupMenu: TPopupMenu;
421 Exit1: TMenuItem;
422 N83: TMenuItem;
423 UpdateGikonaviAction1: TMenuItem;
424 N84: TMenuItem;
425 procedure FormCreate(Sender: TObject);
426 procedure FormDestroy(Sender: TObject);
427 procedure SaveSettingAll();
428 procedure BrowserStatusTextChange(Sender: TObject;
429 const Text: WideString);
430 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
431 procedure TreeViewChanging(Sender: TObject; Node: TTreeNode;
432 var AllowChange: Boolean);
433 procedure ListViewKeyDown(Sender: TObject; var Key: Word;
434 Shift: TShiftState);
435 procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
436 procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
437 Button: TToolButton; State: TCustomDrawState;
438 var DefaultDraw: Boolean);
439 procedure BrowserBeforeNavigate2(Sender: TObject;
440 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
441 Headers: OleVariant; var Cancel: WordBool);
442 procedure TreeViewCustomDraw(Sender: TCustomTreeView;
443 const ARect: TRect; var DefaultDraw: Boolean);
444 procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
445 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
446 procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
447 procedure ListViewCustomDraw(Sender: TCustomListView;
448 const ARect: TRect; var DefaultDraw: Boolean);
449 procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
450 Shift: TShiftState; X, Y: Integer);
451 procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
452 procedure MessageListViewResize(Sender: TObject);
453 procedure CabinetVisible( isVisible : Boolean );
454 procedure FormResize(Sender: TObject);
455 procedure ListPopupMenuPopup(Sender: TObject);
456 procedure TreePopupMenuPopup(Sender: TObject);
457 procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
458 var Cancel: WordBool);
459 procedure ListSplitterMoved(Sender: TObject);
460 procedure BrowserTabChange(Sender: TObject);
461 procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
462 Shift: TShiftState; X, Y: Integer);
463 procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer;
464 State: TDragState; var Accept: Boolean);
465 procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer);
466 procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X,
467 Y: Integer);
468 procedure BrowserDocumentComplete(Sender: TObject;
469 const pDisp: IDispatch; var URL: OleVariant);
470 procedure RoundNamePopupMenuPopup(Sender: TObject);
471 procedure FormShow(Sender: TObject);
472 procedure BrowserTabToolBarResize(Sender: TObject);
473 procedure FavoriteMenuClick(Sender: TObject);
474 procedure MainCoolBarResize(Sender: TObject);
475 procedure AddressToolBarResize(Sender: TObject);
476 procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
477 Shift: TShiftState);
478 procedure BrowserEnter(Sender: TObject);
479 procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
480 procedure PreviewTimerTimer(Sender: TObject);
481 procedure MessageHideButtonClick(Sender: TObject);
482 procedure HistoryAllClearToolButtonClick(Sender: TObject);
483 procedure MainCoolBarBandInfo(Sender: TObject;
484 var BandInfo: PReBarBandInfoA);
485 procedure MainCoolBarChevronClick(Sender: TObject;
486 RebarChevron: PNMRebarChevron);
487 procedure ListCoolBarBandInfo(Sender: TObject;
488 var BandInfo: PReBarBandInfoA);
489 procedure ListCoolBarChevronClick(Sender: TObject;
490 RebarChevron: PNMRebarChevron);
491 procedure BrowserCoolBarBandInfo(Sender: TObject;
492 var BandInfo: PReBarBandInfoA);
493 procedure BrowserCoolBarChevronClick(Sender: TObject;
494 RebarChevron: PNMRebarChevron);
495 procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
496 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
497 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
498 procedure SelectComboBoxChange(Sender: TObject);
499 procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
500 Shift: TShiftState);
501 procedure SelectComboBoxExit(Sender: TObject);
502 procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
503 Shift: TShiftState; X, Y: Integer);
504 procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
505 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
506 procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
507 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
508 procedure StatusBarResize(Sender: TObject);
509 procedure SelectComboBoxEnter(Sender: TObject);
510 procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
511 Y: Integer);
512 procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
513 procedure FavoriteTreeViewEdited(Sender: TObject; Node: TTreeNode;
514 var S: String);
515 procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
516 Shift: TShiftState);
517 procedure FavoriteTreePopupMenuPopup(Sender: TObject);
518 procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer);
519 procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton;
520 Shift: TShiftState; X, Y: Integer);
521 procedure LinkToolBarDragOver(Sender, Source: TObject; X, Y: Integer;
522 State: TDragState; var Accept: Boolean);
523 procedure FavoriteTreeViewEndDrag(Sender, Target: TObject; X,
524 Y: Integer);
525 procedure FavoriteTreeBrowseBoardPopupMenuClick(Sender: TObject);
526 procedure BrowserTabContextPopup(Sender: TObject; MousePos: TPoint;
527 var Handled: Boolean);
528 procedure BrowserTabPopupMenuPopup(Sender: TObject);
529 procedure BrowserTabResize(Sender: TObject);
530 procedure TreeViewKeyDown(Sender: TObject; var Key: Word;
531 Shift: TShiftState);
532 procedure FavoriteTreeViewMouseDown(Sender: TObject;
533 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
534 procedure MessagePanelResize(Sender: TObject);
535 procedure OnResized;
536 procedure SelectTimerTimer(Sender: TObject);
537 procedure ListViewColumnRightClick(Sender: TObject;
538 Column: TListColumn; Point: TPoint);
539 procedure ListViewCustomDrawItem(Sender: TCustomListView;
540 Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
541 procedure FormActivate(Sender: TObject);
542 procedure BrowserPanelResize(Sender: TObject);
543 procedure MenuToolBarResize(Sender: TObject);
544 procedure ListToolBarResize(Sender: TObject);
545 procedure BrowserToolBarResize(Sender: TObject);
546 procedure KokoPopupMenuPopup(Sender: TObject);
547 procedure ListViewKeyUp(Sender: TObject; var Key: Word;
548 Shift: TShiftState);
549 procedure FavoriteTreeViewEditing(Sender: TObject; Node: TTreeNode;
550 var AllowEdit: Boolean);
551 procedure CabinetCloseSpeedButtonClick(Sender: TObject);
552 procedure FavoriteArrangeToolButtonClick(Sender: TObject);
553 procedure GikoApplicationEventsMessage(var Msg: tagMSG;
554 var Handled: Boolean);
555 procedure GikoApplicationEventsDeactivate(Sender: TObject);
556 procedure GikoApplicationEventsException(Sender: TObject; E: Exception);
557 procedure TreeViewMouseDown(Sender: TObject; Button: TMouseButton;
558 Shift: TShiftState; X, Y: Integer);
559 procedure GetResURLMenuClick(Sender: TObject);
560 procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
561 var Handled: Boolean);
562 procedure ResPopupClearTimerTimer(Sender: TObject);
563 private
564 { Private 鐃緒申鐃緒申 }
565 FEnabledCloseButton: Boolean;
566 FClickNode: TTreeNode;
567 FHttpState: Boolean;
568 FPreviewBrowser: TPreviewBrowser;
569 FPreviewURL: string;
570 FBrowserSizeHeight: Integer;
571 FBrowserSizeWidth: Integer;
572 FTabHintIndex: Integer;
573 FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
574 FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?
575 FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?
576 FActiveList: TObject;
577 FActiveContent: TBrowserRecord; //
578 FActiveBBS : TBBS;
579 FHistoryList: THistoryList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
580 FTreeType: TGikoTreeType;
581 FWorkCount: Integer;
582 FNameCookie: string;
583 FMailCookie: string;
584 FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
585 FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?
586 FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?
587 IsDraggingSelectComboBox : Boolean;
588 DraggingSelectComboBoxPosition : TPoint;
589 FSearchDialog: TSearchDialog;
590 FDropSpaceNode: TTreeNode;
591 FDragTime : Cardinal; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?
592 FDragButton : TToolButton; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?鐃緒申Drag鐃緒申鐃緒申鐃緒申Button鐃緒申鐃緒申
593 FDragWFirst : Boolean; ///< WebTab鐃緒申D&D鐃?
594 FListViewBackGroundColor : TColor; ///< ListView鐃緒申BackGroundColor
595 FUseOddResOddColor : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申
596 FOddColor : TColor; ///< 鐃緒申鐃緒申鐃?
597 FSelectResWord : string; ///< 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
598 FIsIgnoreResize : TResizeType; ///< 鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
599 FIsMinimize : TMinimizeType; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
600 FOldFormWidth : Integer; ///< 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
601 FToolBarSettingSender : TToolBarSettingSenderType; ///< 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
602 FMouseDownPos : TPoint; ///< 鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
603 FBrowsers: TList;
604 FResRangeMenuSelect : Longint; ///< ResRangeButton 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 (鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申 ResRange 鐃緒申鐃緒申)
605 FStartUp : Boolean;
606 FIsHandledWheel : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 WM_MOUSEWHEEL 鐃緒申鐃緒申鐃緒申鐃緒申
607 DiffComp: Boolean; //Add by Genyakun 鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申True鐃緒申鐃緒申鐃緒申
608 FOrigenCaption: String; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
609 FPreviewBrowserRect: TRect; ///< 鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
610 FActionListGroupIndexes: array of Integer; ///<GikoDM鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
611 FResPopupBrowser: TResPopupBrowser;
612 FUpdateExePath: string; ///鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?
613 FUpdateExeArgs: string; ///鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
614 procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
615 procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
616 procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
617 procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
618 procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
619 procedure ListClick;
620 procedure ListDoubleClick(Shift: TShiftState);
621 function Hook(var Message: TMessage): Boolean;
622 procedure AddRoundNameMenu(MenuItem: TMenuItem);
623 procedure SetMenuFont;
624 procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
625 procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;
626 procedure FavoriteClick(Sender: TObject); overload;
627 procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
628 function OnDocumentContextMenu(Sender: TObject): WordBool;
629 function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
630 procedure MenuBarChevronMenu;
631 procedure LinkBarChevronMenu;
632 procedure ToolBarChevronMenu(ToolBar: TToolBar);
633 procedure LinkToolButtonDragDrop(Sender, Source: TObject; X, Y: Integer);
634 procedure LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
635 procedure LinkToolButtonOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
636 procedure LinkToolButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
637 procedure LinkToolButtonStartDrag(Sender: TObject; var DragObject: TDragObject);
638 function TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode;
639 procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );
640 procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject );
641 procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject );
642 //
643 procedure SetListViewBackGroundColor(value: TColor);
644 procedure BBSMenuItemOnClick( Sender : TObject );
645 /// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
646 procedure SaveCoolBarSettings;
647 procedure SaveMainCoolBarSettings;
648 procedure SaveBoardCoolBarSettings;
649 procedure SaveBrowserCoolBarSettings;
650 /// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
651 procedure LoadCoolBarSettings;
652 /// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
653 procedure OnMinimize;
654 /// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
655 procedure OnMinimized;
656 /// TreeView 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
657 procedure TreeClick( Node : TTreeNode );
658 /// TreeView 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
659 procedure TreeDoubleClick( Node : TTreeNode );
660 /// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
661 procedure SetBBSMenu;
662 /// ListColumnPopupMenu 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
663 procedure ListColumnPopupMenuOnClick( Sender : TObject );
664 //! 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
665 procedure SetSelectWord( const text : string );
666 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
667 function GetScreenCursor(): TCursor;
668 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
669 procedure SetScreenCursor(Cursor : TCursor);
670 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
671 procedure CreateControlThread();
672 //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
673 procedure CreateBrowsers(count: Integer);
674 //! ActionList鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申
675 procedure GetGroupIndex(ActionList: TActionList);
676 //! ActionList鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申
677 procedure SetGroupIndex(ActionList: TActionList);
678 //! 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申(鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 or 鐃?鐃緒申JUMP鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申DL鐃緒申鐃緒申)
679 procedure OpenThreadItem(Thread: TThreadItem; URL: String);
680 //! ListView鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
681 procedure RefreshListView(Thread: TThreadItem);
682 //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
683 procedure ClearThreadRengeAction;
684 //! 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申
685 procedure UnStoredTaskTray;
686 //! 鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申
687 procedure ShowEditors(nCmdShow: Integer);
688 //! 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Browser鐃緒申鐃?鐃緒申
689 procedure ReleaseOldestBrowser;
690 //! 鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
691 procedure AddMenuSameBoardThread;
692 //! 鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
693 procedure SameBoardThreadSubItemOnClick(Sender: TObject);
694 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
695 procedure CreateResPopupBrowser;
696 //! 鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?
697 function isValidFile(FileName: String) : boolean;
698 //! ListView鐃緒申D&D鐃緒申鐃緒申鐃緒申鐃緒申
699 procedure AcceptDropFiles(var Msg: TMsg);
700 //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
701 procedure UpdateListView();
702 //! 鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
703 procedure LoadIcon();
704 protected
705 procedure CreateParams(var Params: TCreateParams); override;
706 procedure WndProc(var Message: TMessage); override;
707 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
708 procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
709 procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
710 public
711 { Public 鐃緒申鐃緒申 }
712 LastRoundTime: TDateTime;
713 BrowserNullTab: TBrowserRecord;
714 FControlThread: TThreadControl;
715 FIconData : TNotifyIconData;
716 procedure MoveToURL(const inURL: string);
717 function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
718 procedure ReloadBBS;
719 function GetHttpState: Boolean;
720 procedure SetEnabledCloseButton(Enabled: Boolean);
721 function GetTreeNode(Data: TObject): TTreeNode;
722 procedure ListViewAllSelect;
723 property ListStyle: TViewStyle read FListStyle write FListStyle;
724 property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
725 property ViewType: TGikoViewType read FViewType write FViewType;
726 property NameCookie: string read FNameCookie write FNameCookie;
727 property MailCookie: string read FMailCookie write FMailCookie;
728 property ClickNode: TTreeNode read FClickNode write FClickNode;
729 property TreeType: TGikoTreeType read FTreeType write FTreeType;
730 property ActiveContent: TBrowserRecord read FActiveContent write FActiveContent;
731 property ResRangeMenuSelect: Longint read FResRangeMenuSelect write FResRangeMenuSelect;
732 property SelectResWord : string read FSelectResWord write FSelectResWord;
733 property BrowserSizeWidth: Integer read FBrowserSizeWidth write FBrowserSizeWidth;
734 property BrowserSizeHeight: Integer read FBrowserSizeHeight write FBrowserSizeHeight;
735 property SearchDialog: TSearchDialog read FSearchDialog write FSearchDialog;
736 property ToolBarSettingSender : TToolBarSettingSenderType
737 read FToolBarSettingSender write FToolBarSettingSender;
738 property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
739 property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
740 property WorkCount: Integer read FWorkCount write FWorkCount;
741 property UpdateExePath: string read FUpdateExePath write FUpdateExePath;
742 property UpdateExeArgs: string read FUpdateExeArgs write FUpdateExeArgs;
743
744 procedure SetContent(inThread: TBrowserRecord);
745 function GetActiveContent(popup :Boolean = false): TThreadItem;
746 function GetActiveList: TObject;
747
748 procedure SetListViewType(AViewType: TGikoViewType); overload;
749 procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
750 procedure PlaySound(SoundEventName: string);
751 procedure ShowBBSTree( inBBS : TBBS );
752 procedure ShowBBSTreeOld( inBBS : TBBS );
753 procedure ShowHistoryTree;
754 procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
755 procedure SetBrowserTabState;
756 procedure SetToolBarPopup;
757 procedure ShowFavoriteAddDialog( Item : TObject );
758 procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
759 procedure RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);
760 property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
761 property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
762 property OddColor : TColor read FOddColor write FOddColor;
763 function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
764 procedure OnPlugInMenuItem( Sender : TObject );
765 procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
766 /// ListView 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申 KuroutSetting鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
767 procedure ActiveListColumnSave;
768 procedure SetActiveList(Obj: TObject);
769 property ActiveList: TObject read GetActiveList write SetActiveList;
770 /// CoolBar 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
771 procedure CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
772 //鐃緒申鐃緒申ID鐃緒申鐃緒申鐃緒申鐃?鐃緒申
773 procedure IndividualAbonID(Atype : Integer);
774 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申
775 procedure IndividualAbon(Atag, Atype : Integer);
776 //鐃緒申鐃緒申ID鐃緒申NG鐃緒申鐃?鐃?鐃緒申鐃?鐃?
777 procedure AddIDtoNGWord(invisible : boolean);
778 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申 true:鐃?鐃緒申鐃緒申鐃?鐃? false:鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
779 procedure RepaintAllTabsBrowser();
780 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
781 procedure SetLinkBar;
782 procedure FavoriteBrowseFolder( node: TTreeNode );
783 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
784 procedure DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False);
785 //鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
786 procedure DownloadList(Board: TBoard; ForceDownload: Boolean = False);
787 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
788 procedure DeleteHistory( threadItem: TThreadItem );
789 //鐃?鐃?鐃緒申鐃緒申鐃緒申 鐃?鐃緒申鐃?鐃?鐃?鐃緒申
790 procedure DeleteTab(ThreadItem: TThreadItem); overload;
791 //鐃?鐃?鐃緒申鐃緒申鐃緒申 鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
792 procedure DeleteTab(BrowserRecord: TBrowserRecord); overload;
793 // 鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
794 procedure DeleteTab(index, selectIndex: Integer); overload;
795 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
796 procedure BrowserMovement(const AName: string); overload;
797 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
798 procedure BrowserMovement(scroll: Integer); overload;
799 //Application鐃緒申MainForm鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
800 function GetMainForm(): TComponent;
801 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
802 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?
803 procedure OnGestureStart(Sender: TObject);
804 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申
805 procedure OnGestureMove(Sender: TObject);
806 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
807 procedure OnGestureEnd(Sender: TObject);
808 /// 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
809 procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
810 //ListView鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
811 procedure SelectListItem(List: TList);
812 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
813 procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
814 //
815 procedure ModifySelectList;
816 //
817 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;
818 //
819 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
820 //
821 procedure SetSelectRoundName(Sender: TObject);
822 //
823 function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
824 //
825 function WebBrowserClick(Sender: TObject): WordBool;
826 //! 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
827 procedure SetSelectComboBox();
828
829 //! 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
830 procedure TaskTrayIconMessage(var Msg : TMsg); message WM_USER + 2010;
831 //! 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申
832 procedure StoredTaskTray;
833 //! 鐃緒申ID鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
834 procedure ShowSameIDAncher(const AID: String);
835 published
836 property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
837 end;
838
839 TFavoriteMenuItem = class(TMenuItem)
840 private
841 FData : Pointer;
842 public
843 property Data: Pointer read FData write FData;
844 end;
845
846 TBBSMenuItem = class(TMenuItem)
847 private
848 FData : Pointer;
849 public
850 property Data: Pointer read FData write FData;
851 end;
852
853 TLinkToolButton = class(TToolButton)
854 private
855 FData : Pointer;
856 public
857 property Data: Pointer read FData write FData;
858 end;
859
860 var
861 GikoForm: TGikoForm;
862
863 implementation
864
865 uses
866 GikoUtil, IndividualAbon, Math, Kotehan, KeySetting,
867 YofUtils, ToolBarUtil, ToolBarSetting,
868 GikoXMLDoc, RoundName, IniFiles, FavoriteAdd,
869 FavoriteArrange, AddressHistory, Gesture,
870 About, Option, Round, Splash, Sort, ListSelect, Imm,
871 NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter,
872 HTMLCreate, ListViewUtils, GikoDataModule, GikoMessage,
873 InputAssistDataModule, Types, ReplaceDataModule;
874
875 const
876 BLANK_HTML: string = 'about:blank';
877 BROWSER_COUNT = 5; //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
878 //D&D鐃緒申鐃?
879 DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel)
880 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
881 HTML_FILE_NAME = 'temp_preview.html';
882 //鐃緒申鐃?鐃?鐃?鐃?ID
883 USER_TREECLICK = WM_USER + 2000;
884 USER_RESIZED = WM_USER + 2001;
885 USER_MINIMIZED = WM_USER + 2002;
886 USER_SETLINKBAR = WM_USER + 2003;
887 USER_DOCUMENTCOMPLETE = WM_USER + 2004; ///< wParam : TWebBrowser
888 USER_TASKTRAY = WM_USER + 2010;
889 {$R *.DFM}
890
891 procedure TGikoForm.CreateParams(var Params: TCreateParams);
892 begin
893 inherited;
894 if FormStyle in [fsNormal, fsStayOnTop] then begin
895 if BorderStyle in [bsSingle, bsSizeable] then begin
896 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
897 Params.WndParent := 0;
898 end;
899 end;
900 end;
901
902 procedure TGikoForm.FormCreate(Sender: TObject);
903 const
904 TVS_NOTOOLTIPS = $0080;
905 var
906 FileName: string;
907 Style: DWORD;
908 msg: string;
909 i: Integer;
910 wp: TWindowPlacement;
911 begin
912 {$IFDEF DEBUG}
913 AllocConsole;
914 Writeln('============================================================');
915 Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
916 Writeln('');
917 Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
918 Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
919 Writeln('============================================================');
920 {$ENDIF}
921 //try
922 Sort.SetSortDate(Now());
923
924 FTreeType := gttNone;
925 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
926 FStartUp := true;
927 Application.HookMainWindow(Hook);
928 FIsIgnoreResize := rtResizing;
929 //ActionList鐃緒申GuoupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?0鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
930 //(鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申Down鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申)
931 //鐃緒申鐃緒申鐃緒申鐃緒申Set鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?Action鐃緒申Checked鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
932 GetGroupIndex(GikoDM.GikoFormActionList);
933 FSearchDialog := nil;
934 FResPopupBrowser := nil;
935 CreateBrowsers(BROWSER_COUNT);
936 FIconData.uID := 0;
937 FUpdateExePath := '';
938 FUpdateExeArgs := '';
939
940 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
941 SetMenuFont;
942
943 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
944 Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
945
946 // 鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
947 LoadIcon;
948
949 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
950 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
951
952 EnabledCloseButton := True;
953
954 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
955 ListView.ViewStyle := GikoSys.Setting.ListStyle;
956
957 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
958 AnimePanel.Top := 0;
959 AnimePanel.Left := 0;
960
961 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
962
963 //鐃?鐃緒申鐃?鐃?鐃?鐃?
964 CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
965
966 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
967 GikoDM.MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
968 GikoDM.MsgBarVisibleActionExecute(nil);
969 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
970
971 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
972 GikoDM.StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
973 GikoDM.StatusBarVisibleActionExecute(nil);
974
975 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
976 TreeView.Items.BeginUpdate;
977 FavoriteTreeView.Items.BeginUpdate;
978 ListView.Items.BeginUpdate;
979 try
980 TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
981 TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
982 TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
983 TreeView.Color := GikoSys.Setting.CabinetBackColor;
984 FavoriteTreeView.Font.Assign(TreeView.Font);
985 FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
986
987 ListView.Font.Name := GikoSys.Setting.ListFontName;
988 ListView.Font.Size := GikoSys.Setting.ListFontSize;
989 ListView.Font.Color := GikoSys.Setting.ListFontColor;
990 ListView.Font.Style := [];
991 if GikoSys.Setting.ListFontBold then
992 ListView.Font.Style := [fsbold];
993 if GikoSys.Setting.ListFontItalic then
994 ListView.Font.Style := ListView.Font.Style + [fsitalic];
995
996 ListViewBackGroundColor := clWhite; // 鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
997 ListViewBackGroundColor := GikoSys.Setting.ListBackColor; // 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
998 FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
999 FOddColor := GikoSys.Setting.OddColor;
1000
1001 finally
1002 TreeView.Items.EndUpdate;
1003 FavoriteTreeView.Items.EndUpdate;
1004 ListView.Items.EndUpdate;
1005 end;
1006 //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
1007 GikoDM.ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
1008
1009 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1010 GikoDM.MuteAction.Checked := GikoSys.Setting.Mute;
1011
1012 // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1013 FResRangeMenuSelect := GikoSys.ResRange;
1014 case GikoSys.ResRange of
1015 Ord( grrAll ):
1016 begin
1017 GikoDM.AllResAction.Execute;
1018 end;
1019 Ord( grrSelect ):
1020 begin
1021 SelectComboBox.Text := SelectComboBox.Items[ 1 ];
1022 GikoDM.SelectResAction.Checked := True;
1023 end;
1024 else
1025 case FResRangeMenuSelect of
1026 Ord( grrKoko ): GikoDM.OnlyKokoResAction.Checked := True;
1027 Ord( grrNew ): GikoDM.OnlyNewResAction.Checked := True;
1028 100: GikoDM.OnlyAHundredResAction.Checked := True;
1029 end;
1030 end;
1031
1032 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1033 case GikoSys.Setting.ThreadRange of
1034 gtrAll:
1035 begin
1036 GikoDM.AllItemAction.Checked := True;
1037 ViewType := gvtAll;
1038 end;
1039 gtrLog:
1040 begin
1041 GikoDM.LogItemAction.Checked := True;
1042 ViewType := gvtLog;
1043 end;
1044 gtrNew:
1045 begin
1046 GikoDM.NewItemAction.Checked := True;
1047 ViewType := gvtNew;
1048 end;
1049 gtrLive:
1050 begin
1051 GikoDM.LiveItemAction.Checked := True;
1052 ViewType := gvtLive;
1053 end;
1054 gtrArch:
1055 begin
1056 GikoDM.ArchiveItemAction.Checked := True;
1057 ViewType := gvtArch;
1058 end;
1059 end;
1060
1061
1062 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1063 BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1064 BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1065 BrowserTab.Font.Style := [];
1066 if GikoSys.Setting.BrowserTabFontBold then
1067 BrowserTab.Font.Style := [fsBold];
1068 if GikoSys.Setting.BrowserTabFontItalic then
1069 BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic];
1070
1071 BrowserTab.DoubleBuffered := True;
1072 FDragWFirst := false;
1073 SetContent(BrowserNullTab); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1074
1075 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1076 GikoDM.BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1077
1078 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1079 GikoDM.BrowserTabTopAction.Checked := True;
1080 end else begin
1081 GikoDM.BrowserTabBottomAction.Checked := True;
1082 end;
1083
1084 if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1085 GikoDM.BrowserTabTabStyleAction.Checked := True;
1086 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1087 GikoDM.BrowserTabButtonStyleAction.Checked := True;
1088 end else begin
1089 GikoDM.BrowserTabFlatStyleAction.Checked := True;
1090 end;
1091
1092 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1093 ProgressBar.Parent := StatusBar;
1094 ProgressBar.Top := 2;
1095 ProgressBar.Left := 0;
1096 ProgressBar.Width := StatusBar.Panels[0].Width;
1097 ProgressBar.Height := StatusBar.Height - 2;
1098 ProgressBar.Position := 0;
1099
1100 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1101 InitializeBoardPlugIns;
1102
1103 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申(ReadFavorite 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1104 GikoSys.ListBoardFile;
1105 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申
1106 try
1107 // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1108 if (SplashWindow <> nil) then begin
1109 SplashWindow.ProgressBar.Max := Length(BBSs) * 20;
1110 end;
1111 except
1112 end;
1113 // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1114 for i := Length(BBSs) - 1 downto 0 do begin
1115 if not BBSs[i].IsBoardFileRead then
1116 GikoSys.ReadBoardFile(BBSs[i]);
1117
1118 if SplashWindow <> nil then begin
1119 SplashWindow.ProgressBar.StepBy(20);
1120 SplashWindow.Update;
1121 end;
1122 end;
1123
1124 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1125 RoundList := TRoundList.Create;
1126 RoundList.LoadRoundBoardFile;
1127 RoundList.LoadRoundThreadFile;
1128
1129 //TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申
1130 Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
1131 Style := Style or TVS_NOTOOLTIPS;
1132 SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
1133
1134 // 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1135 TreeView.Align := alClient;
1136 FavoriteTreeView.Align := alClient;
1137 FavoriteTreeView.Visible := False;
1138
1139 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1140 SetBBSMenu;
1141
1142 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1143 wp.length := sizeof(wp);
1144 wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1145 wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1146 wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1147 wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1148 wp.showCmd := SW_HIDE;
1149 SetWindowPlacement(Handle, @wp);
1150 //Self.Update;
1151
1152 if GikoSys.Setting.WindowMax then
1153 WindowState := wsMaximized;
1154
1155 //鐃?鐃?鐃?鐃?鐃緒申
1156 try
1157 FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1158 if FileExists(FileName) then
1159 Animate.FileName := FileName;
1160 except
1161 end;
1162
1163 //鐃?鐃?鐃?鐃?
1164 FNameCookie := '';
1165 FMailCookie := '';
1166
1167 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1168 FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1169 FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1170
1171
1172 // 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?(LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1173 FHistoryList := THistoryList.Create;
1174
1175 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1176 FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml',
1177 TreeView, FTreeType);
1178
1179 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1180 FavoriteDM.SetFavTreeView(FavoriteTreeView);
1181 FavoriteDM.ReadFavorite;
1182
1183 GikoDM.ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1184 GikoDM.ArrangeAction.Execute;
1185
1186 if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1187 case GikoSys.Setting.ListWidthState of
1188 glsMax: begin
1189 ViewPanel.Width := 1;
1190 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1191 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1192 end;
1193 glsMin: begin
1194 ViewPanel.Width := GikoSys.Setting.ListWidth;
1195 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1196 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1197 end;
1198 else begin
1199 ViewPanel.Width := GikoSys.Setting.ListWidth;
1200 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1201 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1202 end;
1203 end;
1204 end else begin
1205 case GikoSys.Setting.ListHeightState of
1206 glsMax: begin
1207 ViewPanel.Height := 1;
1208 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1209 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1210 end;
1211 glsMin: begin
1212 ViewPanel.Height := GikoSys.Setting.ListHeight;
1213 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1214 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1215 end;
1216 else begin
1217 ViewPanel.Height := GikoSys.Setting.ListHeight;
1218 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1219 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1220 end;
1221 end;
1222 end;
1223
1224 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1225 CreateControlThread();
1226
1227 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1228 SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1229
1230 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1231 SetBrowserTabState;
1232
1233 BrowserBoardNameLabel.Caption := '';
1234 BrowserNameLabel.Caption := '';
1235 FWorkCount := 0;
1236
1237 FTabHintIndex := -1;
1238
1239 //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1240 ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1241 BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1242
1243 MakeDefaultINIFile();
1244 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1245 ReadToolBarSetting(GikoDM.GikoFormActionList, StdToolBar);
1246 ReadToolBarSetting(GikoDM.GikoFormActionList, ListToolBar);
1247 ReadToolBarSetting(GikoDM.GikoFormActionList, BrowserToolBar);
1248 SetToolBarPopup;
1249
1250 //ListToolBar鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申ComboBox鐃緒申鐃?鐃?
1251 SetSelectComboBox();
1252
1253 //鐃?鐃?鐃緒申鐃?鐃?鐃?
1254 AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1255
1256 //鐃緒申鐃緒申鐃?鐃?鐃?
1257 SetLinkBar;
1258 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1259
1260 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1261 if not FileExists(GikoSys.GetBoardFileName) then begin
1262 msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1263 + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1264 + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1265 MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1266 GikoDM.NewBoardAction.Execute;
1267 end;
1268
1269 //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1270 GikoSys.LoadKeySetting(GikoDM.GikoFormActionList, GikoSys.GetMainKeyFileName);
1271
1272 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1273 // FLastRoundTime := 0;
1274
1275 ListView.OnData := TListViewUtils.ListViewData;
1276
1277 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1278 CabinetVisible( False );
1279 if GikoSys.Setting.CabinetVisible then begin
1280 i := CabinetSelectPopupMenu.Items.Count - 1;
1281 if GikoSys.Setting.CabinetIndex = i - 1 then
1282 GikoDM.CabinetHistoryAction.Execute
1283 else if GikoSys.Setting.CabinetIndex = i then
1284 GikoDM.CabinetFavoriteAction.Execute
1285 else begin
1286 if GikoSys.Setting.CabinetIndex < Length( BBSs ) then
1287 ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] );
1288 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 2
1289 FIsIgnoreResize := rtResizing;
1290 GikoDM.CabinetBBSAction.Execute;
1291 end;
1292 end else begin
1293 ShowBBSTreeOld( BBSs[ 0 ] );
1294 PostMessage( Handle, USER_TREECLICK, 0, 0 );
1295 end;
1296
1297 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1298 for i := 1 to ParamCount do begin
1299 MoveToURL(ParamStr(i));
1300 end;
1301
1302 GikoDM.RepaintStatusBar;
1303 StatusBarResize(Sender);
1304
1305 dummy1.Caption := ItemReservPMenu.Caption;
1306 dummy1.Hint := ItemReservPMenu.Hint;
1307
1308 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1309 MouseGesture := TMouseGesture.Create;
1310
1311 {$IFDEF SPAM_FILTER_ENABLED}
1312 // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1313 GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
1314 {$ENDIF}
1315
1316 //2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1317 GikoSys.SetGikoMessage;
1318
1319 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1320 if GikoSys.Setting.AutoLogin then
1321 GikoDM.LoginAction.Execute;
1322
1323 GikoSys.Setting.BeLogin := GikoSys.Setting.BeAutoLogin;
1324
1325 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1326 FavoriteAddToolButton.Caption := '鐃緒申鐃緒申...';
1327 AntiIndivAbonMenuItem.Caption := '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申';
1328
1329 //鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1330 InputAssistDM.Init(GikoSys.GetInputAssistFileName);
1331
1332 //鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1333 ReplaceDM.LoadFromFile(GikoSys.GetReplaceFileName);
1334
1335 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?
1336 ResPopupClearTimer.Interval := GikoSys.Setting.RespopupWait;
1337
1338 // D&D鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1339 DragAcceptFiles(ListView.Handle, True);
1340
1341 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?
1342 if (FavoriteDM.AbEnd) then begin
1343 GikoUtil.MsgBox(Self.Handle, '鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?',
1344 '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
1345 Self.Close;
1346 end;
1347
1348 end;
1349
1350 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1351 procedure TGikoForm.SaveCoolBarSettings;
1352 begin
1353
1354 if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then
1355 Exit;
1356 SaveMainCoolBarSettings;
1357 SaveBoardCoolBarSettings;
1358 SaveBrowserCoolBarSettings;
1359
1360 end;
1361 procedure TGikoForm.SaveMainCoolBarSettings;
1362 var
1363 i : Integer;
1364 CoolSet : TCoolSet;
1365 begin
1366 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1367 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1368 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1369 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1370 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1371 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1372 end;
1373 end;
1374 procedure TGikoForm.SaveBoardCoolBarSettings;
1375 var
1376 i : Integer;
1377 CoolSet : TCoolSet;
1378 begin
1379 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1380 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1381 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1382 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1383 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1384 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1385 end;
1386 end;
1387 procedure TGikoForm.SaveBrowserCoolBarSettings;
1388 var
1389 i : Integer;
1390 CoolSet : TCoolSet;
1391 begin
1392 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1393 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1394 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1395 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1396 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1397 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1398 end;
1399 end;
1400 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1401 procedure TGikoForm.LoadCoolBarSettings;
1402 var
1403 i : Integer;
1404 CoolSet : TCoolSet;
1405 begin
1406
1407 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1408 MainCoolBar.Bands.BeginUpdate;
1409 try
1410 // for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1411 for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin
1412 CoolSet := GikoSys.Setting.MainCoolSet[i];
1413 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1414 FIsIgnoreResize := rtNone;
1415 SaveCoolBarSettings;
1416 Exit;
1417 end;
1418 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1419 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1420 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1421 end;
1422 finally
1423 MainCoolBar.Bands.EndUpdate;
1424 end;
1425
1426 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1427 ListCoolBar.Bands.BeginUpdate;
1428 try
1429 // for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1430 for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin
1431 CoolSet := GikoSys.Setting.ListCoolSet[i];
1432 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1433 FIsIgnoreResize := rtNone;
1434 SaveCoolBarSettings;
1435 Exit;
1436 end;
1437 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1438 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1439 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1440 end;
1441 finally
1442 ListCoolBar.Bands.EndUpdate;
1443 end;
1444
1445 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1446 BrowserCoolBar.Bands.BeginUpdate;
1447 try
1448 // for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1449 for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
1450 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1451 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1452 FIsIgnoreResize := rtNone;
1453 SaveCoolBarSettings;
1454 Exit;
1455 end;
1456 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1457 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1458 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1459 end;
1460 finally
1461 BrowserCoolBar.Bands.EndUpdate;
1462 end;
1463
1464 end;
1465 //
1466 procedure TGikoForm.FormShow(Sender: TObject);
1467 var
1468 item : TThreadItem;
1469 begin
1470 if FStartUp then begin
1471 ShowWindow(Application.Handle, SW_HIDE);
1472
1473 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1474 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1475 GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1476 GikoDM.StdToolBarVisibleActionExecute( nil );
1477 GikoDM.AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1478 GikoDM.AddressBarVisibleActionExecute( nil );
1479 GikoDM.LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1480 GikoDM.LinkBarVisibleActionExecute( nil );
1481 GikoDM.ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1482 GikoDM.ListToolBarVisibleActionExecute( nil );
1483 GikoDM.ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1484 GikoDM.ListNameBarVisibleActionExecute( nil );
1485 GikoDM.BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1486 GikoDM.BrowserToolBarVisibleActionExecute( nil );
1487 GikoDM.BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1488 GikoDM.BrowserNameBarVisibleActionExecute( nil );
1489
1490 // CoolBar 鐃緒申鐃緒申
1491 LoadCoolBarSettings;
1492
1493 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1494 // ResetBandInfo( ListCoolBar, ListToolBar );
1495 FIsIgnoreResize := rtNone;
1496
1497 //FormCrete鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1498 if GikoSys.Setting.TabAutoLoadSave then begin
1499 GikoDM.TabsOpenAction.Tag := 1;
1500 GikoDM.TabsOpenAction.Execute;
1501 GikoDM.TabsOpenAction.Tag := 0;
1502 if (GikoSys.Setting.LastCloseTabURL <> '') then begin
1503 if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
1504 PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 );
1505 end;
1506 if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
1507 while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and
1508 (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
1509 Application.ProcessMessages;
1510 end;
1511 end;
1512 item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL );
1513 if (item <> nil) and (item.IsLogFile) then begin
1514 OpenThreadItem(item, item.URL);
1515 end;
1516 GikoSys.Setting.LastCloseTabURL := '';
1517 end;
1518 end;
1519
1520 //ActionList鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1521 SetGroupIndex(GikoDM.GikoFormActionList);
1522
1523 FStartUp := false;
1524 end;
1525 end;
1526
1527 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1528 begin
1529 // if GikoForm.WindowState <> wsMinimized then
1530 // SaveCoolBarSettings;
1531 CanClose := True;
1532 if ( GikoSys.Setting.ShowDialogForEnd ) and
1533 (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1534 CanClose := false;
1535 Exit;
1536 end;
1537
1538 GikoSys.Setting.LastCloseTabURL := '';
1539 if GikoSys.Setting.TabAutoLoadSave then begin
1540 GikoDM.TabsSaveAction.Execute;
1541 if (GetActiveContent <> nil) and
1542 (GetActiveContent.IsLogFile) then begin
1543 GikoSys.Setting.LastCloseTabURL := GetActiveContent.URL;
1544 end;
1545 end;
1546
1547 if (SearchDialog <> nil) then begin
1548 if (SearchDialog.Visible) then begin
1549 SearchDialog.Close;
1550 end;
1551 try
1552 SearchDialog.Release;
1553 except
1554 end;
1555 SearchDialog := nil;
1556 end;
1557
1558 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?EditorForm鐃緒申鐃緒申鐃緒申鐃緒申
1559 GikoDM.CloseAllEditorAction.Execute;
1560
1561 Application.UnhookMainWindow(Hook);
1562 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1563 FControlThread.DownloadAbort;
1564 FControlThread.Terminate;
1565
1566 //OnDestory鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申OnCloseQuery鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1567 SaveSettingAll();
1568
1569 Application.Terminate;
1570 end;
1571
1572 procedure TGikoForm.SaveSettingAll();
1573 var
1574 wp : TWindowPlacement;
1575 WindowPlacement: TWindowPlacement;
1576 begin
1577 try
1578 ActiveListColumnSave;
1579 except
1580 end;
1581
1582 try
1583 WindowPlacement.length := SizeOf(TWindowPlacement);
1584 GetWindowPlacement(Self.Handle, @WindowPlacement);
1585
1586 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1587 wp.length := sizeof(wp);
1588 GetWindowPlacement(Handle, @wp);
1589 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1590 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1591 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1592 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1593 GikoSys.Setting.WindowMax := (WindowState = wsMaximized) or
1594 (WindowPlacement.flags = WPF_RESTORETOMAXIMIZED);
1595 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1596 GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked;
1597 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1598 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1599 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1600 if GikoDM.ArrangeAction.Checked then
1601 GikoSys.Setting.ListOrientation := gloVertical
1602 else
1603 GikoSys.Setting.ListOrientation := gloHorizontal;
1604 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1605 except
1606 end;
1607
1608 try
1609 // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1610 if not GikoSys.Setting.ResRangeHold then
1611 GikoSys.Setting.ResRange := FResRangeMenuSelect;
1612 except
1613 end;
1614 //鐃緒申鐃緒申winodw鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申CoolBar鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1615 SaveCoolBarSettings;
1616 GikoSys.Setting.WriteWindowSettingFile;
1617 // 鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1618 GikoSys.Setting.WriteNameMailSettingFile;
1619
1620 //鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1621 InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName);
1622
1623 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1624 try
1625 //FavoriteDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1626 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1627 if not (FavoriteDM.AbEnd) then begin
1628 FavoriteDM.WriteFavorite;
1629 end;
1630 except
1631 end;
1632
1633 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1634 try
1635 //AddressHistoryDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1636 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
1637 except
1638 end;
1639
1640 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1641 try
1642 FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
1643 except
1644 end;
1645
1646 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1647 try
1648 RoundList.SaveRoundFile;
1649 except
1650 end;
1651
1652 // 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1653 if (FIconData.uID <> 0) then begin
1654 Shell_NotifyIcon(NIM_DELETE, @FIconData);
1655 end;
1656
1657 end;
1658
1659 procedure TGikoForm.FormDestroy(Sender: TObject);
1660 var
1661 i : Integer;
1662 tmpBool : Boolean;
1663 begin
1664 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申CoolBar鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1665 //鐃緒申鐃緒申鐃緒申鐃?OnDestroy鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1666 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1667 if WindowState <> wsNormal then begin
1668 WindowState := wsNormal;
1669 try
1670 SaveCoolBarSettings;
1671 GikoSys.Setting.WriteWindowSettingFile;
1672 except
1673 end;
1674 end;
1675
1676 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1677 try
1678 if GikoSys.Setting.GestureEnabled then begin
1679 MouseGesture.OnGestureStart := nil;
1680 MouseGesture.OnGestureMove := nil;
1681 MouseGesture.OnGestureEnd := nil;
1682 end;
1683 MouseGesture.Clear;
1684 MouseGesture.UnHook;
1685 MouseGesture.Free;
1686 except
1687 end;
1688
1689 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1690 try
1691 FavoriteDM.Clear;
1692 except
1693 end;
1694
1695 try
1696 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1697 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1698 GikoSys.Setting.ShowDialogForAllTabClose := false;
1699 GikoDM.AllTabCloseAction.Execute;
1700 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1701 except
1702 end;
1703
1704 try
1705 for i := FBrowsers.Count - 1 downto 0 do begin
1706 GikoSys.ShowRefCount('browser' + IntToStr(i), TWebBrowser(FBrowsers[i]).ControlInterface);
1707 GikoSys.ShowRefCount('document' + IntToStr(i), TWebBrowser(FBrowsers[i]).ControlInterface.Document);
1708 end;
1709
1710 for i := FBrowsers.Count - 1 downto 0 do begin
1711 TWebBrowser(FBrowsers[i]).Free;
1712 end;
1713 FBrowsers.Clear;
1714 FBrowsers.Capacity := 0;
1715 finally
1716 FBrowsers.Free;
1717 end;
1718
1719 try
1720 if BrowserNullTab <> nil then begin
1721 BrowserNullTab.Browser := nil; {*BrowserNullTab鐃緒申Browser鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
1722 *鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Free鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1723 *}
1724 BrowserNullTab.Free;
1725 end;
1726 except
1727 end;
1728
1729 try
1730 TreeView.Items.BeginUpdate;
1731 TreeView.Items.GetFirstNode.Free;
1732 TreeView.Items.Clear;
1733 TreeView.Items.EndUpdate;
1734 except
1735 end;
1736
1737 try
1738 try
1739 FHistoryList.Clear;
1740 except
1741 end;
1742 finally
1743 FHistoryList.Free;
1744 end;
1745
1746
1747 try
1748 try
1749 RoundList.Clear;
1750 except
1751 end;
1752 finally
1753 RoundList.Free;
1754 end;
1755
1756 try
1757 try
1758 //FControlThread.DownloadAbort;
1759 FControlThread.Terminate;
1760 FControlThread.WaitFor;
1761 except
1762 end;
1763 finally
1764 FControlThread.Free;
1765 end;
1766 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1767 for i := GikoForm.PlugInMenu.Count - 1 downto 0 do begin
1768 GikoForm.PlugInMenu.items[i].Free;
1769 end;
1770 GikoForm.PlugInMenu.Clear;
1771
1772
1773 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1774 // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1775 // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1776 for i := Length(BoardGroups) - 1 downto 0 do begin
1777 //BoardGroups[i].Clear;
1778 BoardGroups[i].Free;
1779 end;
1780
1781 try
1782 for i := Length( BBSs ) - 1 downto 0 do begin
1783 if BBSs[ i ] <> nil then
1784 BBSs[ i ].Free;
1785 BBSs[ i ] := nil;
1786 end;
1787 DestorySpecialBBS(BoardGroup.SpecialBBS);
1788 except
1789 end;
1790
1791 try
1792 if FEvent <> nil then
1793 FEvent.Free;
1794
1795 try
1796 if FResPopupBrowser <> nil then begin
1797 TOleControl(FResPopupBrowser).Parent := nil;
1798 FResPopupBrowser.Free;
1799 end;
1800
1801 except
1802 end;
1803 //Preview鐃?鐃緒申
1804 if FPreviewBrowser <> nil then begin
1805 FPreviewBrowser.Free;
1806 FPreviewBrowser := nil;
1807 end;
1808 except
1809 end;
1810
1811 // Update鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申
1812 if FileExists(FUpdateExePath) then begin
1813 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1814 GikoSys.CreateProcess(FUpdateExePath, FUpdateExeArgs);
1815 end;
1816 end;
1817
1818 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1819 procedure TGikoForm.SetBBSMenu;
1820 var
1821 i : Integer;
1822 item : TBBSMenuItem;
1823 begin
1824
1825 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1826 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1827 try
1828 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1829 CabinetSelectPopupMenu.Items[ i ].Free;
1830 CabinetMenu.Items[ i ].Free;
1831 BBSSelectPopupMenu.Items[ i ].Free;
1832 end;
1833 except
1834 end;
1835 end;
1836
1837 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1838 for i := Length( BBSs ) - 1 downto 0 do begin
1839 try
1840 item := TBBSMenuItem.Create( PopupMenu );
1841 item.Caption := BBSs[ i ].Title;
1842 item.Data := BBSs[ i ];
1843 item.OnClick := BBSMenuItemOnClick;
1844 CabinetSelectPopupMenu.Items.Insert( 0, item );
1845 item := TBBSMenuItem.Create( PopupMenu );
1846 item.Caption := BBSs[ i ].Title;
1847 item.Data := BBSs[ i ];
1848 item.OnClick := BBSMenuItemOnClick;
1849 CabinetMenu.Insert( 0, item );
1850 item := TBBSMenuItem.Create( PopupMenu );
1851 item.Caption := BBSs[ i ].Title;
1852 item.Data := BBSs[ i ];
1853 item.OnClick := BBSMenuItemOnClick;
1854 BBSSelectPopupMenu.Items.Insert( 0, Item );
1855 except
1856 end;
1857 end;
1858
1859 end;
1860
1861 procedure TGikoForm.ReloadBBS;
1862 var
1863 i : Integer;
1864 tmpBool: Boolean;
1865 begin
1866 LockWindowUpdate(Self.Handle);
1867
1868 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1869 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1870 GikoSys.Setting.ShowDialogForAllTabClose := false;
1871 GikoDM.AllTabCloseAction.Execute;
1872 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1873 SetContent(BrowserNullTab);
1874 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1875 TreeView.Items.Clear;
1876
1877 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1878 try
1879 RoundList.SaveRoundFile;
1880 except
1881 end;
1882 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1883 try
1884 RoundList.Clear;
1885 except
1886 end;
1887
1888 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1889 try
1890 FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
1891 FHistoryList.Clear;
1892 except
1893 end;
1894
1895 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1896 try
1897 FavoriteDM.WriteFavorite;
1898 FavoriteDM.Clear;
1899 except
1900 end;
1901
1902 //鐃緒申鐃?鐃?鐃緒申鐃?PLUGIN鐃緒申鐃?鐃緒申
1903 for i := Length(BoardGroups) - 1 downto 0 do begin
1904 try
1905 BoardGroups[i].Free;
1906 except
1907 end;
1908 end;
1909 //BBS鐃?鐃緒申
1910 try
1911 for i := Length( BBSs ) - 1 downto 0 do begin
1912 if BBSs[ i ] <> nil then
1913 BBSs[ i ].Free;
1914 BBSs[ i ] := nil;
1915 end;
1916 except
1917 end;
1918
1919 ActiveList := nil;
1920
1921 FTreeType := gttNone;
1922
1923 //============鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申================================//
1924
1925 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1926 InitializeBoardPlugIns;
1927
1928 GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1929
1930 // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1931 for i := Length(BBSs) - 1 downto 0 do begin
1932 if not BBSs[i].IsBoardFileRead then
1933 GikoSys.ReadBoardFile(BBSs[i]);
1934 end;
1935
1936 // BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1937 SetBBSMenu;
1938
1939 ShowBBSTree( BBSs[ 0 ] );
1940
1941 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1942 FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml',
1943 TreeView, FTreeType);
1944
1945 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1946 FavoriteDM.ReadFavorite;
1947
1948 SetLinkBar;
1949
1950 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1951 RoundList.LoadRoundBoardFile;
1952 RoundList.LoadRoundThreadFile;
1953
1954 LockWindowUpdate(0);
1955 end;
1956
1957 {!
1958 \todo 鐃緒申鐃緒申 IE 7 鐃緒申鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1959 (IE 7 鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申)
1960 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1961 }
1962 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
1963 var
1964 p: TPoint;
1965 s: string;
1966 tmp2: string;
1967 URL: string;
1968 ATitle: Boolean;
1969
1970 threadItem : TThreadItem;
1971 board : TBoard;
1972 Protocol, Host, Path, Document, Port, Bookmark: string;
1973
1974 wkInt: Integer;
1975 wkIntSt: Integer;
1976 wkIntTo: Integer;
1977 ActiveFileName: string;
1978 e: IHTMLElement;
1979 Ext: string;
1980 PathRec: TPathRec;
1981 Text2: string;
1982 cResPopup: TResPopupBrowser;
1983 senderBrowser :TWebBrowser;
1984 doc: IHTMLDocument2;
1985 begin
1986 // 鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申 about:blank.. 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1987 // IE 7 鐃緒申鐃緒申 about:blank.. 鐃緒申鐃緒申鐃緒申鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申鐃緒申鐃緒申)
1988 if Pos('about:..', Text) = 1 then
1989 Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) )
1990 else
1991 Text2 := Text;
1992
1993 if not( TObject(Sender) is TWebBrowser )then
1994 Exit;
1995
1996 senderBrowser := TWebBrowser(Sender);
1997 doc := senderBrowser.ControlInterface.Document as IHTMLDocument2;
1998
1999 try
2000 try
2001 if ((not senderBrowser.Busy) and Assigned(doc)) then begin
2002 if LowerCase(doc.charset) <> 'shift_jis' then begin
2003 doc.charset := 'shift_jis';
2004 end;
2005 end;
2006 except
2007 end;
2008 finally
2009 end;
2010
2011 if PreviewTimer.Enabled then
2012 PreviewTimer.Enabled := False;
2013
2014 Application.CancelHint;
2015
2016 try
2017 if GetActiveContent <> nil then
2018 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2019 else
2020 ActiveFileName := '';
2021 except
2022 FActiveContent := nil;
2023 Exit;
2024 end;
2025
2026 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
2027 if (StatusBar.Panels[1].Text = Text2) then begin
2028 if Text2 = '' then begin
2029 if FResPopupBrowser <> nil then begin
2030 if not(Sender is TResPopupBrowser) then
2031 FResPopupBrowser.Clear
2032 else begin
2033 TResPopupBrowser(Sender).ChildClear;
2034 end;
2035 end;
2036 end;
2037 Exit;
2038 end;
2039 StatusBar.Panels[1].Text := Text2;
2040
2041
2042 if FPreviewBrowser <> nil then
2043 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2044
2045 if FResPopupBrowser <> nil then begin
2046 if not(Sender is TResPopupBrowser) then begin
2047 if (FResPopupBrowser.Visible) then begin
2048 if ResPopupClearTimer.Interval > 0 then begin
2049 ResPopupClearTimer.Enabled := True;
2050 ResPopupClearTimer.Tag := 0;
2051 end else begin
2052 FResPopupBrowser.Clear;
2053 end;
2054 end;
2055 end else begin
2056 if ResPopupClearTimer.Interval > 0 then begin
2057 ResPopupClearTimer.Enabled := True;
2058 ResPopupClearTimer.Tag := 1;
2059 end else begin
2060 TResPopupBrowser(Sender).ChildClear;
2061 end;
2062 end;
2063 end;
2064 cResPopup := nil;
2065
2066 if not(Sender is TResPopupBrowser) then
2067 if not GikoSys.Setting.UnActivePopup then
2068 if not GikoForm.Active then
2069 Exit;
2070
2071
2072
2073 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2074 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2075 // 鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申URL鐃緒申鐃?鐃?
2076 if (ExtPreviewDM.PreviewURL(Text2)) then begin
2077 Exit;
2078 end;
2079 s := '';
2080 Ext := AnsiLowerCase(ExtractFileExt(Text2));
2081 if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
2082 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2083 if FPreviewBrowser = nil then begin
2084 FPreviewBrowser := TPreviewBrowser.Create(Self);
2085 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2086 TOleControl(FPreviewBrowser).Parent := nil;
2087 end;
2088 FPreviewBrowser.Navigate(BLANK_HTML);//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2089 FPreviewURL := Text2;
2090 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2091 PreviewTimer.Enabled := True;
2092 end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin
2093 if (Pos('mailto:', Text2) = 1) and (GikoSys.Setting.RespopupMailTo) then begin
2094 s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]);
2095 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2096 GetCursorPos(p);
2097 p.x := p.x - senderBrowser.ClientOrigin.x;
2098 p.y := p.y - senderBrowser.ClientOrigin.y;
2099 e := doc.elementFromPoint(p.x, p.y);
2100 if (Assigned(e)) then begin
2101 CreateResPopupBrowser;
2102
2103 if not(Sender is TResPopupBrowser) then begin
2104 if (FResPopupBrowser.Visible) then begin
2105 FResPopupBrowser.Clear;
2106 end;
2107 end else begin
2108 TResPopupBrowser(Sender).ChildClear;
2109 end;
2110
2111 cResPopup := FResPopupBrowser.CreateNewBrowser;
2112 tmp2 := Trim(ZenToHan(e.Get_outerText));
2113 if (GikoSys.IsNumeric(tmp2)) then begin
2114 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2115 wkIntSt := StrToInt64(tmp2);
2116 wkIntTo := StrToInt64(tmp2);
2117 cResPopup.PopupType := gptThread;
2118 HTMLCreater.SetResPopupText(cResPopup, GetActiveContent(true), wkIntSt, wkIntTo, False, False);
2119 end else begin
2120 cResPopup.PopupType := gptRaw;
2121 cResPopup.Title := s;
2122 end;
2123 end;
2124 end else begin
2125 CreateResPopupBrowser;
2126
2127 if not(Sender is TResPopupBrowser) then begin
2128 if (FResPopupBrowser.Visible) then begin
2129 FResPopupBrowser.Clear;
2130 end;
2131 end else begin
2132 TResPopupBrowser(Sender).ChildClear;
2133 end;
2134
2135 threadItem := GetActiveContent(true);
2136 URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL);
2137 PathRec := Gikosys.Parse2chURL2(URL);
2138 if (PathRec.FNoParam) then begin
2139 PathRec.FSt := 1;
2140 PathRec.FTo := 1;
2141 end else begin
2142 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2143 end;
2144 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2145
2146 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
2147
2148 URL := GikoSys.GetBrowsableThreadURL( URL );
2149 wkIntSt := PathRec.FSt;
2150 wkIntTo := PathRec.FTo;
2151
2152 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2153 wkIntSt := 1;
2154 wkIntTo := 1;
2155 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2156 wkIntSt := wkIntTo;
2157 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2158 wkIntTo := wkIntSt;
2159 end else if wkIntSt > wkIntTo then begin
2160 wkInt := wkIntTo;
2161 wkIntTo := wkIntSt;
2162 wkIntSt := wkInt;
2163 end;
2164 if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
2165 ATitle := false
2166 else
2167 ATitle := true;
2168
2169 threadItem := BBSsFindThreadFromURL( URL );
2170
2171 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2172 board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2173 if board <> nil then begin
2174 if not board.IsThreadDatRead then
2175 GikoSys.ReadSubjectFile( board );
2176 threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
2177 end;
2178 end;
2179
2180 if threadItem <> nil then begin
2181 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2182 //URL鐃緒申鐃緒申鐃緒申鐃緒申/鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2183 if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin
2184 wkIntSt := 1;
2185 wkIntTo := 1;
2186 end;
2187 cResPopup := FResPopupBrowser.CreateNewBrowser;
2188 cResPopup.PopupType := gptThread;
2189 HTMLCreater.SetResPopupText(cResPopup, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2190 end;
2191 end;
2192 end;
2193 if (cResPopup <> nil) then begin
2194 ResPopupClearTimer.Enabled := False;
2195
2196 if cResPopup.PopupType = gptRaw then begin
2197 if cResPopup.Title <> '' then begin
2198 cResPopup.TitlePopup;
2199 end;
2200 end else begin
2201 if cResPopup.RawDocument <> '' then begin
2202 cResPopup.Popup;
2203 end else if cResPopup.Title <> '' then begin
2204 cResPopup.TitlePopup;
2205 end;
2206 end;
2207 end;
2208 end;
2209 end;
2210
2211 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2212 var
2213 SysMenu: HMenu;
2214 begin
2215 FEnabledCloseButton := Enabled;
2216 SysMenu := GetSystemMenu(Handle, False);
2217
2218 if Enabled then begin
2219 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2220 end else begin
2221 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2222 end;
2223
2224 DrawMenuBar(Handle);
2225 end;
2226
2227 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2228 var AllowChange: Boolean);
2229 begin
2230 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2231 // if FTreeType = gtt2ch then
2232 // FSortIndex := -1;
2233 end;
2234
2235 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2236 Shift: TShiftState);
2237 var
2238 pos : TPoint;
2239 begin
2240 if GetActiveList is TBoard then begin
2241 case Key of
2242 VK_BACK:; // UpFolderButtonClick(Sender);
2243 VK_SPACE: ListDoubleClick(Shift);
2244 VK_RETURN: ListClick;
2245 VK_APPS:
2246 begin
2247 if ListView.Selected <> nil then begin
2248 pos.X := ListView.Column[ 0 ].Width;
2249 pos.Y := ListView.Selected.Top;
2250 end else begin
2251 pos.X := ListView.Left;
2252 pos.Y := ListView.Top;
2253 end;
2254 Windows.ClientToScreen( ListView.Handle, pos );
2255 ListPopupMenu.Popup( pos.X, pos.Y );
2256 end;
2257 end;
2258 end else begin // TBBS, TCategory
2259 case Key of
2260 VK_BACK:; // UpFolderButtonClick(Sender);
2261 VK_SPACE: ListClick;
2262 VK_RETURN: ListDoubleClick(Shift);
2263 VK_APPS:
2264 begin
2265 if ListView.Selected <> nil then begin
2266 pos.X := ListView.Column[ 0 ].Width;
2267 pos.Y := ListView.Selected.Top;
2268 end else begin
2269 pos.X := ListView.Left;
2270 pos.Y := ListView.Top;
2271 end;
2272 Windows.ClientToScreen( ListView.Handle, pos );
2273 ListPopupMenu.Popup( pos.X, pos.Y );
2274 end;
2275 end;
2276 end;
2277 end;
2278
2279 function TGikoForm.GetHttpState: Boolean;
2280 begin
2281 Result := FHttpState;
2282 end;
2283
2284 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2285 Column: TListColumn);
2286 var
2287 id, idx : Integer;
2288 orderList : TList;
2289 vSortIndex : Integer;
2290 vSortOrder : Boolean;
2291 begin
2292 idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
2293 if TObject( FActiveList ) is TBBS then begin
2294 orderList := GikoSys.Setting.BBSColumnOrder;
2295 vSortIndex := GikoSys.Setting.BBSSortIndex;
2296 vSortOrder := GikoSys.Setting.BBSSortOrder;
2297 end else if TObject( FActiveList ) is TCategory then begin
2298 orderList := GikoSys.Setting.CategoryColumnOrder;
2299 vSortIndex := GikoSys.Setting.CategorySortIndex;
2300 vSortOrder := GikoSys.Setting.CategorySortOrder;
2301 end else if TObject( FActiveList ) is TBoard then begin
2302 orderList := GikoSys.Setting.BoardColumnOrder;
2303 vSortIndex := GikoSys.Setting.BoardSortIndex;
2304 vSortOrder := GikoSys.Setting.BoardSortOrder;
2305 end else
2306 Exit;
2307
2308 id := Integer( orderList[ idx ] );
2309
2310
2311 if vSortIndex = id then
2312 vSortOrder := not vSortOrder
2313 else begin
2314 vSortOrder := id = 0;
2315 end;
2316
2317 TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, vSortOrder);
2318 end;
2319
2320 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2321 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2322 var
2323 ARect: TRect;
2324 begin
2325 DefaultDraw := True;
2326 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Exit鐃緒申鐃緒申鐃緒申鐃緒申
2327 Exit;
2328 DefaultDraw := False;
2329 if (cdsSelected in State) or (cdsHot in State) then begin
2330 Sender.Canvas.Brush.Color := clHighlight;
2331 Sender.Canvas.Font.Color := clHighlightText;
2332 end else begin
2333 Sender.Canvas.Brush.Color := clBtnFace;
2334 Sender.Canvas.Font.Color := clBtnText;
2335 end;
2336 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2337 Sender.Canvas.FillRect(ARect);
2338 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2339 end;
2340
2341 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2342 var
2343 Nodes: TTreeNodes;
2344 i: integer;
2345 begin
2346 Nodes := TreeView.Items;
2347
2348 for i := 0 to Nodes.Count - 1 do begin
2349 if Nodes.Item[i].Data = Data then begin
2350 Result := Nodes.Item[i];
2351 Exit;
2352 end;
2353 end;
2354 Result := nil;
2355 end;
2356
2357 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2358 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2359 Headers: OleVariant; var Cancel: WordBool);
2360 var
2361 sNo: string;
2362 p: TPoint;
2363 const
2364 kMenuName: string = 'menu:';
2365 begin
2366 {$IFDEF DEBUG}
2367 Writeln(URL);
2368 {$ENDIF}
2369 if Pos(kMenuName, URL) <> 0 then begin
2370 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2371
2372 if not GikoSys.IsNumeric(sNo) then Exit;
2373
2374 Cancel := True;
2375 GetCursorpos(p);
2376 KokoPopupMenu.PopupComponent := nil;
2377 if (Sender is TComponent) then
2378 KokoPopupMenu.PopupComponent := TComponent(Sender);
2379 KokoPopupMenu.Tag := StrToInt(sNo);
2380 KokoPopupMenu.Popup(p.x, p.y);
2381 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2382 Cancel := not GikoSys.Setting.OpenMailer;
2383
2384 //@鐃緒申.鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申URL鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2385 //鐃緒申鐃緒申age鐃?sage鐃緒申鐃緒申
2386 if (Pos('@', URL) = 0) or (Pos('.', URL) = 0) then begin
2387 Cancel := True;
2388 end;
2389 end;
2390
2391 end;
2392
2393 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2394 const ARect: TRect; var DefaultDraw: Boolean);
2395 var
2396 NodeRect: TRect;
2397 i, j: Integer;
2398 IsBoardNode: Boolean;
2399 Cnt: Integer;
2400 CntText: string;
2401 TextWidth: Integer;
2402 TextRect: TRect;
2403 Board: TBoard;
2404 Category: TCategory;
2405 Bitmap: TBitmap;
2406 NodeWidth: Integer;
2407 begin
2408 DefaultDraw := True;
2409
2410 if FTreeType = gttHistory then Exit;
2411
2412 TreeView.Canvas.Font.Color := clBlue;
2413 IsBoardNode := False;
2414 for i := 0 to TreeView.Items.Count - 1 do begin
2415 Cnt := 0;
2416 if not TreeView.Items[i].IsVisible then
2417 continue;
2418
2419 if TObject(TreeView.Items[i].Data) is TCategory then begin
2420 if TreeView.Items[i].Expanded then
2421 continue;
2422
2423 IsBoardNode := False;
2424 Category := TCategory(TreeView.Items[i].Data);
2425 for j := 0 to Category.Count - 1 do begin
2426 Board := Category.Items[j];
2427 if Board <> nil then begin
2428 if Board.UnRead > 0 then begin
2429 Cnt := 1;
2430 Break;
2431 end;
2432 end;
2433 end;
2434 if Cnt <> 1 then
2435 continue;
2436 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2437 IsBoardNode := True;
2438 Board := TBoard(TreeView.Items[i].Data);
2439
2440 Cnt := Board.UnRead;
2441 if Cnt <= 0 then
2442 continue;
2443 end else
2444 continue;
2445
2446 Bitmap := TBitmap.Create;
2447 try
2448 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2449 Bitmap.Canvas.Font.Style := [fsBold];
2450 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2451 finally
2452 Bitmap.Free;
2453 end;
2454
2455 NodeRect := TreeView.Items[i].DisplayRect(True);
2456
2457 if IsBoardNode then
2458 CntText := '(' + IntToStr(Cnt) + ')'
2459 else if Cnt = 1 then
2460 CntText := '(+)';
2461
2462
2463 TextWidth := TreeView.Canvas.TextWidth(CntText);
2464
2465 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2466 NodeRect.Top,
2467 NodeRect.Left + NodeWidth + TextWidth + 8,
2468 NodeRect.Bottom);
2469 DrawText(TreeView.Canvas.Handle,
2470 PChar(CntText),
2471 -1,
2472 TextRect,
2473 DT_SINGLELINE or DT_VCENTER);
2474 end;
2475 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2476 end;
2477
2478 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2479 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2480 var
2481 Board: TBoard;
2482 Category: TCategory;
2483 i: Integer;
2484 begin
2485 DefaultDraw := True;
2486
2487 if FTreeType = gttHistory then Exit;
2488
2489 TreeView.Canvas.Font.Style := [];
2490 if Node <> nil then begin
2491 if TObject(Node.Data) is TCategory then begin
2492 Category := TCategory(Node.Data);
2493 for i := 0 to Category.Count - 1 do begin
2494 Board := Category.Items[i];
2495 if Board <> nil then begin
2496 if Board.UnRead > 0 then begin
2497 TreeView.Canvas.Font.Style := [fsBold];
2498 Break;
2499 end;
2500 end;
2501 end;
2502 end else if TObject(Node.Data) is TBoard then begin
2503 Board := TBoard(Node.Data);
2504 if Board.UnRead > 0 then
2505 TreeView.Canvas.Font.Style := [fsBold];
2506 end;
2507 end;
2508 end;
2509
2510 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2511 begin
2512 TreeView.Invalidate;
2513
2514 if TObject(Node.Data) is TBBS then begin
2515 TBBS(Node.Data).NodeExpand := True;
2516 end else if TObject(Node.Data) is TCategory then begin
2517 TCategory(Node.Data).NodeExpand := True;
2518 end else if TObject(Node.Data) is TBoard then begin
2519 TBoard(Node.Data).NodeExpand := True;
2520 end;
2521 end;
2522
2523 procedure TGikoForm.ListViewAllSelect;
2524 begin
2525 ListView.SetFocus;
2526 ListView.SelectAll;
2527 end;
2528 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2529 begin
2530 if csDestroying in Self.ComponentState then
2531 Exit;
2532 AddMessageList(Msg, nil, Icon);
2533 end;
2534 // *************************************************************************
2535 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?
2536 // *************************************************************************
2537 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2538 var
2539 ATitle: string;
2540 s: string;
2541 boardPlugIn : TBoardPlugIn;
2542 i: Integer;
2543 Res : TResRec;
2544 begin
2545 try
2546 if csDestroying in Self.ComponentState then
2547 Exit;
2548 if Item.DownType = gdtBoard then
2549 ATitle := Item.Board.Title
2550 else
2551 ATitle := Item.ThreadItem.Title;
2552 if ATitle = '' then
2553 ATitle := GikoSys.GetGikoMessage(gmUnKnown);
2554
2555 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2556 //鐃緒申鐃緒申鐃?鐃緒申
2557 if Item.DownType = gdtBoard then begin
2558 //鐃緒申
2559 Item.SaveListFile;
2560 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureItiran), nil, gmiOK);
2561 if GetActiveList = Item.Board then begin
2562 FActiveList := nil;
2563 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申
2564 if (GikoSys.Setting.AutoSortThreadList) then begin
2565 GikoSys.Setting.BoardSortIndex := 0;
2566 GikoSys.Setting.BoardSortOrder := True;
2567 end;
2568 Sort.SetSortDate(Now());
2569 SetActiveList(Item.Board);
2570 end;
2571 Item.Board.Modified := True;
2572 Item.Board.IsThreadDatRead := True;
2573 PlaySound('New');
2574 ListView.Refresh;
2575 end else if Item.DownType = gdtThread then begin
2576 //鐃?鐃緒申
2577 Item.SaveItemFile;
2578 Item.ThreadItem.NewArrival := True;
2579 //if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2580 if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2581 //boardPlugIn := Item.ThreadItem.BoardPlugIn;
2582 boardPlugIn := Item.ThreadItem.ParentBoard.BoardPlugIn;
2583 THTMLCreate.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 ), @Res);
2584 Item.ThreadItem.Title := Res.FTitle;
2585 ATitle := Item.ThreadItem.Title;
2586 end else if ATitle = '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?' then begin
2587 THTMLCreate.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1), @Res);
2588 ATitle := Res.FTitle;
2589 end;
2590 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2591 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin
2592 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2593 break;
2594 end;
2595 end;
2596 if GikoSys.Setting.BrowserTabVisible then begin
2597 if GetActiveContent = Item.ThreadItem then
2598 InsertBrowserTab(Item.ThreadItem)
2599 else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then
2600 InsertBrowserTab(Item.ThreadItem, True)
2601 else
2602 InsertBrowserTab(Item.ThreadItem, False);
2603
2604 end else begin
2605 if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then
2606 InsertBrowserTab(Item.ThreadItem);
2607 end;
2608
2609 Application.ProcessMessages;
2610
2611 if Item.State = gdsComplete then begin
2612 PlaySound('New');
2613 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureSyutoku), nil, gmiOK);
2614 //Add by Genyakun
2615 DiffComp := True;
2616 end else begin
2617 PlaySound('NewDiff');
2618 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureDiff), nil, gmiOK);
2619 //Add by Genyakun
2620 DiffComp := True;
2621 end;
2622
2623 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2624 if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
2625 // 2ch鐃緒申鐃?鐃緒申鐃?1000鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2626 if (Item.ThreadItem.ParentBoard.Is2ch) then begin
2627 Item.ThreadItem.Round := False;
2628 AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
2629 end;
2630 end;
2631 TreeView.Refresh;
2632 //ListView鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
2633 UpdateListView();
2634 RefreshListView(Item.ThreadItem);
2635 end;
2636
2637 end else if Item.State = gdsNotModify then begin
2638 //鐃緒申鐃?鐃?鐃?
2639 { if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
2640 //SetContent(Item.ThreadItem);
2641 InsertBrowserTab(Item.ThreadItem);
2642 end;}
2643 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmNotMod), nil, gmiSAD);
2644 PlaySound('NoChange');
2645 Screen.Cursor := crDefault;
2646 end else if Item.State = gdsAbort then begin
2647 //鐃緒申鐃?
2648 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
2649 end else if Item.State = gdsError then begin
2650 //鐃?鐃緒申鐃?
2651 s := Item.ErrText;
2652 if s <> '' then
2653 s := ':' + s;
2654 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmError) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG);
2655 // if Item.ResponseCode = 302 then
2656 // AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG);
2657 PlaySound('Error');
2658 end;
2659 finally
2660 Item.Free;
2661 Dec(FWorkCount);
2662 if FWorkCount < 0 then FWorkCount := 0;
2663 if FWorkCount = 0 then begin
2664 try
2665 Animate.Active := False;
2666 finally
2667 Screen.Cursor := crDefault;
2668 end;
2669 end;
2670
2671 end;
2672 end;
2673
2674 procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
2675 begin
2676 // SetProgressValue(Number, 0, AWorkCountMax);
2677 // ProgressBar.Visible := True;
2678 if csDestroying in Self.ComponentState then
2679 Exit;
2680
2681 ProgressBar.Position := 0;
2682 ProgressBar.Max := AWorkCountMax;
2683 FDownloadTitle := AWorkTitle;
2684 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申';
2685 FDownloadMax := AWorkCountMax;
2686 end;
2687
2688 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
2689 begin
2690 if csDestroying in Self.ComponentState then
2691 Exit;
2692 ProgressBar.Position := 0;
2693 if FDownloadMax <> 0 then
2694 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
2695 end;
2696
2697 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
2698 begin
2699 if csDestroying in Self.ComponentState then
2700 Exit;
2701 ProgressBar.Position := AWorkCount;
2702 // SetProgressValue(Number, AWorkCount);
2703 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
2704 end;
2705
2706 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
2707 var
2708 ListItem: TListItem;
2709 begin
2710 MessageListView.Items.BeginUpdate;
2711 try
2712 ListItem := MessageListView.Items.Add;
2713 ListItem.Caption := ACaption;
2714 ListItem.Data := AObject;
2715 ListItem.MakeVisible(False);
2716 case Icon of
2717 gmiOK: ListItem.ImageIndex := 0;
2718 gmiSAD: ListItem.ImageIndex := 1;
2719 gmiNG: ListItem.ImageIndex := 2;
2720 gmiWhat: ListItem.ImageIndex := 3;
2721 end;
2722 finally
2723 MessageListView.Items.EndUpdate;
2724 end;
2725 end;
2726
2727 //! 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Browser鐃緒申鐃?鐃緒申
2728 procedure TGikoForm.ReleaseOldestBrowser;
2729 var
2730 i: Integer;
2731 begin
2732 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2733 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2734 TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2735 ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
2736 break;
2737 end;
2738 end;
2739 end;
2740
2741 function TGikoForm.InsertBrowserTab(
2742 ThreadItem : TThreadItem;
2743 ActiveTab : Boolean = True
2744 ) : TBrowserRecord;
2745 var
2746 i, j, idx : Integer;
2747 favItem : TFavoriteThreadItem;
2748 newBrowser : TBrowserRecord;
2749 ins : Integer;
2750 begin
2751
2752 Result := nil;
2753 if Threaditem = nil then Exit;
2754
2755 if ThreadItem.IsLogFile then begin
2756 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申browser鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2757 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申Active鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2758 if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
2759 (FActiveContent.Browser <> BrowserNullTab.Browser)then begin
2760 j := FBrowsers.IndexOf(FActiveContent.Browser);
2761 if j = BROWSER_COUNT - 1 then
2762 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2763 end;
2764 favItem := TFavoriteThreadItem.Create(ThreadItem.URL, ThreadItem.Title );
2765 if not FHistoryList.AddHistory( favItem, TreeView, FTreeType ) then
2766 favItem.Free;
2767
2768 for i := 0 to BrowserTab.Tabs.Count - 1 do begin
2769 if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin
2770 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
2771 Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] );
2772 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin
2773 //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2774 ReleaseOldestBrowser;
2775 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2776 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2777 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2778 end;
2779 if ActiveTab then begin
2780 BrowserTab.TabIndex := i;
2781 BrowserTab.OnChange(nil);
2782 BrowserTab.Repaint;
2783 end;
2784 Exit;
2785 end;
2786 end;
2787 end;
2788 idx := BrowserTab.TabIndex;
2789 newBrowser := TBrowserRecord.Create;
2790 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2791 ReleaseOldestBrowser;
2792 newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2793 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2794 newBrowser.thread := ThreadItem;
2795 newBrowser.Repaint := true;
2796
2797 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
2798 BrowserTab.Tabs.InsertObject(0, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2799 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2800 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2801 end;// else begin
2802 //end;
2803 BrowserTab.Repaint;
2804 if ActiveTab then begin
2805 BrowserTab.TabIndex := 0;
2806 end;
2807 end else if GikoSys.Setting.BrowserTabAppend = gtaLast then begin
2808 i := BrowserTab.Tabs.AddObject(GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2809 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2810 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2811 end;
2812 //end;
2813 BrowserTab.Repaint;
2814 if ActiveTab then begin
2815 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2816 BrowserTab.TabIndex := 0
2817 else
2818 BrowserTab.TabIndex := i;
2819 end;
2820 end else begin
2821 // 鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2822 ins := -1;
2823 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2824 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2825 TWebBrowser(FBrowsers[1]) then begin
2826 ins := i;
2827 break;
2828 end;
2829 end;
2830 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2831 Inc(ins);
2832 end;
2833 // 鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2834 if (ins < 0) then begin
2835 ins := 0;
2836 end;
2837 BrowserTab.Tabs.InsertObject(ins, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2838 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2839 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2840 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2841 end else begin
2842 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2843 end;
2844 end;
2845 //end;
2846 BrowserTab.Repaint;
2847 if ActiveTab then begin
2848 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2849 BrowserTab.TabIndex := 0
2850 else
2851 BrowserTab.TabIndex := ins;
2852 end;
2853 end;
2854 Result := newBrowser;
2855 if(ActiveTab) or (idx = -1) then begin
2856 BrowserTab.OnChange(nil);
2857 end;
2858 end else begin
2859 if BrowserNullTab = nil then begin
2860 BrowserNullTab := TBrowserRecord.Create;
2861 BrowserNullTab.Browser := Browser;
2862 end;
2863 // if BrowserNullTab.thread <> ThreadItem then begin
2864 // BrowserNullTab.Movement := '';
2865 // end;
2866 BrowserNullTab.thread := ThreadItem;
2867 Result := BrowserNullTab;
2868 BrowserTab.TabIndex := -1;
2869 SetContent(BrowserNullTab);
2870 end;
2871
2872 if GikoSys.Setting.URLDisplay then
2873 AddressComboBox.Text := ThreadItem.URL;
2874
2875 end;
2876
2877 procedure TGikoForm.SetContent(inThread : TBrowserRecord);
2878 var
2879 BBSID: string;
2880 FileName: string;
2881 sTitle: string;
2882 doc: OleVariant;
2883 s: string;
2884 idx: Integer;
2885 ThreadItem: TThreadItem;
2886 Thread: TBrowserRecord;
2887 ThreadTitle, ThreadPTitle: string;
2888 ThreadIsLog, {ThreadUnRead,} ThreadNewArraical: boolean;
2889 begin
2890 Thread := inThread;
2891 idx := BrowserTab.TabIndex;
2892 if (not FStartUp) and
2893 (FActiveContent <> nil) and
2894 (FActiveContent.Thread <> Thread.Thread) and
2895 (FActiveContent.Browser <> nil) and
2896 (Assigned(FActiveContent.Browser.ControlInterface.Document)) then begin
2897 try
2898 try
2899 FActiveContent.Thread.ScrollTop := FActiveContent.Browser.OleObject.Document.Body.ScrollTop;
2900 except
2901 on E: Exception do
2902 MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0);
2903 end;
2904 finally
2905 end;
2906 end;
2907 if not (Assigned(Thread)) or (Thread.Thread = nil) then begin
2908 Thread.Browser.Navigate(BLANK_HTML);
2909 BrowserBoardNameLabel.Caption := '';
2910 ItemBoardImage.Picture := nil;
2911 BrowserNameLabel.Caption := '';
2912 ItemImage.Picture := nil;
2913 BrowserNullTab.Thread := nil;
2914 //TOleControl(BrowserNullTab.Browser).Visible := true;
2915 ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
2916 FActiveContent := nil;
2917 Exit;
2918 end else if Thread.Browser = nil then begin
2919 if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then
2920 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2921 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2922 ReleaseOldestBrowser;
2923 Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2924 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2925 end;
2926
2927 ThreadTitle := Thread.Thread.Title;
2928 ThreadPTitle := Thread.Thread.ParentBoard.Title;
2929 //ThreadScrollTop := Thread.Thread.ScrollTop;
2930 if Thread.Thread.IsLogFile then begin
2931 if not FileExists(Thread.Thread.GetThreadFileName) then begin
2932 Thread.Thread.DeleteLogFile;
2933 end;
2934 end;
2935
2936 ThreadIsLog := Thread.Thread.IsLogFile;
2937 ThreadItem := Thread.Thread;
2938 ThreadNewArraical := Thread.Thread.NewArrival;
2939 //ThreadUnRead := Thread.Thread.UnRead;
2940 BBSID := ThreadItem.ParentBoard.BBSID;
2941 FileName := ThreadItem.FileName;
2942
2943 if GetCapture = ListView.Handle then
2944 ReleaseCapture;
2945
2946 Screen.Cursor := crHourGlass;
2947
2948