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.102 - (show annotations) (download) (as text)
Wed Nov 5 15:24:16 2003 UTC (20 years, 5 months ago) by yoffy
Branch: MAIN
Changes since 1.101: +22 -9 lines
File MIME type: text/x-pascal
・起動時に ExternalBoardPlugIn.dll のプラグイン名を表示する実験措置を削除。
・起動時に全てのプラグインをロードするようになった。
・アドレスバーの隣にある [移動] ボタンなどで呼ばれていた MoveToURL で、可能であればプラグインを指定して TThreadItem を生成するようになった。
 現段階では一見何も変化が無いが、実は TThreadItem の初期化がプラグインによって行われている。

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, Clipbrd, Buttons, ToolWin, {HTTPApp,} YofUtils, IdComponent,
16 ShellAPI, ImgList, ActnList, UrlMon, Tabs, IdGlobal, StrUtils,
17 CommCtrl, IniFiles,
18 GikoSystem, GikoUtil, Setting, BoardGroup, ThreadControl, ItemDownload,
19 Editor, RoundData, RoundName, KeySetting, GikoPanel, Favorite, FavoriteAdd,
20 FavoriteArrange, AddressHistory, Preview, HTMLDocumentEvent, Kotehan,
21 HintWindow, GikoCoolBar, GikoListView, ToolBarSetting, ToolBarUtil,
22 IndividualAbon, Dialogs, Search, ExternalBoardManager;
23
24 type
25 TGikoTreeType = (gttNone, gtt2ch, gttHistory);
26
27 TGikoForm = class(TForm)
28 StatusBar: TStatusBar;
29 MainPanel: TPanel;
30 ClientPanel: TPanel;
31 TreeSplitter: TSplitter;
32 CabinetPanel: TPanel;
33 TreeView: TTreeView;
34 ThreadMainPanel: TPanel;
35 ListSplitter: TSplitter;
36 ViewPanel: TPanel;
37 ListView: TGikoListView;
38 ThreadPanel: TPanel;
39 Browser: TWebBrowser;
40 MessagePanel: TPanel;
41 MessageBar: TPanel;
42 MessageHideButton: TSpeedButton;
43 MessageListView: TListView;
44 MessageSplitter: TSplitter;
45 Panel3: TPanel;
46 SpeedButton1: TSpeedButton;
47 ToolBar1: TToolBar;
48 CabinetSelectToolButton: TToolButton;
49 HistoryToolBar: TToolBar;
50 ToolButton15: TToolButton;
51 ToolButton18: TToolButton;
52 ItemIcon16: TImageList;
53 ItemIcon32: TImageList;
54 HotToobarImageList: TImageList;
55 ToobarImageList: TImageList;
56 ItemImageList: TImageList;
57 ActionList: TActionList;
58 LogDeleteAction: TAction;
59 KidokuAction: TAction;
60 StdToolBarVisibleAction: TAction;
61 SearchAction: TAction;
62 GikoNaviWebPageAction: TAction;
63 AboutAction: TAction;
64 ExitAction: TAction;
65 MsgBarVisibleAction: TAction;
66 StatusBarVisibleAction: TAction;
67 LargeIconAction: TAction;
68 SmallIconAction: TAction;
69 ListIconAction: TAction;
70 DetailIconAction: TAction;
71 Cabinet2chAction: TAction;
72 CabinetHistoryAction: TAction;
73 CabinetVisibleAction: TAction;
74 MidokuAction: TAction;
75 AllSelectAction: TAction;
76 UpFolderAction: TAction;
77 ListNumberVisibleAction: TAction;
78 AllItemAction: TAction;
79 LogItemAction: TAction;
80 NewItemAction: TAction;
81 SelectItemAction: TAction;
82 ShowThreadAction: TAction;
83 StopAction: TAction;
84 MainMenu: TMainMenu;
85 FileMenu: TMenuItem;
86 DeleteMenu: TMenuItem;
87 ExitMenu: TMenuItem;
88 KidokuMenu: TMenuItem;
89 MidokuMenu: TMenuItem;
90 AllSelectMenu: TMenuItem;
91 ViewMenu: TMenuItem;
92 StdToolBarMenu: TMenuItem;
93 CabinetMenu: TMenuItem;
94 N6: TMenuItem;
95 H1: TMenuItem;
96 N4: TMenuItem;
97 CabinetVisibleMenu: TMenuItem;
98 MessageMenu: TMenuItem;
99 StatusBarMenu: TMenuItem;
100 MMSep03: TMenuItem;
101 LargeIconMenu: TMenuItem;
102 SmallIconMenu: TMenuItem;
103 ListMenu: TMenuItem;
104 DetailMenu: TMenuItem;
105 ToolMenu: TMenuItem;
106 Find1: TMenuItem;
107 RoundMenu: TMenuItem;
108 MMSep04: TMenuItem;
109 OptionMenu: TMenuItem;
110 HelpMenu: TMenuItem;
111 G1: TMenuItem;
112 N1: TMenuItem;
113 AboutMenu: TMenuItem;
114 IconStyle: TAction;
115 BrowserPopupMenu: TPopupMenu;
116 ShowThreadMenu: TMenuItem;
117 ShowBoardMenu: TMenuItem;
118 ShowBoardAction: TAction;
119 ListIconPopupMenu: TPopupMenu;
120 LargeIconPMenu: TMenuItem;
121 SmallIconPMenu: TMenuItem;
122 ListPMenu: TMenuItem;
123 DetailPMenu: TMenuItem;
124 CabinetCloseAction: TAction;
125 ClosePopupMenu: TPopupMenu;
126 CloseMenu: TMenuItem;
127 OptionAction: TAction;
128 U1: TMenuItem;
129 N3: TMenuItem;
130 B1: TMenuItem;
131 S1: TMenuItem;
132 N2: TMenuItem;
133 A1: TMenuItem;
134 L1: TMenuItem;
135 N5: TMenuItem;
136 S2: TMenuItem;
137 RoundAction: TAction;
138 ListPopupMenu: TPopupMenu;
139 ListRoundPMenu: TMenuItem;
140 ListReservPMenu: TMenuItem;
141 LPMSep01: TMenuItem;
142 ItemRoundPMenu: TMenuItem;
143 LPMSep02: TMenuItem;
144 KidokuPMenu: TMenuItem;
145 MidokuPMenu: TMenuItem;
146 AllSelectPMenu: TMenuItem;
147 UrlCopyPMenu: TMenuItem;
148 LPMSep05: TMenuItem;
149 DeletePMenu: TMenuItem;
150 LPMSep06: TMenuItem;
151 ViewPMenu: TMenuItem;
152 LargeIconLPMenu: TMenuItem;
153 SmallIconLPMenu: TMenuItem;
154 ListLPMenu: TMenuItem;
155 DetailLPMenu: TMenuItem;
156 T1: TMenuItem;
157 B2: TMenuItem;
158 N8: TMenuItem;
159 URLCopyAction: TAction;
160 URLC1: TMenuItem;
161 N9: TMenuItem;
162 N10: TMenuItem;
163 MsgBarCloseAction: TAction;
164 ScrollTopAction: TAction;
165 ScrollLastAction: TAction;
166 ScrollNewAction: TAction;
167 ScrollKokoAction: TAction;
168 EditorAction: TAction;
169 IEAction: TAction;
170 ItemReloadAction: TAction;
171 BrowserMaxAction: TAction;
172 G2: TMenuItem;
173 N11: TMenuItem;
174 T3: TMenuItem;
175 L2: TMenuItem;
176 N12: TMenuItem;
177 K1: TMenuItem;
178 N13: TMenuItem;
179 N14: TMenuItem;
180 R1: TMenuItem;
181 A2: TMenuItem;
182 N15: TMenuItem;
183 SelectListReloadAction: TAction;
184 SelectThreadReloadAction: TAction;
185 SelectTimer: TTimer;
186 KokoPopupMenu: TPopupMenu;
187 KokomadePMenu: TMenuItem;
188 AllPMenu: TMenuItem;
189 MenuItem1: TMenuItem;
190 MenuItem2: TMenuItem;
191 BrowserTabCloseAction: TAction;
192 BrowserTabPopupMenu: TPopupMenu;
193 Close1: TMenuItem;
194 KokomadeAction: TAction;
195 ZenbuAction: TAction;
196 KokoResAction: TAction;
197 SelectItemURLCopyAction: TAction;
198 SelectReservAction: TAction;
199 NotSelectTabCloseAction: TAction;
200 A3: TMenuItem;
201 N16: TMenuItem;
202 A4: TMenuItem;
203 TreePopupMenu: TPopupMenu;
204 TreeSelectThreadPupupMenu: TMenuItem;
205 TreeSelectBoardPupupMenu: TMenuItem;
206 TPMSep01: TMenuItem;
207 TreeSelectURLPupupMenu: TMenuItem;
208 TreeSelectBoradReload: TAction;
209 TreeSelectThreadReload: TAction;
210 TreeSelectURLCopy: TAction;
211 ListToolBarVisibleAction: TAction;
212 BrowserToolBarVisibleAction: TAction;
213 T2: TMenuItem;
214 L3: TMenuItem;
215 B3: TMenuItem;
216 BrowserBottomPanel: TGikoPanel;
217 CabinetSelectPopupMenu: TPopupMenu;
218 N17: TMenuItem;
219 H2: TMenuItem;
220 ItemReservPMenu: TMenuItem;
221 RoundNamePopupMenu: TPopupMenu;
222 SelectNewRoundName: TAction;
223 SelectDeleteRound: TAction;
224 NewBoardAction: TAction;
225 N7: TMenuItem;
226 B4: TMenuItem;
227 LoginAction: TAction;
228 L4: TMenuItem;
229 KeySettingAction: TAction;
230 K2: TMenuItem;
231 AllTabCloseAction: TAction;
232 A5: TMenuItem;
233 N18: TMenuItem;
234 A6: TMenuItem;
235 C1: TMenuItem;
236 V1: TMenuItem;
237 N19: TMenuItem;
238 D1: TMenuItem;
239 D2: TMenuItem;
240 N20: TMenuItem;
241 MessageImageList: TImageList;
242 ProgressBar: TProgressBar;
243 ArrangeAction: TAction;
244 URL1: TMenuItem;
245 NameURLCopyAction: TAction;
246 SelectItemNameURLCopyAction: TAction;
247 NameUrlCopyPMenu: TMenuItem;
248 URLC2: TMenuItem;
249 URLN1: TMenuItem;
250 N21: TMenuItem;
251 URLC3: TMenuItem;
252 URLN2: TMenuItem;
253 N22: TMenuItem;
254 N23: TMenuItem;
255 ListCoolBar: TGikoCoolBar;
256 ListToolBar: TToolBar;
257 ViewNoButton: TToolButton;
258 IconToolButton: TToolButton;
259 UpFolderButton: TToolButton;
260 Sepa01ToolButton: TToolButton;
261 AllItemToolButton: TToolButton;
262 LogItemToolButton: TToolButton;
263 NewItemToolButton: TToolButton;
264 ListDownloadToolButton: TToolButton;
265 ListThreadDownloadToolButton: TToolButton;
266 ToolButton2: TToolButton;
267 ToolButton1: TToolButton;
268 BrowserCoolBar: TGikoCoolBar;
269 BrowserToolBar: TToolBar;
270 BrowserSizeButton: TToolButton;
271 ToolButton3: TToolButton;
272 TopButton: TToolButton;
273 LastBotton: TToolButton;
274 NewButton: TToolButton;
275 KokoButton: TToolButton;
276 ToolButton9: TToolButton;
277 EditorButton: TToolButton;
278 ToolButton11: TToolButton;
279 IEButton: TToolButton;
280 ToolButton5: TToolButton;
281 ItemReloadButton: TToolButton;
282 ListNameToolBar: TToolBar;
283 ListNameLabel: TLabel;
284 FolderImage: TImage;
285 BrowserNameToolBar: TToolBar;
286 ItemBoardImage: TImage;
287 BrowserBoardNameLabel: TLabel;
288 ItemImage: TImage;
289 BrowserNameLabel: TLabel;
290 ActiveLogDeleteAction: TAction;
291 N24: TMenuItem;
292 D3: TMenuItem;
293 N25: TMenuItem;
294 N26: TMenuItem;
295 ListNameBarVisibleAction: TAction;
296 D4: TMenuItem;
297 BrowserNameBarVisibleAction: TAction;
298 S3: TMenuItem;
299 R2: TMenuItem;
300 TreeSelectNameURLCopy: TAction;
301 TreeSelectNameURLPupupMenu: TMenuItem;
302 N27: TMenuItem;
303 H3: TMenuItem;
304 PaneInitAction: TAction;
305 I1: TMenuItem;
306 BrowserTabToolBar: TToolBar;
307 BrowserTab: TTabControl;
308 ToolButton7: TToolButton;
309 BrowserMinAction: TAction;
310 About1: TMenuItem;
311 N28: TMenuItem;
312 SelectTextClearAction: TAction;
313 MailTextClearAction: TAction;
314 NameTextClearAction: TAction;
315 S4: TMenuItem;
316 N29: TMenuItem;
317 N30: TMenuItem;
318 LeftmostTabSelectAction: TAction;
319 LeftTabSelectAction: TAction;
320 RightTabSelectAction: TAction;
321 RightmostTabSelectAction: TAction;
322 N31: TMenuItem;
323 L5: TMenuItem;
324 L6: TMenuItem;
325 A7: TMenuItem;
326 R3: TMenuItem;
327 FavoriteMenu: TMenuItem;
328 FavoriteAddAction: TAction;
329 N32: TMenuItem;
330 BoardFavoriteAddMenu: TMenuItem;
331 BoardFavoriteAddAction: TAction;
332 ThreadFavoriteAddAction: TAction;
333 ThreadFavoriteAddMenu: TMenuItem;
334 TreeSelectFavoriteAddAction: TAction;
335 N33: TMenuItem;
336 TreeSelectFavoriteAddPupupMenu: TMenuItem;
337 FavoriteArrangeAction: TAction;
338 FavoriteTreeView: TTreeView;
339 StateIconImageList: TImageList;
340 TopPanel: TPanel;
341 TopRightPanel: TPanel;
342 AnimePanel: TPanel;
343 Animate: TAnimate;
344 TopCoolPanel: TPanel;
345 MainCoolBar: TGikoCoolBar;
346 MenuToolBar: TToolBar;
347 StdToolBar: TToolBar;
348 RoundToolButton: TToolButton;
349 ToolButton6: TToolButton;
350 CabinetToolButton: TToolButton;
351 ToolButton4: TToolButton;
352 ToolButton13: TToolButton;
353 AbortToolButton: TToolButton;
354 LoginToolButton: TToolButton;
355 AddressToolBar: TToolBar;
356 AddressComboBox: TComboBox;
357 MoveToToolButton: TToolButton;
358 MoveToAction: TAction;
359 AddressImageList: TImageList;
360 AddressBarVisibleAction: TAction;
361 AddressToolBarMenu: TMenuItem;
362 T4: TMenuItem;
363 BrowserTabVisibleAction: TAction;
364 Show1: TMenuItem;
365 N34: TMenuItem;
366 BrowserTabTopAction: TAction;
367 BrowserTabBottomAction: TAction;
368 T5: TMenuItem;
369 B5: TMenuItem;
370 N35: TMenuItem;
371 BrowserTabTabStyleAction: TAction;
372 BrowserTabButtonStyleAction: TAction;
373 BrowserTabFlatStyleAction: TAction;
374 A8: TMenuItem;
375 U2: TMenuItem;
376 F1: TMenuItem;
377 PreviewTimer: TTimer;
378 MonazillaWebPageAction: TAction;
379 MonazillaWebPageAction1: TMenuItem;
380 GikoHelpAction: TAction;
381 N36: TMenuItem;
382 H4: TMenuItem;
383 KotehanAction: TAction;
384 K3: TMenuItem;
385 LinkBarVisibleAction: TAction;
386 L7: TMenuItem;
387 N37: TMenuItem;
388 A9: TMenuItem;
389 ChevronPopupMenu: TPopupMenu;
390 BBS2chWebPageAction: TAction;
391 N2N1: TMenuItem;
392 N38: TMenuItem;
393 GikoFolderOpenAction: TAction;
394 F2: TMenuItem;
395 LinkToolBar: TToolBar;
396 a10: TMenuItem;
397 ToolButton8: TToolButton;
398 ToolButton10: TToolButton;
399 ThreadEditorAction: TAction;
400 N39: TMenuItem;
401 T6: TMenuItem;
402 N40: TMenuItem;
403 LinkBarPopupMenu: TPopupMenu;
404 ToolBarSettingAction: TAction;
405 T7: TMenuItem;
406 ToolButton12: TToolButton;
407 ToolButton14: TToolButton;
408 ThreadPopupMenu: TPopupMenu;
409 MenuItem4: TMenuItem;
410 MenuItem5: TMenuItem;
411 MenuItem6: TMenuItem;
412 T8: TMenuItem;
413 NameCopyAction: TAction;
414 BoardIEAction: TAction;
415 URLN3: TMenuItem;
416 SelectItemNameCopyAction: TAction;
417 SelectItemNameCopyAction1: TMenuItem;
418 B6: TMenuItem;
419 T9: TMenuItem;
420 C2: TMenuItem;
421 SelectComboBox: TComboBox;
422 MainCoolBarPopupMenu: TPopupMenu;
423 StdToolBarVisiblePMenu: TMenuItem;
424 AddressToolBarVisiblePMenu: TMenuItem;
425 LinkToolBarVisiblePMenu: TMenuItem;
426 NG1: TMenuItem;
427 NG2: TMenuItem;
428 N43: TMenuItem;
429 N44: TMenuItem;
430 L9: TMenuItem;
431 I3: TMenuItem;
432 N45: TMenuItem;
433 B9: TMenuItem;
434 R5: TMenuItem;
435 T12: TMenuItem;
436 Show3: TMenuItem;
437 N46: TMenuItem;
438 T13: TMenuItem;
439 B10: TMenuItem;
440 N47: TMenuItem;
441 A12: TMenuItem;
442 U4: TMenuItem;
443 F4: TMenuItem;
444 N48: TMenuItem;
445 T14: TMenuItem;
446 SelectItemToolButton: TToolButton;
447 SelectResToolButton: TToolButton;
448 SelectResAction: TAction;
449 ToolButton16: TToolButton;
450 AllResAction: TAction;
451 AllResToolButton: TToolButton;
452 N50: TMenuItem;
453 A11: TMenuItem;
454 S5: TMenuItem;
455 Reload: TMenuItem;
456 GoBack: TMenuItem;
457 GoFoward: TMenuItem;
458 EditAction: TAction;
459 ReloadAction: TAction;
460 GoFowardAction: TAction;
461 GoBackAction: TAction;
462 SelectComboBoxSplitter: TImage;
463 IndividualAbon1: TMenuItem;
464 N41: TMenuItem;
465 IndividualAbon2: TMenuItem;
466 N42: TMenuItem;
467 CancellIndividualAbon: TAction;
468 AntiIndividualAbon: TMenuItem;
469 N49: TMenuItem;
470 N51: TMenuItem;
471 N52: TMenuItem;
472 N53: TMenuItem;
473 SearchBoardName: TMenuItem;
474 N55: TMenuItem;
475 TreeSelectSearchBoardName: TAction;
476 CabinetFavoriteAction: TAction;
477 N54: TMenuItem;
478 A13: TMenuItem;
479 FavoriteTreePopupMenu: TPopupMenu;
480 FavoriteTreeViewRenameAction: TAction;
481 FavoriteTreeRenamePopupMenu: TMenuItem;
482 FavoriteTreeViewNewFolderAction: TAction;
483 FavoriteTreeNewFolderPopupMenu: TMenuItem;
484 N56: TMenuItem;
485 FavoriteTreeViewDeleteAction: TAction;
486 FavoriteTreeDeletePopupMenu: TMenuItem;
487 FavoriteToolBar: TToolBar;
488 ToolButton17: TToolButton;
489 ToolButton19: TToolButton;
490 FavoriteTreeViewBrowseFolderAction: TAction;
491 FavoriteTreeBrowseFolderPopupMenu: TMenuItem;
492 N57: TMenuItem;
493 FavoriteTreeReloadPopupMenu: TMenuItem;
494 N58: TMenuItem;
495 FavoriteTreeURLCopyPopupMenu: TMenuItem;
496 FavoriteTreeNameCopyPopupMenu: TMenuItem;
497 FavoriteTreeLogDeletePopupMenu: TMenuItem;
498 N59: TMenuItem;
499 FavoriteTreeNameURLCopyPopupMenu: TMenuItem;
500 FavoriteTreeViewReloadAction: TAction;
501 FavoriteTreeViewURLCopyAction: TAction;
502 FavoriteTreeViewNameCopyAction: TAction;
503 FavoriteTreeViewNameURLCopyAction: TAction;
504 FavoriteTreeViewLogDeleteAction: TAction;
505 OnlyAHundredRes: TAction;
506 ToolButton20: TToolButton;
507 AHundredResButton: TToolButton;
508 N60: TMenuItem;
509 procedure FormCreate(Sender: TObject);
510 procedure FormDestroy(Sender: TObject);
511 procedure CabinetPanelHide(Sender: TObject);
512 procedure FormClose(Sender: TObject; var Action: TCloseAction);
513 procedure TreeViewChange(Sender: TObject; Node: TTreeNode);
514 procedure ListViewData(Sender: TObject; Item: TListItem);
515 procedure ListViewDataFind(Sender: TObject; Find: TItemFind;
516 const FindString: String; const FindPosition: TPoint;
517 FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection;
518 Wrap: Boolean; var Index: Integer);
519 procedure ListViewDataHint(Sender: TObject; StartIndex,
520 EndIndex: Integer);
521 procedure ListViewDataStateChange(Sender: TObject; StartIndex,
522 EndIndex: Integer; OldState, NewState: TItemStates);
523 procedure BrowserStatusTextChange(Sender: TObject;
524 const Text: WideString);
525 procedure BrowserTitleChange(Sender: TObject; const Text: WideString);
526 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
527 procedure TreeViewChanging(Sender: TObject; Node: TTreeNode;
528 var AllowChange: Boolean);
529 procedure ListViewKeyDown(Sender: TObject; var Key: Word;
530 Shift: TShiftState);
531 procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
532 procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
533 Button: TToolButton; State: TCustomDrawState;
534 var DefaultDraw: Boolean);
535 procedure BrowserBeforeNavigate2(Sender: TObject;
536 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
537 Headers: OleVariant; var Cancel: WordBool);
538 procedure ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
539 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
540 var DefaultDraw: Boolean);
541 procedure TreeViewCustomDraw(Sender: TCustomTreeView;
542 const ARect: TRect; var DefaultDraw: Boolean);
543 procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
544 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
545 procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
546 procedure TreeViewDblClick(Sender: TObject);
547 procedure FavoriteTreeViewClick(Sender: TObject);
548 procedure ListViewCustomDraw(Sender: TCustomListView;
549 const ARect: TRect; var DefaultDraw: Boolean);
550 procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
551 Shift: TShiftState; X, Y: Integer);
552 procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
553 procedure MessageListViewResize(Sender: TObject);
554 procedure ExitActionExecute(Sender: TObject);
555 procedure AllSelectActionExecute(Sender: TObject);
556 procedure StdToolBarVisibleActionExecute(Sender: TObject);
557 procedure MsgBarVisibleActionExecute(Sender: TObject);
558 procedure StatusBarVisibleActionExecute(Sender: TObject);
559 procedure LargeIconActionExecute(Sender: TObject);
560 procedure SmallIconActionExecute(Sender: TObject);
561 procedure ListIconActionExecute(Sender: TObject);
562 procedure DetailIconActionExecute(Sender: TObject);
563 procedure SearchActionExecute(Sender: TObject);
564 procedure OptionActionExecute(Sender: TObject);
565 procedure GikoNaviWebPageActionExecute(Sender: TObject);
566 procedure AboutActionExecute(Sender: TObject);
567 procedure Cabinet2chActionExecute(Sender: TObject);
568 procedure CabinetHistoryActionExecute(Sender: TObject);
569 procedure CabinetVisibleActionExecute(Sender: TObject);
570 procedure AllItemActionExecute(Sender: TObject);
571 procedure LogItemActionExecute(Sender: TObject);
572 procedure NewItemActionExecute(Sender: TObject);
573 procedure SelectItemActionExecute(Sender: TObject);
574 procedure ListNumberVisibleActionExecute(Sender: TObject);
575 procedure UpFolderActionExecute(Sender: TObject);
576 procedure IconStyleExecute(Sender: TObject);
577 procedure RoundActionExecute(Sender: TObject);
578 procedure StopActionExecute(Sender: TObject);
579 procedure MsgBarCloseActionExecute(Sender: TObject);
580 procedure BrowserMaxActionExecute(Sender: TObject);
581 procedure ScrollTopActionExecute(Sender: TObject);
582 procedure ScrollLastActionExecute(Sender: TObject);
583 procedure ScrollNewActionExecute(Sender: TObject);
584 procedure ScrollKokoActionExecute(Sender: TObject);
585 procedure EditorActionExecute(Sender: TObject);
586 procedure IEActionExecute(Sender: TObject);
587 procedure ShowThreadActionExecute(Sender: TObject);
588 procedure ShowBoardActionExecute(Sender: TObject);
589 procedure URLCopyActionExecute(Sender: TObject);
590 procedure ItemReloadActionExecute(Sender: TObject);
591 procedure SelectListReloadActionExecute(Sender: TObject);
592 procedure SelectThreadReloadActionExecute(Sender: TObject);
593 procedure SelectListReloadActionUpdate(Sender: TObject);
594 procedure AllItemActionUpdate(Sender: TObject);
595 procedure LogItemActionUpdate(Sender: TObject);
596 procedure NewItemActionUpdate(Sender: TObject);
597 procedure SelectItemActionUpdate(Sender: TObject);
598 procedure UpFolderActionUpdate(Sender: TObject);
599 procedure FormResize(Sender: TObject);
600 procedure ScrollTopActionUpdate(Sender: TObject);
601 procedure ScrollLastActionUpdate(Sender: TObject);
602 procedure ScrollNewActionUpdate(Sender: TObject);
603 procedure ScrollKokoActionUpdate(Sender: TObject);
604 procedure EditorActionUpdate(Sender: TObject);
605 procedure IEActionUpdate(Sender: TObject);
606 procedure ShowThreadActionUpdate(Sender: TObject);
607 procedure ShowBoardActionUpdate(Sender: TObject);
608 procedure SelectThreadReloadActionUpdate(Sender: TObject);
609 procedure ListViewSelectItem(Sender: TObject; Item: TListItem;
610 Selected: Boolean);
611 procedure SelectTimerTimer(Sender: TObject);
612 procedure ItemReloadActionUpdate(Sender: TObject);
613 procedure ListViewDblClick(Sender: TObject);
614 procedure LogDeleteActionExecute(Sender: TObject);
615 procedure KokomadeActionExecute(Sender: TObject);
616 procedure ZenbuActionExecute(Sender: TObject);
617 procedure KokoResActionExecute(Sender: TObject);
618 procedure ListPopupMenuPopup(Sender: TObject);
619 procedure SelectItemURLCopyActionExecute(Sender: TObject);
620 procedure SelectItemURLCopyActionUpdate(Sender: TObject);
621 procedure AllSelectActionUpdate(Sender: TObject);
622 procedure LogDeleteActionUpdate(Sender: TObject);
623 procedure BrowserTabCloseActionExecute(Sender: TObject);
624 procedure NotSelectTabCloseActionExecute(Sender: TObject);
625 procedure TreeSelectBoradReloadExecute(Sender: TObject);
626 procedure TreeSelectThreadReloadExecute(Sender: TObject);
627 procedure TreeSelectURLCopyExecute(Sender: TObject);
628 procedure TreePopupMenuPopup(Sender: TObject);
629 procedure ListToolBarVisibleActionExecute(Sender: TObject);
630 procedure BrowserToolBarVisibleActionExecute(Sender: TObject);
631 procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
632 var Cancel: WordBool);
633 procedure ListSplitterCanResize(Sender: TObject; var NewSize: Integer;
634 var Accept: Boolean);
635 procedure ListSplitterMoved(Sender: TObject);
636 procedure BrowserTabChange(Sender: TObject);
637 procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
638 Shift: TShiftState; X, Y: Integer);
639 procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer;
640 State: TDragState; var Accept: Boolean);
641 procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer);
642 procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X,
643 Y: Integer);
644 procedure BrowserDocumentComplete(Sender: TObject;
645 const pDisp: IDispatch; var URL: OleVariant);
646 procedure SelectReservActionUpdate(Sender: TObject);
647 procedure RoundNamePopupMenuPopup(Sender: TObject);
648 procedure SelectNewRoundNameExecute(Sender: TObject);
649 procedure SelectDeleteRoundExecute(Sender: TObject);
650 procedure SelectReservActionExecute(Sender: TObject);
651 procedure NewBoardActionExecute(Sender: TObject);
652 procedure LoginActionExecute(Sender: TObject);
653 procedure KeySettingActionExecute(Sender: TObject);
654 procedure AllTabCloseActionExecute(Sender: TObject);
655 procedure ArrangeActionExecute(Sender: TObject);
656 procedure NameURLCopyActionExecute(Sender: TObject);
657 procedure SelectItemNameURLCopyActionExecute(Sender: TObject);
658 procedure URLCopyActionUpdate(Sender: TObject);
659 procedure NameURLCopyActionUpdate(Sender: TObject);
660 procedure BrowserTabCloseActionUpdate(Sender: TObject);
661 procedure NotSelectTabCloseActionUpdate(Sender: TObject);
662 procedure AllTabCloseActionUpdate(Sender: TObject);
663 procedure SelectItemNameURLCopyActionUpdate(Sender: TObject);
664 procedure ActiveLogDeleteActionExecute(Sender: TObject);
665 procedure ActiveLogDeleteActionUpdate(Sender: TObject);
666 procedure ListNameBarVisibleActionExecute(Sender: TObject);
667 procedure BrowserNameBarVisibleActionExecute(Sender: TObject);
668 procedure TreeSelectNameURLCopyExecute(Sender: TObject);
669 procedure PaneInitActionExecute(Sender: TObject);
670 procedure FormShow(Sender: TObject);
671 procedure BrowserTabToolBarResize(Sender: TObject);
672 procedure BrowserMinActionExecute(Sender: TObject);
673 procedure SelectTextClearActionExecute(Sender: TObject);
674 procedure NameTextClearActionExecute(Sender: TObject);
675 procedure MailTextClearActionExecute(Sender: TObject);
676 procedure LeftmostTabSelectActionExecute(Sender: TObject);
677 procedure LeftTabSelectActionExecute(Sender: TObject);
678 procedure RightTabSelectActionExecute(Sender: TObject);
679 procedure RightmostTabSelectActionExecute(Sender: TObject);
680 procedure LeftmostTabSelectActionUpdate(Sender: TObject);
681 procedure LeftTabSelectActionUpdate(Sender: TObject);
682 procedure RightTabSelectActionUpdate(Sender: TObject);
683 procedure RightmostTabSelectActionUpdate(Sender: TObject);
684 procedure FavoriteMenuClick(Sender: TObject);
685 procedure FavoriteAddActionExecute(Sender: TObject);
686 procedure FavoriteAddActionUpdate(Sender: TObject);
687 procedure BoardFavoriteAddActionExecute(Sender: TObject);
688 procedure BoardFavoriteAddActionUpdate(Sender: TObject);
689 procedure ThreadFavoriteAddActionExecute(Sender: TObject);
690 procedure ThreadFavoriteAddActionUpdate(Sender: TObject);
691 procedure TreeSelectFavoriteAddActionExecute(Sender: TObject);
692 procedure FavoriteArrangeActionExecute(Sender: TObject);
693 procedure MainCoolBarResize(Sender: TObject);
694 procedure MoveToActionExecute(Sender: TObject);
695 procedure AddressToolBarResize(Sender: TObject);
696 procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
697 Shift: TShiftState);
698 procedure AddressBarVisibleActionExecute(Sender: TObject);
699 procedure BrowserEnter(Sender: TObject);
700 procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
701 procedure BrowserTabVisibleActionExecute(Sender: TObject);
702 procedure BrowserTabTopActionExecute(Sender: TObject);
703 procedure BrowserTabBottomActionExecute(Sender: TObject);
704 procedure BrowserTabTabStyleActionExecute(Sender: TObject);
705 procedure BrowserTabButtonStyleActionExecute(Sender: TObject);
706 procedure BrowserTabFlatStyleActionExecute(Sender: TObject);
707 procedure PreviewTimerTimer(Sender: TObject);
708 procedure MessageHideButtonClick(Sender: TObject);
709 procedure MonazillaWebPageActionExecute(Sender: TObject);
710 procedure GikoHelpActionExecute(Sender: TObject);
711 procedure ToolButton18Click(Sender: TObject);
712 procedure KotehanActionExecute(Sender: TObject);
713 procedure LinkBarVisibleActionExecute(Sender: TObject);
714 procedure BBS2chWebPageActionExecute(Sender: TObject);
715 procedure GikoFolderOpenActionExecute(Sender: TObject);
716 procedure MainCoolBarBandInfo(Sender: TObject;
717 var BandInfo: PReBarBandInfoA);
718 procedure MainCoolBarChevronClick(Sender: TObject;
719 RebarChevron: PNMRebarChevron);
720 procedure ListCoolBarBandInfo(Sender: TObject;
721 var BandInfo: PReBarBandInfoA);
722 procedure ListCoolBarChevronClick(Sender: TObject;
723 RebarChevron: PNMRebarChevron);
724 procedure BrowserCoolBarBandInfo(Sender: TObject;
725 var BandInfo: PReBarBandInfoA);
726 procedure BrowserCoolBarChevronClick(Sender: TObject;
727 RebarChevron: PNMRebarChevron);
728 procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
729 procedure ThreadEditorActionExecute(Sender: TObject);
730 procedure ThreadEditorActionUpdate(Sender: TObject);
731 procedure ToolBarSettingActionExecute(Sender: TObject);
732 procedure NameCopyActionExecute(Sender: TObject);
733 procedure BoardIEActionExecute(Sender: TObject);
734 procedure SelectItemNameCopyActionExecute(Sender: TObject);
735 procedure SelectItemNameCopyActionUpdate(Sender: TObject);
736 procedure BoardIEActionUpdate(Sender: TObject);
737 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
738 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
739 procedure NameCopyActionUpdate(Sender: TObject);
740 procedure SelectComboBoxChange(Sender: TObject);
741 procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
742 Shift: TShiftState);
743 procedure SelectComboBoxExit(Sender: TObject);
744 procedure NG1Click(Sender: TObject);
745 procedure SelectResActionExecute(Sender: TObject);
746 procedure SelectResActionUpdate(Sender: TObject);
747 procedure FormKeyDown(Sender: TObject; var Key: Word;
748 Shift: TShiftState);
749 procedure FormKeyUp(Sender: TObject; var Key: Word;
750 Shift: TShiftState);
751 procedure AllResActionExecute(Sender: TObject);
752 procedure AllResActionUpdate(Sender: TObject);
753 procedure ReloadClick(Sender: TObject);
754 procedure GoBackClick(Sender: TObject);
755 procedure GoFowardClick(Sender: TObject);
756 procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
757 Shift: TShiftState; X, Y: Integer);
758 procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
759 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
760 procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
761 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
762 procedure StatusBarResize(Sender: TObject);
763 procedure IndividualAbon1Click(Sender: TObject);
764 procedure IndividualAbon2Click(Sender: TObject);
765 procedure N42Click(Sender: TObject);
766 procedure SelectComboBoxEnter(Sender: TObject);
767 procedure AntiIndividualAbonClick(Sender: TObject);
768 procedure N51Click(Sender: TObject);
769 procedure TreeSelectSearchBoardNameExecute(Sender: TObject);
770 procedure CabinetFavoriteActionExecute(Sender: TObject);
771 procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
772 Y: Integer);
773 procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
774 procedure FavoriteTreeViewEdited(Sender: TObject; Node: TTreeNode;
775 var S: String);
776 procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
777 Shift: TShiftState);
778 procedure FavoriteTreePopupMenuPopup(Sender: TObject);
779 procedure FavoriteTreeViewDeleteActionExecute(Sender: TObject);
780 procedure FavoriteTreeViewRenameActionExecute(Sender: TObject);
781 procedure FavoriteTreeViewNewFolderActionExecute(Sender: TObject);
782 procedure ToolButton19Click(Sender: TObject);
783 procedure FavoriteTreeViewBrowseFolderActionExecute(Sender: TObject);
784 procedure FavoriteTreeViewChange(Sender: TObject; Node: TTreeNode);
785 procedure FavoriteTreeViewDblClick(Sender: TObject);
786 procedure FavoriteTreeViewLogDeleteActionExecute(Sender: TObject);
787 procedure FavoriteTreeViewReloadActionExecute(Sender: TObject);
788 procedure FavoriteTreeViewURLCopyActionExecute(Sender: TObject);
789 procedure FavoriteTreeViewNameCopyActionExecute(Sender: TObject);
790 procedure FavoriteTreeViewNameURLCopyActionExecute(Sender: TObject);
791 procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer);
792 procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton;
793 Shift: TShiftState; X, Y: Integer);
794 procedure LinkToolBarDragOver(Sender, Source: TObject; X, Y: Integer;
795 State: TDragState; var Accept: Boolean);
796 procedure OnlyAHundredResExecute(Sender: TObject);
797 procedure FavoriteTreeViewEndDrag(Sender, Target: TObject; X,
798 Y: Integer);
799 procedure ListCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
800 var Handled: Boolean);
801 procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
802 var Handled: Boolean);
803 procedure BrowserCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
804 var Handled: Boolean);
805 private
806 { Private 鐃緒申鐃緒申 }
807
808 FSortIndex: Integer;
809 FSortOrder: Boolean;
810
811 FEnabledCloseButton: Boolean;
812 // ThreadCreate: TThreadCreate;
813
814 FClickNode: TTreeNode;
815 FHttpState: Boolean;
816 FHint: TResPopup;
817 FPreviewBrowser: TPreviewBrowser;
818 FPreviewURL: string;
819
820 FBrowserSizeHeight: Integer;
821 FBrowserSizeWidth: Integer;
822
823 // FFavorite: TFavorite;
824 FBrowserComplete: Boolean;
825 FTabHintIndex: Integer;
826 FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
827 FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?
828 FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?
829 FActiveList: TObject;
830 FActiveContent: TThreadItem; //
831 FHistoryList: TList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
832 FTreeType: TGikoTreeType;
833 FWorkCount: Integer;
834 FNameCookie: string;
835 FMailCookie: string;
836 // FLastRoundTime: TDateTime;
837 BrowserNullTab: TThreadItem;
838 // DoubleClickOccurred: array [TMouseButton] of Boolean;
839 FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
840 FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?
841 FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?
842
843 Fkeynum : Integer; //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
844
845 IsDraggingSelectComboBox : Boolean;
846 DraggingSelectComboBoxPosition : TPoint;
847
848 FSearchDialog: TSearchDialog;
849
850 FDropSpaceNode: TTreeNode;
851
852 FDragTime : Cardinal; //鐃緒申鐃緒申鐃?鐃緒申D&D鐃?
853 FDragButton : TToolButton; //鐃緒申鐃緒申鐃?鐃緒申D&D鐃?鐃緒申Drag鐃緒申鐃緒申鐃緒申Button鐃緒申鐃緒申
854 FDragWFirst : Boolean; //WebTab鐃緒申D&D鐃?
855
856 procedure SetBoardTreeNode;
857 function SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
858 function SetBoardListItem(Category: TCategory): Integer;
859 function SetThreadListItem(Board: TBoard): Integer;
860 // function GetRoundName(index: integer): string;
861
862 procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
863 procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
864 procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer);
865 procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
866 procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
867
868 procedure SetActiveList(Obj: TObject);
869 procedure ListClick;
870 procedure ListDoubleClick;
871 procedure BrowserMovement(AName: string);
872 procedure SelectListItem(List: TList);
873 // procedure SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
874 procedure DeleteTab(ThreadItem: TThreadItem);
875 function Hook(var Message: TMessage): Boolean;
876 procedure AddRoundNameMenu(MenuItem: TMenuItem);
877 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string);
878 procedure SetSelectRoundName(Sender: TObject);
879 function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
880
881 procedure SetMenuFont;
882 // procedure CreateFavMenu(Folder: TFavoriteFolder);
883 procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
884 procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;
885 procedure FavoriteClick(Sender: TObject); overload;
886 procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
887 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
888 function OnDocumentContextMenu(Sender: TObject): WordBool;
889 // function GetThreadText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean): string;
890 procedure SetResPopupText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean);
891 procedure ShowTextPopup;
892 //procedure ShowTextPopup(HintData: THintData);
893 // procedure SetStdToolBar;
894 // function GetAction(ActionName: string): TContainedAction;
895 procedure SetLinkBar;
896 function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
897 procedure MenuBarChevronMenu;
898 procedure LinkBarChevronMenu;
899 procedure ToolBarChevronMenu(ToolBar: TToolBar);
900 procedure ModifySelectList;
901 procedure FavoriteBrowseFolder( node: TTreeNode );
902 procedure LinkToolButtonDragDrop(Sender, Source: TObject; X, Y: Integer);
903 procedure LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
904 procedure LinkToolButtonOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
905 procedure LinkToolButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
906 procedure LinkToolButtonStartDrag(Sender: TObject; var DragObject: TDragObject);
907 function TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode;
908 procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );
909 procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject );
910 procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject );
911 //
912 procedure BrowserTabClick(Sender: TObject);
913 protected
914 procedure CreateParams(var Params: TCreateParams); override;
915 procedure WndProc(var Message: TMessage); override;
916 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
917 procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
918 procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
919 public
920 { Public 鐃緒申鐃緒申 }
921 // FDownload: TDownload;
922 FControlThread: TThreadControl;
923 procedure MoveToURL(URL: string);
924 procedure InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);
925 procedure ReloadBBS;
926 function GetHttpState: Boolean;
927 procedure SetEnabledCloseButton(Enabled: Boolean);
928 function GetTreeNode(Data: TObject): TTreeNode;
929 procedure AppFormDeactivate(Sender: TObject);
930 // procedure CabinetPanelVisible(PanelVisible: Boolean);
931 procedure ListViewAllSelect;
932
933 property ListStyle: TViewStyle read FListStyle write FListStyle;
934 property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
935 property ViewType: TGikoViewType read FViewType write FViewType;
936
937 property NameCookie: string read FNameCookie write FNameCookie;
938 property MailCookie: string read FMailCookie write FMailCookie;
939
940 procedure SetContent(ThreadItem: TThreadItem);
941 function GetActiveContent: TThreadItem;
942 function GetActiveList: TObject;
943
944 property ActiveList: TObject read GetActiveList write SetActiveList;
945 // property LastRoundTime: TDateTime read FLastRoundTime write FLastRoundTime;
946
947 procedure SetListViewType(AViewType: TGikoViewType); overload;
948 procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
949 procedure DownloadContent(ThreadItem: TThreadItem);
950 procedure DownloadList(Board: TBoard);
951 procedure PlaySound(SoundEventName: string);
952
953 function AddHistory(ThreadItem: TThreadItem): Boolean;
954 procedure DeleteHistory(ThreadItem: TThreadItem);
955 procedure ClearHistory;
956 procedure Show2chTree;
957 procedure ShowHistoryTree;
958 procedure SetHistoryTreeNode;
959 // procedure SelectTreeNode(Item: TObject);
960 procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
961 procedure SetBrowserTabState;
962 // property Favorite: TFavorite read FFavorite write FFavorite;
963 procedure SetToolBarPopup;
964 procedure ShowFavoriteAddDialog( Item : TObject );
965 published
966 property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
967 end;
968
969 TFavoriteMenuItem = class(TMenuItem)
970 private
971 FData : Pointer;
972 public
973 property Data: Pointer read FData write FData;
974 end;
975
976 TLinkToolButton = class(TToolButton)
977 private
978 FData : Pointer;
979 public
980 property Data: Pointer read FData write FData;
981 end;
982
983 var
984 GikoForm: TGikoForm;
985
986 implementation
987
988 uses
989 About, Option, Round, Splash, Sort, ListSelect,
990 NewBoard;
991
992 const
993 CAPTION_NAME: string = '鐃?鐃?鐃?鐃?';
994 BLANK_HTML: string = 'about:blank';
995 SELECTCOMBOBOX_NAME: string = ''; // '鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申';
996 SELECTCOMBOBOX_COLOR: TColor = clWindow;
997 //D&D鐃緒申鐃?
998 DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel)
999 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1000 ITEM_ICON_2CH1 = 0; //2ch鐃?鐃?鐃?鐃緒申
1001 ITEM_ICON_2CH2 = 1; //2ch鐃?鐃?鐃?鐃緒申
1002 ITEM_ICON_CATEGORY1 = 2; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1003 ITEM_ICON_CATEGORY2 = 3; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1004 ITEM_ICON_BOARD1 = 4; //鐃緒申鐃?鐃?鐃?鐃緒申
1005 ITEM_ICON_BOARD2 = 5; //鐃緒申鐃?鐃?鐃?鐃緒申
1006 ITEM_ICON_THREADLOG1 = 6; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1007 ITEM_ICON_THREADLOG2 = 7; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1008 ITEM_ICON_THREAD1 = 8; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1009 ITEM_ICON_THREAD2 = 9; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1010 ITEM_ICON_THREADNEW1 = 10; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1011 ITEM_ICON_THREADNEW2 = 11; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1012 ITEM_ICON_SORT1 = 12; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
1013 ITEM_ICON_SORT2 = 13; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
1014
1015 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1016 TOOL_ICON_HEIGHT_MAX = 16; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1017 TOOL_ICON_HEIGHT_MIN = 17; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1018 TOOL_ICON_HEIGHT_NORMAL = 18; //鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1019 TOOL_ICON_WIDTH_MAX = 19; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1020 TOOL_ICON_WIDTH_MIN = 20; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1021 TOOL_ICON_WIDTH_NORMAL = 21; //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1022
1023 TOOL_ICON_FAV_FOLDER = 30; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申
1024 TOOL_ICON_FAV_BOARD = 31; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1025 TOOL_ICON_FAV_THREAD = 32; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1026
1027 HTML_FILE_NAME = 'temp_preview.html';
1028
1029 {$R *.DFM}
1030
1031 procedure TGikoForm.CreateParams(var Params: TCreateParams);
1032 begin
1033 inherited;
1034 if FormStyle in [fsNormal, fsStayOnTop] then begin
1035 if BorderStyle in [bsSingle, bsSizeable] then begin
1036 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
1037 Params.WndParent := 0;
1038 end;
1039 end;
1040 end;
1041
1042 procedure TGikoForm.FormCreate(Sender: TObject);
1043 const
1044 TVS_NOTOOLTIPS = $0080;
1045 var
1046 FileName: string;
1047 Style: DWORD;
1048 msg: string;
1049 i: Integer;
1050 wp: TWindowPlacement;
1051 s: string;
1052 begin
1053 {$IFDEF DEBUG}
1054 AllocConsole;
1055 Writeln('============================================================');
1056 Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
1057 Writeln('');
1058 Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
1059 Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
1060 Writeln('============================================================');
1061 {$ENDIF}
1062 Application.OnDeactivate := AppFormDeactivate;
1063 Self.OnDeactivate := AppFormDeactivate;
1064 Application.HookMainWindow(Hook);
1065
1066 FTreeType := gttNone;
1067
1068 FSearchDialog := nil;
1069
1070 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1071 Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
1072
1073 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1074 RoundList := TRoundList.Create;
1075 RoundList.LoadRoundFile;
1076
1077 //BBS鐃緒申鐃緒申
1078 BBS2ch := TBBS2ch.Create(GikoSys.Setting.LogFolder);
1079
1080 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1081 // FFavorite := TFavorite.Create(FavoriteTreeView);
1082 FavoriteDM.SetFavTreeView(FavoriteTreeView);
1083 FavoriteDM.ReadFavorite;
1084
1085 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1086 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1087
1088 EnabledCloseButton := True;
1089 BoardGroup.BBS2ch.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1090 // SetBoardTreeNode; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1091
1092 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1093 ListView.ViewStyle := GikoSys.Setting.ListStyle;
1094
1095 //鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1096 // MainCoolBar.Top := 0;
1097 // MainCoolBar.Left := 0;
1098
1099 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
1100 AnimePanel.Top := 0;
1101 AnimePanel.Left := 0;
1102
1103 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1104
1105 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1106 CabinetVisibleAction.Checked := not GikoSys.Setting.CabinetVisible;
1107 CabinetVisibleAction.Execute;
1108 CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
1109
1110 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1111 MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
1112 MsgBarVisibleActionExecute(nil);
1113 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
1114
1115 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1116 StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
1117 StatusBarVisibleActionExecute(nil);
1118
1119 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1120 TreeView.Items.BeginUpdate;
1121 FavoriteTreeView.Items.BeginUpdate;
1122 ListView.Items.BeginUpdate;
1123 try
1124 TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1125 TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1126 TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1127 TreeView.Color := GikoSys.Setting.CabinetBackColor;
1128
1129 FavoriteTreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1130 FavoriteTreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1131 FavoriteTreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1132 FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
1133
1134 ListView.Font.Name := GikoSys.Setting.ListFontName;
1135 ListView.Font.Size := GikoSys.Setting.ListFontSize;
1136 ListView.Font.Color := GikoSys.Setting.ListFontColor;
1137 ListView.Color := GikoSys.Setting.ListBackColor;
1138 finally
1139 TreeView.Items.EndUpdate;
1140 FavoriteTreeView.Items.EndUpdate;
1141 ListView.Items.EndUpdate;
1142 end;
1143 //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
1144 ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
1145
1146 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1147 BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1148 BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1149 FDragWFirst := false;
1150
1151 // TreeView.TopItem.Expanded := True; //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1152 // TreeView.Selected := TreeView.Items[0]; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1153 SetContent(nil); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1154
1155 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1156 wp.length := sizeof(wp);
1157 wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1158 wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1159 wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1160 wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1161 wp.showCmd := SW_HIDE;
1162 SetWindowPlacement(Handle, @wp);
1163
1164 // SetBounds(GikoSys.Setting.WindowLeft, GikoSys.Setting.WindowTop,
1165 // GikoSys.Setting.WindowWidth, GikoSys.Setting.WindowHeight);
1166 if GikoSys.Setting.WindowMax then
1167 WindowState := wsMaximized;
1168
1169 //鐃?鐃?鐃?鐃?鐃緒申
1170 try
1171 FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1172 if FileExists(FileName) then
1173 Animate.FileName := FileName;
1174 except
1175 end;
1176 // AnimePanel.Height := 26;
1177 // AnimePanel.Width := 39;
1178 // AnimePanel.Top := 2;
1179 // AnimePanel.Left := Width - 48;
1180
1181 //鐃?鐃?鐃?鐃?
1182 FNameCookie := '';
1183 FMailCookie := '';
1184
1185 //鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1186 AllItemAction.Checked := True;
1187 AllResAction.Checked := True;
1188
1189 //TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申
1190 Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
1191 Style := Style or TVS_NOTOOLTIPS;
1192 SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
1193
1194 // 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1195 TreeView.Align := alClient;
1196 FavoriteTreeView.Align := alClient;
1197 FavoriteTreeView.Visible := False;
1198
1199 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1200 // FBrowserSizeFlag := False;
1201 // FBrowserSizeHeight := ViewPanel.Height;
1202
1203 FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1204 FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1205
1206 ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1207 ArrangeAction.Execute;
1208
1209 if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1210 case GikoSys.Setting.ListWidthState of
1211 glsMax: begin
1212 ViewPanel.Width := 1;
1213 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1214 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1215 end;
1216 glsMin: begin
1217 ViewPanel.Width := GikoSys.Setting.ListWidth;
1218 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1219 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1220 end;
1221 else begin
1222 ViewPanel.Width := GikoSys.Setting.ListWidth;
1223 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1224 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1225 end;
1226 end;
1227 // if GikoSys.Setting.ListWidthMax then begin
1228 // ViewPanel.Width := 1;
1229 // BrowserSizeAction.ImageIndex := ICON_WIDTH_MIN;
1230 // end else begin
1231 // ViewPanel.Width := GikoSys.Setting.ListWidth;
1232 // BrowserSizeAction.ImageIndex := ICON_WIDTH_MAX;
1233 // end;
1234 end else begin
1235 case GikoSys.Setting.ListHeightState of
1236 glsMax: begin
1237 ViewPanel.Height := 1;
1238 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1239 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1240 end;
1241 glsMin: begin
1242 ViewPanel.Height := GikoSys.Setting.ListHeight;
1243 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1244 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1245 end;
1246 else begin
1247 ViewPanel.Height := GikoSys.Setting.ListHeight;
1248 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1249 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1250 end;
1251 end;
1252 // if GikoSys.Setting.ListHeightState = glsMax then begin
1253 // end else begin
1254 // ViewPanel.Height := GikoSys.Setting.ListHeight;
1255 // BrowserSizeAction.ImageIndex := ICON_HEIGHT_MAX;
1256 // end;
1257 end;
1258
1259 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1260 // ProgressBar.Visible := False;
1261 ProgressBar.Parent := StatusBar;
1262 ProgressBar.Top := 2;
1263 ProgressBar.Left := 0;
1264 ProgressBar.Width := StatusBar.Panels[0].Width;
1265 ProgressBar.Height := StatusBar.Height - 2;
1266 ProgressBar.Position := 0;
1267
1268 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1269 //formshow()鐃緒申鐃緒申鐃緒申
1270
1271 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1272 // FDownload := TDownload.Create;
1273 // FDownload.OnDownloadEnd := OnDonloadEnd;
1274 // FDownload.OnWork := Work;
1275 // FDownload.OnWorkBegin := WorkBegin;
1276 // FDownload.OnWorkEnd := WorkEnd;
1277
1278 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1279 FControlThread := TThreadControl.Create(True);
1280 FControlThread.MaxThreadCount := 1;
1281 FControlThread.Resume;
1282 FControlThread.OnDownloadEnd := DownloadEnd;
1283 FControlThread.OnDownloadMsg := DownloadMsg;
1284 FControlThread.OnWork := Work;
1285 FControlThread.OnWorkBegin := WorkBegin;
1286 FControlThread.OnWorkEnd := WorkEnd;
1287 // ProgressPanel.Width := FControlThread.MaxThreadCount * 12;
1288
1289 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1290 FHistoryList := TList.Create;
1291
1292 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1293 SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1294
1295 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1296 SetBrowserTabState;
1297
1298 BrowserBoardNameLabel.Caption := '';
1299 BrowserNameLabel.Caption := '';
1300 FWorkCount := 0;
1301
1302 // DetailIconAction.Execute;
1303
1304 // FBrowserSizeHeight := ViewPanel.Height;
1305 FTabHintIndex := -1;
1306
1307 //鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1308 // if not GikoSys.DirectoryExistsEx(BBS2ch.GetLogFolder) then begin
1309 // GikoSys.ForceDirectoriesEx(BBS2ch.GetLogFolder);
1310 // end;
1311 // FormResize(Sender);
1312 // MainCoolBarResize(Sender);
1313 // Application.ProcessMessages;
1314
1315 //鐃緒申鐃緒申鐃?鐃?鐃?
1316 SetLinkBar;
1317
1318 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
1319 SetMenuFont;
1320
1321 //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1322 ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1323 BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1324
1325 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1326 ReadToolBarSetting(ActionList, StdToolBar);
1327 ReadToolBarSetting(ActionList, ListToolBar);
1328 try
1329 for i := ListToolBar.ControlCount - 1 downto 0 do
1330 begin
1331 if ListToolBar.Controls[ i ].Action = SelectItemAction then
1332 begin
1333 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1334 if (i + 1) < ListToolBar.ControlCount then
1335 if ListToolBar.Controls[ i + 1 ] is TToolButton then
1336 if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
1337 ListToolBar.Controls[ i + 1 ].Visible := False;
1338
1339 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申
1340 ListToolBar.Controls[ i ].Visible := False;
1341 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申
1342 SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
1343 SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
1344 SelectComboBox.Parent := ListToolBar;
1345 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1346 SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
1347 SelectComboBoxSplitter.Parent := ListToolBar;
1348
1349 break;
1350 end;
1351 end;
1352 except
1353 end;
1354 ReadToolBarSetting(ActionList, BrowserToolBar);
1355 SetToolBarPopup;
1356 OnlyAHundredRes.Checked := GikoSys.Setting.OnlyAHundredRes;
1357 //鐃?鐃?鐃緒申鐃?鐃?鐃?
1358 AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1359
1360 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1361
1362 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1363 if not FileExists(GikoSys.GetBoardFileName) then begin
1364 msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1365 + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1366 + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1367 MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1368 NewBoardAction.Execute;
1369 end;
1370
1371 //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1372 GikoSys.LoadKeySetting(ActionList);
1373
1374 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1375 // FLastRoundTime := 0;
1376
1377 //ResHint
1378 FHint := TResPopup.Create(Self);
1379
1380 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申鐃緒申)
1381 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?)
1382 i := GikoSys.Setting.CabinetIndex;
1383 Cabinet2chAction.Execute;
1384 GikoSys.Setting.CabinetIndex := i;
1385
1386 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1387 Case GikoSys.Setting.CabinetIndex of
1388 0: Cabinet2chAction.Execute;
1389 1: CabinetHistoryAction.Execute;
1390 2: CabinetFavoriteAction.Execute;
1391 end;
1392
1393 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1394 if GikoSys.Setting.AutoLogin then
1395 LoginAction.Execute;
1396
1397 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1398 for i := 1 to ParamCount do begin
1399 MoveToURL(ParamStr(i));
1400 end;
1401 // SetStdToolBar;
1402 // SetLinkBar;
1403
1404 s := GikoSys.FAbon.NGwordname;
1405 StatusBar.Panels[2].Text := s;
1406 StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
1407 StatusBarResize(Sender);
1408
1409 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?
1410 InitializeBoardPlugIns;
1411 end;
1412
1413 //
1414 //
1415 //
1416 procedure TGikoForm.FormShow(Sender: TObject);
1417 var
1418 i: Integer;
1419 CoolSet: TCoolSet;
1420 begin
1421 ShowWindow(Application.Handle, SW_HIDE);
1422
1423 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1424 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1425 StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1426 StdToolBarVisibleActionExecute( nil );
1427 AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1428 AddressBarVisibleActionExecute( nil );
1429 LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1430 LinkBarVisibleActionExecute( nil );
1431 ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1432 ListToolBarVisibleActionExecute( nil );
1433 ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1434 ListNameBarVisibleActionExecute( nil );
1435 BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1436 BrowserToolBarVisibleActionExecute( nil );
1437 BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1438 BrowserNameBarVisibleActionExecute( nil );
1439
1440 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1441 BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1442 BrowserTabVisibleActionExecute(nil);
1443
1444 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1445 BrowserTabTopAction.Checked := True;
1446 BrowserTabTopActionExecute(nil);
1447 end else begin
1448 BrowserTabBottomAction.Checked := True;
1449 BrowserTabBottomActionExecute(nil);
1450 end;
1451
1452 if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1453 BrowserTabTabStyleAction.Checked := True;
1454 BrowserTabTabStyleActionExecute(nil);
1455 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1456 BrowserTabButtonStyleAction.Checked := True;
1457 BrowserTabButtonStyleActionExecute(nil);
1458 end else begin
1459 BrowserTabFlatStyleAction.Checked := True;
1460 BrowserTabFlatStyleActionExecute(nil);
1461 end;
1462
1463
1464 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1465 MainCoolBar.Bands.BeginUpdate;
1466 try
1467 for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1468 CoolSet := GikoSys.Setting.MainCoolSet[i];
1469 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1470 Continue;
1471 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1472 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1473 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1474 end;
1475 finally
1476 MainCoolBar.Bands.EndUpdate;
1477 end;
1478
1479 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1480 ListCoolBar.Bands.BeginUpdate;
1481 try
1482 for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1483 CoolSet := GikoSys.Setting.ListCoolSet[i];
1484 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1485 Continue;
1486 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1487 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1488 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1489 end;
1490 finally
1491 ListCoolBar.Bands.EndUpdate;
1492 end;
1493
1494 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1495 BrowserCoolBar.Bands.BeginUpdate;
1496 try
1497 for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1498 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1499 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1500 Continue;
1501 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1502 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1503 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1504 end;
1505 finally
1506 BrowserCoolBar.Bands.EndUpdate;
1507 end;
1508
1509 end;
1510 {
1511 procedure TGikoForm.SetStdToolBar;
1512 var
1513 i: Integer;
1514 FileName: string;
1515 ini: TMemIniFile;
1516 s: string;
1517 Action: TContainedAction;
1518 ToolButton: TToolButton;
1519 begin
1520 exit;
1521 for i := StdToolBar.ButtonCount - 1 downto 0 do begin
1522 StdToolBar.RemoveControl(StdToolBar.Buttons[i]);
1523 //StdToolBar.Buttons[i].Free;
1524 end;
1525 FileName := GikoSys.GetConfigDir + 'ToolBar.ini';
1526 ini := TMemIniFile.Create(FileName);
1527 i := 0;
1528 while true do begin
1529 s := ini.ReadString('StdToolBar', IntToStr(i), '');
1530 if s = '' then
1531 Break;
1532 if s = '-' then begin
1533 ToolButton := TToolButton.Create(StdToolBar);
1534 ToolButton.Style := tbsSeparator;
1535 ToolButton.Width := 8;
1536 ToolButton.Left := 10000;
1537 StdToolBar.InsertControl(ToolButton);
1538 end else begin
1539 Action := GetAction(s);
1540 if Action <> nil then begin
1541 ToolButton := TToolButton.Create(StdToolBar);
1542 ToolButton.Action := Action;
1543 ToolButton.Left := 10000;
1544 StdToolBar.InsertControl(ToolButton);
1545 end;
1546 end;
1547 Inc(i);
1548 end;
1549 end;
1550 }
1551 {function TGikoForm.GetAction(ActionName: string): TContainedAction;
1552 var
1553 i: Integer;
1554 begin
1555 for i := 0 to ActionList.ActionCount - 1 do begin
1556 if ActionList.Actions[i].Name = ActionName then begin
1557 Result := ActionList.Actions[i];
1558 Exit;
1559 end;
1560 end;
1561 Result := nil;
1562 end;}
1563
1564 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1565 var
1566 i: Integer;
1567 CoolSet: TCoolSet;
1568 wp: TWindowPlacement;
1569 begin
1570 if ( GikoSys.Setting.ShowDialogForEnd ) and
1571 (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1572 CanClose := false;
1573 Exit;
1574 end else begin
1575 CanClose := True;
1576 end;
1577 Application.OnDeactivate := nil;
1578 Self.OnDeactivate := nil;
1579
1580 //column鐃緒申
1581 if GetActiveList is TBBS2ch then begin
1582 for i := 0 to ListView.Columns.Count - 1 do
1583 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
1584 end else if GetActiveList is TCategory then begin
1585 for i := 0 to ListView.Columns.Count - 1 do
1586 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
1587 end else if GetActiveList is TBoard then begin
1588 for i := 0 to ListView.Columns.Count - 1 do
1589 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1590 end;
1591
1592 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1593 wp.length := sizeof(wp);
1594 GetWindowPlacement(Handle, @wp);
1595 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1596 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1597 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1598 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1599 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1600
1601 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1602 GikoSys.Setting.CabinetVisible := CabinetVisibleAction.Checked;
1603 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1604 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1605 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1606 if ArrangeAction.Checked then
1607 GikoSys.Setting.ListOrientation := gloVertical
1608 else
1609 GikoSys.Setting.ListOrientation := gloHorizontal;
1610 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1611
1612 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1613 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1614 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1615 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1616 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1617 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1618 end;
1619 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1620 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1621 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1622 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1623 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1624 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1625 end;
1626 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1627 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1628 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1629 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1630 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1631 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1632 end;
1633
1634 GikoSys.Setting.WriteWindowSettingFile;
1635 GikoSys.Setting.WriteNameMailSettingFile;
1636
1637 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1638 try
1639 FavoriteDM.WriteFavorite;
1640 except
1641 end;
1642 // Favorite.Free;
1643
1644 try
1645 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1646 NotSelectTabCloseAction.Execute;
1647 if BrowserTab.Tabs.Count >= 1 then begin
1648 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1649 end;
1650 except
1651 end;
1652
1653 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1654 try
1655 RoundList.SaveRoundFile;
1656 except
1657 end;
1658 try
1659 RoundList.Clear;
1660 except
1661 end;
1662 try
1663 RoundList.Free;
1664 except
1665 end;
1666
1667 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1668 try
1669 FHistoryList.Free;
1670 except
1671 end;
1672
1673 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1674 try
1675 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1676 except
1677 end;
1678
1679 try
1680 FControlThread.Terminate;
1681 except
1682 end;
1683
1684 // FDownload.Free;
1685 try
1686 SetActiveList(nil);
1687 except
1688 end;
1689 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1690 Sleep(10);
1691 try
1692 TreeView.Items.Clear;
1693 except
1694 end;
1695
1696 try
1697 if FavoriteDM <> nil then
1698 FavoriteDM.Free;
1699 FavoriteDM := nil;
1700 if AddressHistoryDM <> nil then
1701 AddressHistoryDM.Free;
1702 AddressHistoryDM := nil;
1703 except
1704 end;
1705 try
1706 if BBS2ch <> nil then
1707 BBS2ch.Free;
1708 BBS2ch := nil;
1709 except
1710 end;
1711
1712 try
1713 //Hint鐃?鐃緒申
1714 if FHint <> nil then begin
1715 FHint.ReleaseHandle;
1716 FHint.Free;
1717 FHint := nil;
1718 end;
1719 //Preview鐃?鐃緒申
1720 if TPreviewBrowser <> nil then begin
1721 FPreviewBrowser.Free;
1722 FPreviewBrowser := nil;
1723 end;
1724 except
1725 end;
1726 end;
1727
1728 procedure TGikoForm.FormDestroy(Sender: TObject);
1729 //var
1730 // wp: TWindowPlacement;
1731 begin
1732 { //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1733 FHistoryList.Free;
1734
1735 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1736 wp.length := sizeof(wp);
1737 GetWindowPlacement(Handle, @wp);
1738
1739 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1740 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1741 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1742 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1743 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1744
1745 GikoSys.Setting.CabinetVisible := CabinetPanel.Visible;
1746 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1747
1748 GikoSys.Setting.WriteWindowSettingFile;
1749 GikoSys.Setting.WriteNameMailSettingFile;
1750 FDownload.Free;
1751 BBS2ch.Free;}
1752 end;
1753
1754 //鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1755 procedure TGikoForm.FormClose(Sender: TObject; var Action: TCloseAction);
1756 begin
1757 Application.Terminate;
1758 Action := caFree;
1759 end;
1760
1761 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1762 procedure TGikoForm.CabinetPanelHide(Sender: TObject);
1763 begin
1764 CabinetVisibleAction.Execute;
1765 // CabinetPanelVisible(false);
1766 end;
1767
1768 procedure TGikoForm.ReloadBBS;
1769 begin
1770 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1771 NotSelectTabCloseAction.Execute;
1772 if BrowserTab.Tabs.Count >= 1 then
1773 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1774 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1775 FHistoryList.Clear;
1776 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1777 TreeView.Items.Clear;
1778
1779 //BBS鐃?鐃緒申
1780 BBS2ch.Free;
1781
1782 SetActiveList(nil);
1783
1784 FTreeType := gttNone;
1785
1786 //BBS鐃緒申鐃緒申
1787 BBS2ch := TBBS2ch.Create(GikoSys.Setting.LogFolder);
1788
1789 BBS2ch.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1790 Show2chTree;
1791 end;
1792
1793 //鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1794 procedure TGikoForm.SetBoardTreeNode;
1795 var
1796 i, j: integer;
1797 Root: TTreeNode;
1798 CategoryNode: TTreeNode;
1799 BoardNode: TTreeNode;
1800 Category: TCategory;
1801 Board: TBoard;
1802 begin
1803 TreeView.Items.BeginUpdate;
1804 TreeView.Items.Clear;
1805 try
1806 Root := TreeView.Items.Add(nil, BBS2ch.Title);
1807 Root.ImageIndex := ITEM_ICON_2CH1;
1808 Root.SelectedIndex := ITEM_ICON_2CH2;
1809 Root.Data := BBS2ch;
1810 if SplashWindow <> nil then
1811 SplashWindow.ProgressBar.Max := BoardGroup.BBS2ch.Count;
1812
1813 for i := 0 to BoardGroup.BBS2ch.Count - 1 do begin
1814 Category := TCategory(BoardGroup.BBS2ch.Items[i]);
1815 CategoryNode := TreeView.Items.AddChild(Root, Category.Title);
1816 CategoryNode.Data := Category;
1817 CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
1818 CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
1819
1820 for j := 0 to Category.Count - 1 do begin
1821 Board := TBoard(Category.Items[j]);
1822 Board.BeginUpdate;
1823 BoardNode := TreeView.Items.AddChild(CategoryNode, Board.Title);
1824 BoardNode.Data := Board;
1825 BoardNode.ImageIndex := ITEM_ICON_BOARD1;
1826 BoardNode.SelectedIndex := ITEM_ICON_BOARD2;
1827 Board.LoadSettings;
1828 Board.EndUpdate;
1829 end;
1830
1831 CategoryNode.Expanded := Category.NodeExpand;
1832
1833 if SplashWindow <> nil then begin
1834 SplashWindow.ProgressBar.StepIt;
1835 Application.ProcessMessages;
1836 end;
1837
1838 end;
1839 finally
1840 TreeView.Items.EndUpdate;
1841 end;
1842 end;
1843
1844 function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
1845 const
1846 COLUMN: array[0..0] of string = ('鐃?鐃?鐃?鐃緒申鐃緒申');
1847 var
1848 ListColumn: TListColumn;
1849 i: Integer;
1850 begin
1851 ListView.Items.BeginUpdate;
1852 try
1853 Screen.Cursor := crHourGlass;
1854
1855 ListView.Columns.Clear;
1856 for i := 0 to Length(COLUMN) - 1 do begin
1857 ListColumn := ListView.Columns.Add;
1858 ListColumn.Caption := COLUMN[i];
1859 ListColumn.Width := GikoSys.Setting.BBSColumnWidth[i];
1860 end;
1861
1862 ListView.Items.Count := 0;
1863 ListView.Items.Clear;
1864 ListView.Items.Count := ABBS2ch.Count;
1865
1866 // UpFolderAction.Enabled := False;
1867 // AllItemAction.Enabled := False;
1868 // LogItemAction.Enabled := False;
1869 // NewItemAction.Enabled := False;
1870 // SelectItemAction.Enabled := False;
1871 // ListDownloadToolButton.Enabled := False;
1872 // BoardReservToolButton.Enabled := False;
1873 // ListThreadDownloadToolButton.Enabled := False;
1874
1875 ListNameLabel.Caption := ABBS2ch.Title;
1876 FolderImage.Picture := nil;
1877 ItemIcon16.GetBitmap(1, FolderImage.Picture.Bitmap);
1878
1879 FSortIndex := 0;
1880 FSortOrder := False;
1881 ListViewColumnClick(nil, ListView.Column[0]);
1882
1883 Result := ABBS2ch.Count;
1884 finally
1885 Screen.Cursor := crDefault;
1886 ListView.Items.EndUpdate;
1887 end;
1888 end;
1889
1890 function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
1891 const
1892 COLUMN: array[0..2] of string = ('鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1893 var
1894 ListColumn: TListColumn;
1895 i: Integer;
1896 begin
1897 ListView.Items.BeginUpdate;
1898 try
1899 Screen.Cursor := crHourGlass;
1900
1901 ListView.Columns.Clear;
1902 for i := 0 to Length(COLUMN) - 1 do begin
1903 ListColumn := ListView.Columns.Add;
1904 ListColumn.Caption := COLUMN[i];
1905 ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[i];
1906 end;
1907
1908 ListView.Items.Count := 0;
1909 ListView.Items.Clear;
1910 ListView.Items.Count := Category.Count;
1911
1912 // UpFolderAction.Enabled := True;
1913 // AllItemAction.Enabled := False;
1914 // LogItemAction.Enabled := False;
1915 // NewItemAction.Enabled := False;
1916 // SelectItemAction.Enabled := False;
1917 // ListDownloadToolButton.Enabled := False;
1918 // BoardReservToolButton.Enabled := False;
1919 // ListThreadDownloadToolButton.Enabled := False;
1920
1921 ListNameLabel.Caption := Category.Title;
1922 FolderImage.Picture := nil;
1923 ItemIcon16.GetBitmap(3, FolderImage.Picture.Bitmap);
1924
1925 FSortIndex := 0;
1926 FSortOrder := False;
1927 ListViewColumnClick(nil, ListView.Column[0]);
1928
1929 Result := Category.Count;
1930 finally
1931 Screen.Cursor := crDefault;
1932 ListView.Items.EndUpdate;
1933 end;
1934 end;
1935
1936 function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
1937 const
1938 COLUMN: array[0..6] of string = ('鐃?鐃緒申鐃?鐃?鐃緒申', '鐃?鐃?鐃緒申鐃?', '鐃緒申鐃緒申', '鐃?鐃緒申',
1939 '鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1940 COLUMN_ALIGNMENT: array[0..6] of TAlignment = (taLeftJustify, taRightJustify,
1941 taRightJustify, taRightJustify,
1942 taRightJustify, taLeftJustify,
1943 taLeftJustify);
1944 //No, 鐃?鐃緒申鐃?鐃?鐃緒申, 鐃?鐃?鐃緒申鐃?, 鐃緒申鐃緒申鐃?鐃緒申, 鐃緒申鐃緒申鐃緒申鐃緒申
1945 var
1946 ListColumn: TListColumn;
1947 i: Integer;
1948 begin
1949 ListView.Items.BeginUpdate;
1950 try
1951 Screen.Cursor := crHourGlass;
1952
1953 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1954 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1955 if ListView.Columns.Count <> (High( COLUMN ) - Low( COLUMN ) + 1) then
1956 begin
1957 ListView.Columns.Clear;
1958 for i := 0 to Length(COLUMN) - 1 do begin
1959 ListColumn := ListView.Columns.Add;
1960 ListColumn.Caption := COLUMN[i];
1961 ListColumn.Width := GikoSys.Setting.BoardColumnWidth[i];
1962 ListColumn.Alignment := COLUMN_ALIGNMENT[i];
1963 end;
1964 end;
1965
1966 ListView.Items.Count := 0;
1967 ListView.Items.Clear;
1968
1969 case GikoForm.ViewType of
1970 gvtAll: ListView.Items.Count := Board.Count;
1971 gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
1972 gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
1973 gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
1974 end;
1975
1976 ListNameLabel.Caption := Board.Title;
1977 FolderImage.Picture := nil;
1978 ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
1979
1980 FSortIndex := 0;
1981 FSortOrder := False;
1982 ListViewColumnClick(nil, ListView.Column[0]);
1983
1984 Result := Board.Count;
1985 finally
1986 Screen.Cursor := crDefault;
1987 ListView.Items.EndUpdate;
1988 end;
1989 end;
1990
1991 procedure TGikoForm.TreeViewChange(Sender: TObject; Node: TTreeNode);
1992 var
1993 i: Integer;
1994 begin
1995 if FTreeType = gttHistory then begin
1996 // SetContent(TThreadItem(Node.Data));
1997 InsertBrowserTab(TThreadItem(Node.Data));
1998 Exit;
1999 end;
2000
2001 ListView.Selected := nil;
2002 ListView.Items.Count := 0;
2003 ListView.Items.Clear;
2004 // ListView.Columns.Clear;
2005
2006 Caption := CAPTION_NAME;
2007 //Application.Title := CAPTION_NAME;
2008
2009
2010 if GetActiveList is TBBS2ch then begin
2011 for i := 0 to ListView.Columns.Count - 1 do
2012 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
2013 end else if GetActiveList is TCategory then begin
2014 for i := 0 to ListView.Columns.Count - 1 do
2015 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
2016 end else if GetActiveList is TBoard then begin
2017 for i := 0 to ListView.Columns.Count - 1 do
2018 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
2019 end;
2020
2021 if TObject(Node.Data) is TBBS2ch then begin
2022 SetActiveList(Node.data);
2023 end else if TObject(Node.Data) is TCategory then begin
2024 SetActiveList(Node.data);
2025 end else if TObject(Node.Data) is TBoard then begin
2026 if not TBoard(Node.Data).IsThreadDatRead then begin
2027 Screen.Cursor := crHourGlass;
2028 try
2029 GikoSys.ReadSubjectFile(TBoard(Node.Data));
2030 finally
2031 Screen.Cursor := crDefault;
2032 end;
2033 end;
2034 SetActiveList(Node.data);
2035 end;
2036 end;
2037
2038 procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
2039 var
2040 // FileName: string;
2041 // DateTime: TDateTime;
2042 BoardCnt: Integer;
2043 BBS: TBBS2ch;
2044 Category: TCategory;
2045 Board: TBoard;
2046 ThreadItem: TThreadItem;
2047 RepStr: string;
2048 begin
2049 if ActiveList is TBBS2ch then begin
2050 BBS := TBBS2ch(ActiveList);
2051
2052 ListView.StateImages := nil;
2053
2054 if BBS = nil then Exit;
2055 if BBS.Count <= 0 then Exit;
2056 if Item = nil then Exit;
2057 if Item.Index > BBS.Count then Exit;
2058 if ListView.Items.Count = 0 then Exit;
2059
2060 if not (BBS.Items[Item.Index] is TCategory) then Exit;
2061 Category := TCategory(BBS.Items[Item.Index]);
2062
2063 if Category = nil then Exit;
2064
2065 if ListNumberVisibleAction.Checked then
2066 Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
2067 else
2068 Item.Caption := Category.Title;
2069
2070 Item.ImageIndex := ITEM_ICON_CATEGORY1;
2071 Item.Data := Category;
2072 end else if ActiveList is TCategory then begin
2073 Category := TCategory(ActiveList);
2074
2075 ListView.StateImages := nil;
2076
2077 if Category = nil then Exit;
2078 if Category.Count <= 0 then Exit;
2079 if Item = nil then Exit;
2080 if Item.Index >= Category.Count then Exit;
2081 if ListView.Items.Count = 0 then Exit;
2082
2083 if not (Category.Items[Item.Index] is TBoard) then Exit;
2084 Board := TBoard(Category.Items[Item.Index]);
2085
2086 if Board = nil then Exit;
2087
2088 if ListNumberVisibleAction.Checked then
2089 Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
2090 else
2091 Item.Caption := Board.Title;
2092
2093 if Item.SubItems.Count <> 2 then begin
2094 Item.SubItems.Clear;
2095 Item.SubItems.Add('');
2096 Item.SubItems.Add('');
2097 end;
2098
2099 Item.ImageIndex := ITEM_ICON_BOARD1;
2100
2101 if Board.Round then
2102 Item.SubItems[0] := Board.RoundName // '鐃?鐃緒申'
2103 else
2104 Item.SubItems[0] := '';
2105
2106 if Board.RoundDate = ZERO_DATE then begin
2107 Item.SubItems[1] := '';
2108 end else
2109 Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
2110 Item.Data := Board;
2111 end else if ActiveList is TBoard then begin
2112 Board := TBoard(ActiveList);
2113
2114 if GikoSys.Setting.ListIconVisible then
2115 ListView.StateImages := StateIconImageList
2116 else
2117 ListView.StateImages := nil;
2118
2119 case GikoForm.ViewType of
2120 gvtAll: BoardCnt := Board.Count;
2121 gvtLog: BoardCnt := Board.GetLogThreadCount;
2122 gvtNew: BoardCnt := Board.GetNewThreadCount;
2123 gvtUser: BoardCnt := Board.GetUserThreadCount;
2124 else
2125 BoardCnt := 0;
2126 end;
2127
2128 // if Board = nil then Exit;
2129 if BoardCnt <= 0 then Exit;
2130 if Item = nil then Exit;
2131 if Item.Index > BoardCnt then Exit;
2132 if ListView.Items.Count = 0 then Exit;
2133
2134 // if not (Board.Items[Item.Index] is TThreadItem) then Exit;
2135
2136 ThreadItem := nil;
2137 case GikoForm.ViewType of
2138 gvtAll: ThreadItem := TThreadItem(Board.Items[Item.Index]);
2139 gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
2140 gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
2141 gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
2142 end;
2143
2144 if ThreadItem = nil then Exit;
2145
2146 // if ListNumberVisibleAction.Checked then
2147 // RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title
2148 // else
2149 RepStr := ThreadItem.Title;
2150 //RepStr := StringReplace(RepStr, '&amp;', '&', [rfReplaceAll]);
2151 RepStr := StringReplace(RepStr, '&lt;', '<', [rfReplaceAll]);
2152 RepStr := StringReplace(RepStr, '&gt;', '>', [rfReplaceAll]);
2153 RepStr := StringReplace(RepStr, '&quot;', '"', [rfReplaceAll]);
2154 RepStr := StringReplace(RepStr, '&amp', '&', [rfReplaceAll]);
2155 //RepStr := StringReplace(RepStr, '鐃緒申鐃?', ',', [rfReplaceAll]);
2156
2157 if Item.SubItems.Count <> 6 then begin
2158 Item.SubItems.Clear;
2159 Item.SubItems.Add('');
2160 Item.SubItems.Add('');
2161 Item.SubItems.Add('');
2162 Item.SubItems.Add('');
2163 Item.SubItems.Add('');
2164 Item.SubItems.Add('');
2165 end;
2166
2167 if ListNumberVisibleAction.Checked then
2168 Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
2169 else
2170 Item.Caption := RepStr;
2171
2172 case ThreadItem.AgeSage of
2173 gasNone: Item.StateIndex := -1;
2174 gasNew: Item.StateIndex := 0;
2175 gasAge: Item.StateIndex := 1;
2176 gasSage: Item.StateIndex := 2;
2177 end;
2178
2179 if ThreadItem.IsLogFile then begin
2180 Item.ImageIndex := ITEM_ICON_THREADLOG1;
2181 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2182 Item.SubItems[1] := IntToStr(ThreadItem.Count);
2183 if ThreadItem.NewResCount = 0 then
2184 Item.SubItems[2] := ''
2185 else
2186 Item.SubItems[2] := IntToStr(ThreadItem.NewResCount);
2187 Item.SubItems[3] := '';
2188 if ThreadItem.Round then
2189 Item.SubItems[4] := ThreadItem.RoundName
2190 else
2191 Item.SubItems[4] := '';
2192 if ThreadItem.RoundDate = ZERO_DATE then begin
2193 Item.SubItems[5] := '';
2194 end else
2195 Item.SubItems[5] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
2196 if ThreadItem.NewArrival then
2197 Item.ImageIndex := ITEM_ICON_THREADNEW1;
2198 end else begin
2199 Item.ImageIndex := ITEM_ICON_THREAD1;
2200 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2201 Item.SubItems[1] := '';
2202 Item.SubItems[2] := '';
2203 Item.SubItems[3] := '';
2204 Item.SubItems[4] := '';
2205 Item.SubItems[5] := '';
2206 end;
2207 Item.Data := ThreadItem;
2208 end;
2209 end;
2210
2211 procedure TGikoForm.ListViewDataFind(Sender: TObject; Find: TItemFind;
2212 const FindString: String; const FindPosition: TPoint; FindData: Pointer;
2213 StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
2214 var Index: Integer);
2215 begin
2216 //
2217 end;
2218
2219 procedure TGikoForm.ListViewDataHint(Sender: TObject; StartIndex,
2220 EndIndex: Integer);
2221 begin
2222 //
2223 end;
2224
2225 procedure TGikoForm.ListViewDataStateChange(Sender: TObject; StartIndex,
2226 EndIndex: Integer; OldState, NewState: TItemStates);
2227 begin
2228 //
2229 end;
2230
2231 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
2232 var
2233 p: TPoint;
2234 s: string;
2235 tmp2: string;
2236 URL: string;
2237 ATitle: Boolean;
2238
2239 wkBBS: string;
2240 wkKey: string;
2241
2242 //wkInt: Integer;
2243 wkIntSt: Integer;
2244 wkIntTo: Integer;
2245
2246 ActiveFileName: string;
2247 e: IHTMLElement;
2248 Ext: string;
2249 PathRec: TPathRec;
2250 begin
2251 try
2252 try
2253 if (FActiveContent <> nil) and (Assigned(Browser.Document)) then begin
2254 if LowerCase(OleVariant(IHTMLDocument2(Browser.Document)).charset) <> 'shift_jis' then
2255 OleVariant(IHTMLDocument2(Browser.Document)).charset := 'shift_jis';
2256 end;
2257 except
2258 end;
2259 finally
2260 end;
2261 if PreviewTimer.Enabled then
2262 PreviewTimer.Enabled := False;
2263 Application.CancelHint;
2264 if GetActiveContent <> nil then
2265 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2266 else
2267 ActiveFileName := '';
2268
2269 StatusBar.Panels[1].Text := Text;
2270
2271 if FHint <> nil then begin
2272 FHint.ReleaseHandle;
2273 FHint.ClearAllRes;
2274 end;
2275 if FPreviewBrowser <> nil then
2276 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2277
2278 if not GikoSys.Setting.UnActivePopup then
2279 if not GikoForm.Active then
2280 Exit;
2281
2282 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2283 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2284
2285 s := '';
2286 Ext := AnsiLowerCase(ExtractFileExt(Text));
2287 if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
2288 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2289 if FPreviewBrowser = nil then begin
2290 FPreviewBrowser := TPreviewBrowser.Create(Self);
2291 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2292 TOleControl(FPreviewBrowser).Parent := nil;
2293 end;
2294 FPreviewBrowser.Navigate('about:blank');//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2295 FPreviewURL := Text;
2296 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2297 PreviewTimer.Enabled := True;
2298 end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
2299 if Pos('mailto:', Text) = 1 then begin
2300 s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
2301 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2302 GetCursorPos(p);
2303 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2304 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2305 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2306 if (Assigned(e)) then begin
2307 tmp2 := GikoSys.ZenToHan(e.Get_outerText);
2308 if (GikoSys.IsNumeric(tmp2)) then begin
2309 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2310 wkBBS := GetActiveContent.ParentBoard.BBSID;
2311 wkKey := ChangeFileExt(GetActiveContent.FileName, '');
2312 wkIntSt := StrToInt(tmp2);
2313 wkIntTo := StrToInt(tmp2);
2314 //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2315 FHint.PopupType := gptThread;
2316 SetResPopupText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2317 end else begin
2318 FHint.PopupType := gptRaw;
2319 FHint.Caption := s;
2320 end;
2321 end;
2322 end else begin
2323 URL := Text;
2324
2325 if Pos('about:blank..', URL) = 1 then
2326 URL := StringReplace(URL, 'about:blank..', 'http://www.2ch.net', []);
2327
2328 PathRec := Gikosys.Parse2chURL2(URL);
2329
2330 if PathRec.FDone then begin
2331
2332 wkIntSt := PathRec.FSt;
2333 wkIntTo := PathRec.FTo;
2334
2335 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2336 wkIntSt := 1;
2337 wkIntTo := 1;
2338 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2339 wkIntSt := wkIntTo;
2340 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2341 wkIntTo := wkIntSt;
2342 end else if wkIntSt > wkIntTo then begin
2343 //wkInt := wkIntTo;
2344 wkIntTo := wkIntSt;
2345 wkIntSt := wkIntTo;
2346 end;
2347 //if wkIntSt = 0 then
2348 // wkIntSt := 1;
2349 //if wkINtTo = 0 then
2350 // wkIntTo := 1;
2351 //if PathRec.FFirst then
2352 // wkIntSt := 1;
2353 if PathRec.FStBegin then
2354 wkIntSt := 1;
2355 if PathRec.FToEnd then
2356 wkIntTo := 9999;
2357
2358 ATitle := ActiveFileName <> PathRec.FKey;
2359
2360 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2361 FHint.PopupType := gptThread;
2362 SetResPopupText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2363 end;
2364 end;
2365
2366 //if s <> '' then
2367 // ShowTextPopup(s);
2368 if FHint.PopupType = gptRaw then begin
2369 if FHint.Caption <> '' then
2370 ShowTextPopup;
2371 end else begin
2372 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
2373 ShowTextPopup;
2374 end;
2375 end;
2376 end;
2377
2378 procedure TGikoForm.BrowserTitleChange(Sender: TObject;
2379 const Text: WideString);
2380 var
2381 Title: string;
2382 begin
2383 if (Text = BLANK_HTML) or (Text = GikoSys.GetHtmlTempFileName) then
2384 Title := CAPTION_NAME
2385 else
2386 Title := CAPTION_NAME + ' - [' + Text + ']';
2387 Caption := Title;
2388 //Application.Title := Title;
2389 end;
2390
2391 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2392 var
2393 SysMenu: HMenu;
2394 //SysMenuApp: HMenu;
2395 begin
2396 FEnabledCloseButton := Enabled;
2397 SysMenu := GetSystemMenu(Handle, False);
2398 //SysMenuApp := GetSystemMenu(Application.Handle, False);
2399
2400 if Enabled then begin
2401 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2402 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2403 end else begin
2404 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2405 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2406 end;
2407
2408 DrawMenuBar(Handle);
2409 //DrawMenuBar(Application.Handle);
2410 end;
2411
2412 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2413 var AllowChange: Boolean);
2414 begin
2415 if FTreeType = gtt2ch then
2416 FSortIndex := -1;
2417 end;
2418
2419 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2420 Shift: TShiftState);
2421 begin
2422 if Key = VK_BACK then begin
2423 // UpFolderButtonClick(Sender);
2424 end else if Key = VK_SPACE then begin
2425 // ListClick;
2426 end else if Key = VK_RETURN then begin
2427 ListDoubleClick;
2428 end;
2429 end;
2430
2431 function TGikoForm.GetHttpState: Boolean;
2432 begin
2433 Result := FHttpState;
2434 end;
2435
2436 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2437 Column: TListColumn);
2438 var
2439 i: Integer;
2440 wkBBS: TBBS2ch;
2441 wkCategory: TCategory;
2442 wkBoard: TBoard;
2443 begin
2444 if FSortIndex = Column.Index then
2445 FSortOrder := not FSortOrder
2446 else
2447 FSortOrder := False;
2448
2449 for i := 0 to ListView.Columns.Count - 1 do
2450 ListView.Column[i].ImageIndex := -1;
2451 if FSortOrder then
2452 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT1
2453 else
2454 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT2;
2455
2456 Sort.SortNoFlag := ListNumberVisibleAction.Checked;
2457
2458 if TObject(TreeView.Selected.Data) is TBBS2ch then begin
2459 wkBBS := TBBS2ch(TreeView.Selected.Data);
2460 Sort.SortOrder := FSortOrder;
2461 Sort.SortIndex := Column.Index;
2462 wkBBS.Sort(CategorySortProc);
2463 ListView.Refresh;
2464 end else if TObject(TreeView.Selected.Data) is TCategory then begin
2465 wkCategory := TCategory(TreeView.Selected.Data);
2466 Sort.SortOrder := FSortOrder;
2467 Sort.SortIndex := Column.Index;
2468 wkCategory.Sort(BoardSortProc);
2469 ListView.Refresh;
2470 end else if TObject(TreeView.Selected.Data) is TBoard then begin
2471 wkBoard := TBoard(TreeView.Selected.Data);
2472 Sort.SortOrder := FSortOrder;
2473 Sort.SortIndex := Column.Index;
2474 wkBoard.Sort(ThreadItemSortProc);
2475 ListView.Refresh;
2476 end;
2477 FSortIndex := Column.Index;
2478 end;
2479
2480 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2481 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2482 var
2483 ARect: TRect;
2484 begin
2485 DefaultDraw := True;
2486 Exit;
2487 DefaultDraw := False;
2488 if (cdsSelected in State) or (cdsHot in State) then begin
2489 Sender.Canvas.Brush.Color := clHighlight;
2490 Sender.Canvas.Font.Color := clHighlightText;
2491 end else begin
2492 Sender.Canvas.Brush.Color := clBtnFace;
2493 Sender.Canvas.Font.Color := clBtnText;
2494 end;
2495 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2496 Sender.Canvas.FillRect(ARect);
2497 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2498 end;
2499
2500 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2501 var
2502 Nodes: TTreeNodes;
2503 i: integer;
2504 begin
2505 Nodes := TreeView.Items;
2506
2507 for i := 0 to Nodes.Count - 1 do begin
2508 if Nodes.Item[i].Data = Data then begin
2509 Result := Nodes.Item[i];
2510 Exit;
2511 end;
2512 end;
2513 Result := nil;
2514 end;
2515
2516 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2517 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2518 Headers: OleVariant; var Cancel: WordBool);
2519 var
2520 sNo: string;
2521 p: TPoint;
2522 const
2523 kMenuName: string = 'menu:';
2524 begin
2525
2526 if Pos(kMenuName, URL) <> 0 then begin
2527 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2528
2529 if not GikoSys.IsNumeric(sNo) then Exit;
2530
2531 Cancel := True;
2532 GetCursorpos(p);
2533 KokoPopupMenu.Tag := StrToInt(sNo);
2534 KokoPopupMenu.Popup(p.x, p.y);
2535 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2536 Cancel := not GikoSys.Setting.OpenMailer;
2537 end;
2538
2539 end;
2540
2541 procedure TGikoForm.ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
2542 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
2543 var DefaultDraw: Boolean);
2544 var
2545 ThreadItem: TThreadItem;
2546 begin
2547 DefaultDraw := True;
2548 // TListView(Sender).Canvas.Font.Style := [];
2549 if TObject(Item.Data) is TThreadItem then begin
2550 ThreadItem := TThreadItem(Item.Data);
2551 // if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then
2552 if ThreadItem.UnRead then
2553 TListView(Sender).Canvas.Font.Style := [fsBold];
2554 end;
2555 end;
2556
2557 procedure TGikoForm.AppFormDeactivate(Sender: TObject);
2558 begin
2559 if Application.Terminated then
2560 Exit;
2561 if PreviewTimer.Enabled then
2562 PreviewTimer.Enabled := False;
2563 //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2564 if FHint <> nil then begin
2565 FHint.ReleaseHandle;
2566 FHint.ClearAllRes;
2567 // FHint.Free;
2568 // FHint := nil;
2569 end;
2570 if FPreviewBrowser <> nil then
2571 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2572
2573 end;
2574
2575 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2576 const ARect: TRect; var DefaultDraw: Boolean);
2577 var
2578 NodeRect: TRect;
2579 i, j: Integer;
2580 IsBoardNode: Boolean;
2581 Cnt: Integer;
2582 CntText: string;
2583 TextWidth: Integer;
2584 TextRect: TRect;
2585 Board: TBoard;
2586 Category: TCategory;
2587 Bitmap: TBitmap;
2588 NodeWidth: Integer;
2589 begin
2590 DefaultDraw := True;
2591
2592 if FTreeType = gttHistory then Exit;
2593
2594 TreeView.Canvas.Font.Color := clBlue;
2595 IsBoardNode := False;
2596
2597 for i := 0 to TreeView.Items.Count - 1 do begin
2598 Cnt := 0;
2599 if not TreeView.Items[i].IsVisible then
2600 continue;
2601
2602 if TObject(TreeView.Items[i].Data) is TCategory then begin
2603 if TreeView.Items[i].Expanded then
2604 continue;
2605
2606 IsBoardNode := False;
2607 Category := TCategory(TreeView.Items[i].Data);
2608 for j := 0 to Category.Count - 1 do begin
2609 Board := Category.Items[j];
2610 if Board <> nil then begin
2611 if Board.UnRead > 0 then begin
2612 Cnt := 1;
2613 Break;
2614 end;
2615 end;
2616 end;
2617 if Cnt <> 1 then
2618 continue;
2619 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2620 IsBoardNode := True;
2621 Board := TBoard(TreeView.Items[i].Data);
2622 Cnt := Board.UnRead;
2623 if Cnt <= 0 then
2624 continue;
2625 end else
2626 continue;
2627
2628 Bitmap := TBitmap.Create;
2629 try
2630 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2631 Bitmap.Canvas.Font.Style := [fsBold];
2632 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2633 finally
2634 Bitmap.Free;
2635 end;
2636
2637 NodeRect := TreeView.Items[i].DisplayRect(True);
2638
2639 if IsBoardNode then
2640 CntText := '(' + IntToStr(Cnt) + ')'
2641 else if Cnt = 1 then
2642 CntText := '(+)';
2643
2644
2645 TextWidth := TreeView.Canvas.TextWidth(CntText);
2646
2647 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2648 NodeRect.Top,
2649 NodeRect.Left + NodeWidth + TextWidth + 8,
2650 NodeRect.Bottom);
2651 DrawText(TreeView.Canvas.Handle,
2652 PChar(CntText),
2653 -1,
2654 TextRect,
2655 DT_SINGLELINE or DT_VCENTER);
2656 end;
2657 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2658 end;
2659
2660 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2661 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2662 var
2663 Board: TBoard;
2664 Category: TCategory;
2665 i: Integer;
2666 begin
2667 DefaultDraw := True;
2668
2669 if FTreeType = gttHistory then Exit;
2670
2671 TreeView.Canvas.Font.Style := [];
2672 if Node <> nil then begin
2673 if TObject(Node.Data) is TCategory then begin
2674 Category := TCategory(Node.Data);
2675 for i := 0 to Category.Count - 1 do begin
2676 Board := Category.Items[i];
2677 if Board <> nil then begin
2678 if Board.UnRead > 0 then begin
2679 TreeView.Canvas.Font.Style := [fsBold];
2680 Break;
2681 end;
2682 end;
2683 end;
2684 end else if TObject(Node.Data) is TBoard then begin
2685 Board := TBoard(Node.Data);
2686 if Board.UnRead > 0 then
2687 TreeView.Canvas.Font.Style := [fsBold];
2688 end;
2689 end;
2690 end;
2691
2692 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2693 begin
2694 TreeView.Invalidate;
2695
2696 if TObject(Node.Data) is TBBS2ch then begin
2697 TBBS2ch(Node.Data).NodeExpand := True;
2698 end else if TObject(Node.Data) is TCategory then begin
2699 TCategory(Node.Data).NodeExpand := True;
2700 end else if TObject(Node.Data) is TBoard then begin
2701 TBoard(Node.Data).NodeExpand := True;
2702 end;
2703 end;
2704
2705 {procedure TGikoForm.CabinetPanelVisible(PanelVisible: Boolean);
2706 begin
2707 TreeSplitter.Visible := PanelVisible;
2708 CabinetPanel.Visible := PanelVisible;
2709 CabinetToolButton.Down := PanelVisible;
2710 end;}
2711
2712 procedure TGikoForm.ListViewAllSelect;
2713 begin
2714 ListView.SetFocus;
2715 ListView.SelectAll;
2716 end;
2717
2718 procedure TGikoForm.TreeViewDblClick(Sender: TObject);
2719 var
2720 Board: TBoard;
2721 ThreadItem: TThreadItem;
2722 APoint: TPoint;
2723 HitTest: THitTests;
2724 begin
2725 GetCursorPos(APoint);
2726 APoint := TreeView.ScreenToClient(APoint);
2727 HitTest := TreeView.GetHitTestInfoAt(APoint.x, APoint.y);
2728 if not (htOnLabel in HitTest) then Exit;
2729 if TreeView.Selected = nil then Exit;
2730
2731 if FTreeType = gtt2ch then begin
2732 if not (TObject(TreeView.Selected.Data) is TBoard) then Exit;
2733 Board := TBoard(TreeView.Selected.Data);
2734 DownloadList(Board);
2735 end else if FTreeType = gttHistory then begin
2736 if not (TObject(TreeView.Selected.Data) is TThreadItem) then Exit;
2737 ThreadItem := TThreadItem(TreeView.Selected.Data);
2738 DownloadContent(ThreadItem);
2739 end;
2740 end;
2741
2742 procedure TGikoForm.FavoriteTreeViewClick(Sender: TObject);
2743 begin
2744
2745 FavoriteClick( TObject( FavoriteTreeView.Selected ) );
2746
2747 end;
2748
2749 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2750 begin
2751 AddMessageList(Msg, nil, Icon);
2752 end;
2753
2754 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2755 var
2756 ATitle: string;
2757 s: string;
2758 begin
2759 try
2760 if Item.DownType = gdtBoard then
2761 ATitle := Item.Board.Title
2762 else
2763 ATitle := Item.ThreadItem.Title;
2764 if ATitle = '' then
2765 ATitle := '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?';
2766
2767 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2768 //鐃緒申鐃緒申鐃?鐃緒申
2769 if Item.DownType = gdtBoard then begin
2770 //鐃緒申
2771 Item.SaveListFile;
2772 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2773 if GetActiveList = Item.Board then
2774 SetActiveList(Item.Board);
2775 Item.Board.Modified := True;
2776 Item.Board.IsThreadDatRead := True;
2777 PlaySound('New');
2778 end else if Item.DownType = gdtThread then begin
2779 //鐃?鐃緒申
2780 Item.SaveItemFile;
2781 Item.ThreadItem.NewArrival := True;
2782 if AddHistory(Item.ThreadItem) then begin
2783 if GetActiveContent = Item.ThreadItem then
2784 InsertBrowserTab(Item.ThreadItem)
2785 else
2786 InsertBrowserTab(Item.ThreadItem, False);
2787 end;
2788
2789 if Item.State = gdsComplete then begin
2790 PlaySound('New');
2791 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2792 end else begin
2793 PlaySound('NewDiff');
2794 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2795 end;
2796
2797 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2798 if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
2799 Item.ThreadItem.Round := False;
2800 Item.ThreadItem.RoundName := '';
2801 AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
2802 end;
2803
2804 TreeView.Refresh;
2805 end;
2806 ListView.Refresh;
2807 end else if Item.State = gdsNotModify then begin
2808 //鐃緒申鐃?鐃?鐃?
2809 { if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
2810 //SetContent(Item.ThreadItem);
2811 InsertBrowserTab(Item.ThreadItem);
2812 end;}
2813 AddMessageList(ATitle + ' [鐃緒申鐃?鐃?]', nil, gmiSAD);
2814 PlaySound('NoChange');
2815 Screen.Cursor := crDefault;
2816 end else if Item.State = gdsAbort then begin
2817 //鐃緒申鐃?
2818 AddMessageList(ATitle + ' [鐃緒申鐃?]', nil, gmiSAD);
2819 end else if Item.State = gdsError then begin
2820 //鐃?鐃緒申鐃?
2821 s := Item.ErrText;
2822 if s <> '' then
2823 s := ':' + s;
2824 AddMessageList(ATitle + ' [鐃?鐃緒申鐃?(' + IntToStr(Item.ResponseCode) + s + ')]', nil, gmiNG);
2825 // if Item.ResponseCode = 302 then
2826 // AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG);
2827 PlaySound('Error');
2828 end;
2829 finally
2830 Item.Free;
2831 Dec(FWorkCount);
2832 if FWorkCount < 0 then FWorkCount := 0;
2833 if FWorkCount = 0 then begin
2834 try
2835 Animate.Active := False;
2836 except
2837 Screen.Cursor := crDefault;
2838 end;
2839 end;
2840
2841 end;
2842 end;
2843
2844 procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer);
2845 begin
2846 // SetProgressValue(Number, 0, AWorkCountMax);
2847 // ProgressBar.Visible := True;
2848 ProgressBar.Position := 0;
2849 ProgressBar.Max := AWorkCountMax;
2850 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申';
2851 FDownloadMax := AWorkCountMax;
2852 end;
2853
2854 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
2855 begin
2856 // ProgressBar.Visible := False;
2857 ProgressBar.Position := 0;
2858 // SetProgressValue(Number, 0);
2859 if FDownloadMax <> 0 then
2860 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
2861 end;
2862
2863 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
2864 begin
2865 ProgressBar.Position := AWorkCount;
2866 // SetProgressValue(Number, AWorkCount);
2867 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
2868 end;
2869
2870 {
2871 procedure TGikoForm.SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
2872 var
2873 Component: TComponent;
2874 begin
2875 Component := FindComponent('ProgressBar' + IntToStr(Number + 1));
2876 if Component <> nil then begin
2877 if not (Component is TProgressBar) then Exit;
2878 if Max <> -1 then
2879 TProgressBar(Component).Max := Max;
2880 TProgressBar(Component).Position := Value;
2881 end;
2882 end;
2883 }
2884
2885 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
2886 var
2887 ListItem: TListItem;
2888 begin
2889 MessageListView.Items.BeginUpdate;
2890 try
2891 ListItem := MessageListView.Items.Add;
2892 ListItem.Caption := ACaption;
2893 ListItem.Data := AObject;
2894 ListItem.MakeVisible(False);
2895 case Icon of
2896 gmiOK: ListItem.ImageIndex := 0;
2897 gmiSAD: ListItem.ImageIndex := 1;
2898 gmiNG: ListItem.ImageIndex := 2;
2899 gmiWhat: ListItem.ImageIndex := 3;
2900 end;
2901 finally
2902 MessageListView.Items.EndUpdate;
2903 end;
2904 end;
2905
2906 {procedure TGikoForm.BrowserTabChange(Sender: TObject);
2907 var
2908 index: Integer;
2909 ThreadItem: TThreadItem;
2910 begin
2911 ThreadItem := GetActiveContent;
2912 if ThreadItem <> nil then begin
2913 SetContent(ThreadItem);
2914 end;
2915 end;}
2916
2917 procedure TGikoForm.InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);
2918 var
2919 i: Integer;
2920 // OldIndex: Integer;
2921 begin
2922 if ThreadItem.IsLogFile then begin
2923 for i := 0 to BrowserTab.Tabs.Count - 1 do begin
2924 if TObject(BrowserTab.Tabs.Objects[i]) is TThreadItem then begin
2925 if TThreadItem(BrowserTab.Tabs.Objects[i]) = ThreadItem then begin
2926 if ActiveTab then begin
2927 //OldIndex := BrowserTab.TabIndex;
2928 BrowserTab.TabIndex := i;
2929 // if OldIndex <> i then
2930 BrowserTab.OnChange(nil);
2931 BrowserTab.Repaint;
2932 end;
2933 Exit;
2934 end;
2935 end;
2936 end;
2937 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
2938 BrowserTab.Tabs.Insert(0, GikoSys.GetShortName(ThreadItem.Title, 20));
2939 BrowserTab.Tabs.Objects[0] := ThreadItem;
2940 if ActiveTab then
2941 BrowserTab.TabIndex := 0;
2942 end else begin
2943 i := BrowserTab.Tabs.Add(GikoSys.GetShortName(ThreadItem.Title, 20));
2944 BrowserTab.Tabs.Objects[i] := ThreadItem;
2945 if ActiveTab then
2946 BrowserTab.TabIndex := i;
2947 end;
2948 if ActiveTab then begin
2949 BrowserTab.OnChange(nil);
2950 BrowserNullTab := nil;
2951 end;
2952 end else begin
2953 //OldIndex := BrowserTab.TabIndex;
2954 BrowserNullTab := ThreadItem;
2955 BrowserTab.TabIndex := -1;