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.108 - (show annotations) (download) (as text)
Sun Nov 16 10:54:22 2003 UTC (20 years, 5 months ago) by yoffy
Branch: MAIN
Changes since 1.107: +35 -9 lines
File MIME type: text/x-pascal
・さまざまな暫定的な記述がなくなったことにより、プラグインを使用するスレッドがアドレスバーからの入力で見られなくなっていたので修正。

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, StdActns;
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 N61: TMenuItem;
510 ExportFavoriteFileAction1: TMenuItem;
511 ExportFavoriteFile: TFileSaveAs;
512 procedure FormCreate(Sender: TObject);
513 procedure FormDestroy(Sender: TObject);
514 procedure CabinetPanelHide(Sender: TObject);
515 procedure FormClose(Sender: TObject; var Action: TCloseAction);
516 procedure TreeViewChange(Sender: TObject; Node: TTreeNode);
517 procedure ListViewData(Sender: TObject; Item: TListItem);
518 procedure ListViewDataFind(Sender: TObject; Find: TItemFind;
519 const FindString: String; const FindPosition: TPoint;
520 FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection;
521 Wrap: Boolean; var Index: Integer);
522 procedure ListViewDataHint(Sender: TObject; StartIndex,
523 EndIndex: Integer);
524 procedure ListViewDataStateChange(Sender: TObject; StartIndex,
525 EndIndex: Integer; OldState, NewState: TItemStates);
526 procedure BrowserStatusTextChange(Sender: TObject;
527 const Text: WideString);
528 procedure BrowserTitleChange(Sender: TObject; const Text: WideString);
529 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
530 procedure TreeViewChanging(Sender: TObject; Node: TTreeNode;
531 var AllowChange: Boolean);
532 procedure ListViewKeyDown(Sender: TObject; var Key: Word;
533 Shift: TShiftState);
534 procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
535 procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
536 Button: TToolButton; State: TCustomDrawState;
537 var DefaultDraw: Boolean);
538 procedure BrowserBeforeNavigate2(Sender: TObject;
539 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
540 Headers: OleVariant; var Cancel: WordBool);
541 procedure ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
542 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
543 var DefaultDraw: Boolean);
544 procedure TreeViewCustomDraw(Sender: TCustomTreeView;
545 const ARect: TRect; var DefaultDraw: Boolean);
546 procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
547 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
548 procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
549 procedure TreeViewDblClick(Sender: TObject);
550 procedure FavoriteTreeViewClick(Sender: TObject);
551 procedure ListViewCustomDraw(Sender: TCustomListView;
552 const ARect: TRect; var DefaultDraw: Boolean);
553 procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
554 Shift: TShiftState; X, Y: Integer);
555 procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
556 procedure MessageListViewResize(Sender: TObject);
557 procedure ExitActionExecute(Sender: TObject);
558 procedure AllSelectActionExecute(Sender: TObject);
559 procedure StdToolBarVisibleActionExecute(Sender: TObject);
560 procedure MsgBarVisibleActionExecute(Sender: TObject);
561 procedure StatusBarVisibleActionExecute(Sender: TObject);
562 procedure LargeIconActionExecute(Sender: TObject);
563 procedure SmallIconActionExecute(Sender: TObject);
564 procedure ListIconActionExecute(Sender: TObject);
565 procedure DetailIconActionExecute(Sender: TObject);
566 procedure SearchActionExecute(Sender: TObject);
567 procedure OptionActionExecute(Sender: TObject);
568 procedure GikoNaviWebPageActionExecute(Sender: TObject);
569 procedure AboutActionExecute(Sender: TObject);
570 procedure Cabinet2chActionExecute(Sender: TObject);
571 procedure CabinetHistoryActionExecute(Sender: TObject);
572 procedure CabinetVisibleActionExecute(Sender: TObject);
573 procedure AllItemActionExecute(Sender: TObject);
574 procedure LogItemActionExecute(Sender: TObject);
575 procedure NewItemActionExecute(Sender: TObject);
576 procedure SelectItemActionExecute(Sender: TObject);
577 procedure ListNumberVisibleActionExecute(Sender: TObject);
578 procedure UpFolderActionExecute(Sender: TObject);
579 procedure IconStyleExecute(Sender: TObject);
580 procedure RoundActionExecute(Sender: TObject);
581 procedure StopActionExecute(Sender: TObject);
582 procedure MsgBarCloseActionExecute(Sender: TObject);
583 procedure BrowserMaxActionExecute(Sender: TObject);
584 procedure ScrollTopActionExecute(Sender: TObject);
585 procedure ScrollLastActionExecute(Sender: TObject);
586 procedure ScrollNewActionExecute(Sender: TObject);
587 procedure ScrollKokoActionExecute(Sender: TObject);
588 procedure EditorActionExecute(Sender: TObject);
589 procedure IEActionExecute(Sender: TObject);
590 procedure ShowThreadActionExecute(Sender: TObject);
591 procedure ShowBoardActionExecute(Sender: TObject);
592 procedure URLCopyActionExecute(Sender: TObject);
593 procedure ItemReloadActionExecute(Sender: TObject);
594 procedure SelectListReloadActionExecute(Sender: TObject);
595 procedure SelectThreadReloadActionExecute(Sender: TObject);
596 procedure SelectListReloadActionUpdate(Sender: TObject);
597 procedure AllItemActionUpdate(Sender: TObject);
598 procedure LogItemActionUpdate(Sender: TObject);
599 procedure NewItemActionUpdate(Sender: TObject);
600 procedure SelectItemActionUpdate(Sender: TObject);
601 procedure UpFolderActionUpdate(Sender: TObject);
602 procedure FormResize(Sender: TObject);
603 procedure ScrollTopActionUpdate(Sender: TObject);
604 procedure ScrollLastActionUpdate(Sender: TObject);
605 procedure ScrollNewActionUpdate(Sender: TObject);
606 procedure ScrollKokoActionUpdate(Sender: TObject);
607 procedure EditorActionUpdate(Sender: TObject);
608 procedure IEActionUpdate(Sender: TObject);
609 procedure ShowThreadActionUpdate(Sender: TObject);
610 procedure ShowBoardActionUpdate(Sender: TObject);
611 procedure SelectThreadReloadActionUpdate(Sender: TObject);
612 procedure ListViewSelectItem(Sender: TObject; Item: TListItem;
613 Selected: Boolean);
614 procedure SelectTimerTimer(Sender: TObject);
615 procedure ItemReloadActionUpdate(Sender: TObject);
616 procedure ListViewDblClick(Sender: TObject);
617 procedure LogDeleteActionExecute(Sender: TObject);
618 procedure KokomadeActionExecute(Sender: TObject);
619 procedure ZenbuActionExecute(Sender: TObject);
620 procedure KokoResActionExecute(Sender: TObject);
621 procedure ListPopupMenuPopup(Sender: TObject);
622 procedure SelectItemURLCopyActionExecute(Sender: TObject);
623 procedure SelectItemURLCopyActionUpdate(Sender: TObject);
624 procedure AllSelectActionUpdate(Sender: TObject);
625 procedure LogDeleteActionUpdate(Sender: TObject);
626 procedure BrowserTabCloseActionExecute(Sender: TObject);
627 procedure NotSelectTabCloseActionExecute(Sender: TObject);
628 procedure TreeSelectBoradReloadExecute(Sender: TObject);
629 procedure TreeSelectThreadReloadExecute(Sender: TObject);
630 procedure TreeSelectURLCopyExecute(Sender: TObject);
631 procedure TreePopupMenuPopup(Sender: TObject);
632 procedure ListToolBarVisibleActionExecute(Sender: TObject);
633 procedure BrowserToolBarVisibleActionExecute(Sender: TObject);
634 procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
635 var Cancel: WordBool);
636 procedure ListSplitterCanResize(Sender: TObject; var NewSize: Integer;
637 var Accept: Boolean);
638 procedure ListSplitterMoved(Sender: TObject);
639 procedure BrowserTabChange(Sender: TObject);
640 procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
641 Shift: TShiftState; X, Y: Integer);
642 procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer;
643 State: TDragState; var Accept: Boolean);
644 procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer);
645 procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X,
646 Y: Integer);
647 procedure BrowserDocumentComplete(Sender: TObject;
648 const pDisp: IDispatch; var URL: OleVariant);
649 procedure SelectReservActionUpdate(Sender: TObject);
650 procedure RoundNamePopupMenuPopup(Sender: TObject);
651 procedure SelectNewRoundNameExecute(Sender: TObject);
652 procedure SelectDeleteRoundExecute(Sender: TObject);
653 procedure SelectReservActionExecute(Sender: TObject);
654 procedure NewBoardActionExecute(Sender: TObject);
655 procedure LoginActionExecute(Sender: TObject);
656 procedure KeySettingActionExecute(Sender: TObject);
657 procedure AllTabCloseActionExecute(Sender: TObject);
658 procedure ArrangeActionExecute(Sender: TObject);
659 procedure NameURLCopyActionExecute(Sender: TObject);
660 procedure SelectItemNameURLCopyActionExecute(Sender: TObject);
661 procedure URLCopyActionUpdate(Sender: TObject);
662 procedure NameURLCopyActionUpdate(Sender: TObject);
663 procedure BrowserTabCloseActionUpdate(Sender: TObject);
664 procedure NotSelectTabCloseActionUpdate(Sender: TObject);
665 procedure AllTabCloseActionUpdate(Sender: TObject);
666 procedure SelectItemNameURLCopyActionUpdate(Sender: TObject);
667 procedure ActiveLogDeleteActionExecute(Sender: TObject);
668 procedure ActiveLogDeleteActionUpdate(Sender: TObject);
669 procedure ListNameBarVisibleActionExecute(Sender: TObject);
670 procedure BrowserNameBarVisibleActionExecute(Sender: TObject);
671 procedure TreeSelectNameURLCopyExecute(Sender: TObject);
672 procedure PaneInitActionExecute(Sender: TObject);
673 procedure FormShow(Sender: TObject);
674 procedure BrowserTabToolBarResize(Sender: TObject);
675 procedure BrowserMinActionExecute(Sender: TObject);
676 procedure SelectTextClearActionExecute(Sender: TObject);
677 procedure NameTextClearActionExecute(Sender: TObject);
678 procedure MailTextClearActionExecute(Sender: TObject);
679 procedure LeftmostTabSelectActionExecute(Sender: TObject);
680 procedure LeftTabSelectActionExecute(Sender: TObject);
681 procedure RightTabSelectActionExecute(Sender: TObject);
682 procedure RightmostTabSelectActionExecute(Sender: TObject);
683 procedure LeftmostTabSelectActionUpdate(Sender: TObject);
684 procedure LeftTabSelectActionUpdate(Sender: TObject);
685 procedure RightTabSelectActionUpdate(Sender: TObject);
686 procedure RightmostTabSelectActionUpdate(Sender: TObject);
687 procedure FavoriteMenuClick(Sender: TObject);
688 procedure FavoriteAddActionExecute(Sender: TObject);
689 procedure FavoriteAddActionUpdate(Sender: TObject);
690 procedure BoardFavoriteAddActionExecute(Sender: TObject);
691 procedure BoardFavoriteAddActionUpdate(Sender: TObject);
692 procedure ThreadFavoriteAddActionExecute(Sender: TObject);
693 procedure ThreadFavoriteAddActionUpdate(Sender: TObject);
694 procedure TreeSelectFavoriteAddActionExecute(Sender: TObject);
695 procedure FavoriteArrangeActionExecute(Sender: TObject);
696 procedure MainCoolBarResize(Sender: TObject);
697 procedure MoveToActionExecute(Sender: TObject);
698 procedure AddressToolBarResize(Sender: TObject);
699 procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
700 Shift: TShiftState);
701 procedure AddressBarVisibleActionExecute(Sender: TObject);
702 procedure BrowserEnter(Sender: TObject);
703 procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
704 procedure BrowserTabVisibleActionExecute(Sender: TObject);
705 procedure BrowserTabTopActionExecute(Sender: TObject);
706 procedure BrowserTabBottomActionExecute(Sender: TObject);
707 procedure BrowserTabTabStyleActionExecute(Sender: TObject);
708 procedure BrowserTabButtonStyleActionExecute(Sender: TObject);
709 procedure BrowserTabFlatStyleActionExecute(Sender: TObject);
710 procedure PreviewTimerTimer(Sender: TObject);
711 procedure MessageHideButtonClick(Sender: TObject);
712 procedure MonazillaWebPageActionExecute(Sender: TObject);
713 procedure GikoHelpActionExecute(Sender: TObject);
714 procedure ToolButton18Click(Sender: TObject);
715 procedure KotehanActionExecute(Sender: TObject);
716 procedure LinkBarVisibleActionExecute(Sender: TObject);
717 procedure BBS2chWebPageActionExecute(Sender: TObject);
718 procedure GikoFolderOpenActionExecute(Sender: TObject);
719 procedure MainCoolBarBandInfo(Sender: TObject;
720 var BandInfo: PReBarBandInfoA);
721 procedure MainCoolBarChevronClick(Sender: TObject;
722 RebarChevron: PNMRebarChevron);
723 procedure ListCoolBarBandInfo(Sender: TObject;
724 var BandInfo: PReBarBandInfoA);
725 procedure ListCoolBarChevronClick(Sender: TObject;
726 RebarChevron: PNMRebarChevron);
727 procedure BrowserCoolBarBandInfo(Sender: TObject;
728 var BandInfo: PReBarBandInfoA);
729 procedure BrowserCoolBarChevronClick(Sender: TObject;
730 RebarChevron: PNMRebarChevron);
731 procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
732 procedure ThreadEditorActionExecute(Sender: TObject);
733 procedure ThreadEditorActionUpdate(Sender: TObject);
734 procedure ToolBarSettingActionExecute(Sender: TObject);
735 procedure NameCopyActionExecute(Sender: TObject);
736 procedure BoardIEActionExecute(Sender: TObject);
737 procedure SelectItemNameCopyActionExecute(Sender: TObject);
738 procedure SelectItemNameCopyActionUpdate(Sender: TObject);
739 procedure BoardIEActionUpdate(Sender: TObject);
740 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
741 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
742 procedure NameCopyActionUpdate(Sender: TObject);
743 procedure SelectComboBoxChange(Sender: TObject);
744 procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
745 Shift: TShiftState);
746 procedure SelectComboBoxExit(Sender: TObject);
747 procedure NG1Click(Sender: TObject);
748 procedure SelectResActionExecute(Sender: TObject);
749 procedure SelectResActionUpdate(Sender: TObject);
750 procedure FormKeyDown(Sender: TObject; var Key: Word;
751 Shift: TShiftState);
752 procedure FormKeyUp(Sender: TObject; var Key: Word;
753 Shift: TShiftState);
754 procedure AllResActionExecute(Sender: TObject);
755 procedure AllResActionUpdate(Sender: TObject);
756 procedure ReloadClick(Sender: TObject);
757 procedure GoBackClick(Sender: TObject);
758 procedure GoFowardClick(Sender: TObject);
759 procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
760 Shift: TShiftState; X, Y: Integer);
761 procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
762 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
763 procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
764 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
765 procedure StatusBarResize(Sender: TObject);
766 procedure IndividualAbon1Click(Sender: TObject);
767 procedure IndividualAbon2Click(Sender: TObject);
768 procedure N42Click(Sender: TObject);
769 procedure SelectComboBoxEnter(Sender: TObject);
770 procedure AntiIndividualAbonClick(Sender: TObject);
771 procedure N51Click(Sender: TObject);
772 procedure TreeSelectSearchBoardNameExecute(Sender: TObject);
773 procedure CabinetFavoriteActionExecute(Sender: TObject);
774 procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
775 Y: Integer);
776 procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
777 procedure FavoriteTreeViewEdited(Sender: TObject; Node: TTreeNode;
778 var S: String);
779 procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
780 Shift: TShiftState);
781 procedure FavoriteTreePopupMenuPopup(Sender: TObject);
782 procedure FavoriteTreeViewDeleteActionExecute(Sender: TObject);
783 procedure FavoriteTreeViewRenameActionExecute(Sender: TObject);
784 procedure FavoriteTreeViewNewFolderActionExecute(Sender: TObject);
785 procedure ToolButton19Click(Sender: TObject);
786 procedure FavoriteTreeViewBrowseFolderActionExecute(Sender: TObject);
787 procedure FavoriteTreeViewChange(Sender: TObject; Node: TTreeNode);
788 procedure FavoriteTreeViewDblClick(Sender: TObject);
789 procedure FavoriteTreeViewLogDeleteActionExecute(Sender: TObject);
790 procedure FavoriteTreeViewReloadActionExecute(Sender: TObject);
791 procedure FavoriteTreeViewURLCopyActionExecute(Sender: TObject);
792 procedure FavoriteTreeViewNameCopyActionExecute(Sender: TObject);
793 procedure FavoriteTreeViewNameURLCopyActionExecute(Sender: TObject);
794 procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer);
795 procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton;
796 Shift: TShiftState; X, Y: Integer);
797 procedure LinkToolBarDragOver(Sender, Source: TObject; X, Y: Integer;
798 State: TDragState; var Accept: Boolean);
799 procedure OnlyAHundredResExecute(Sender: TObject);
800 procedure FavoriteTreeViewEndDrag(Sender, Target: TObject; X,
801 Y: Integer);
802 procedure ListCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
803 var Handled: Boolean);
804 procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
805 var Handled: Boolean);
806 procedure BrowserCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
807 var Handled: Boolean);
808 procedure ExportFavoriteFileAccept(Sender: TObject);
809 procedure ExportFavoriteFileBeforeExecute(Sender: TObject);
810 private
811 { Private 鐃緒申鐃緒申 }
812
813 FSortIndex: Integer;
814 FSortOrder: Boolean;
815
816 FEnabledCloseButton: Boolean;
817 // ThreadCreate: TThreadCreate;
818
819 FClickNode: TTreeNode;
820 FHttpState: Boolean;
821 FHint: TResPopup;
822 FPreviewBrowser: TPreviewBrowser;
823 FPreviewURL: string;
824
825 FBrowserSizeHeight: Integer;
826 FBrowserSizeWidth: Integer;
827
828 // FFavorite: TFavorite;
829 FBrowserComplete: Boolean;
830 FTabHintIndex: Integer;
831 FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
832 FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?
833 FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?
834 FActiveList: TObject;
835 FActiveContent: TThreadItem; //
836 FHistoryList: TList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
837 FTreeType: TGikoTreeType;
838 FWorkCount: Integer;
839 FNameCookie: string;
840 FMailCookie: string;
841 // FLastRoundTime: TDateTime;
842 BrowserNullTab: TThreadItem;
843 // DoubleClickOccurred: array [TMouseButton] of Boolean;
844 FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
845 FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?
846 FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?
847
848 Fkeynum : Integer; //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
849
850 IsDraggingSelectComboBox : Boolean;
851 DraggingSelectComboBoxPosition : TPoint;
852
853 FSearchDialog: TSearchDialog;
854
855 FDropSpaceNode: TTreeNode;
856
857 FDragTime : Cardinal; //鐃緒申鐃緒申鐃?鐃緒申D&D鐃?
858 FDragButton : TToolButton; //鐃緒申鐃緒申鐃?鐃緒申D&D鐃?鐃緒申Drag鐃緒申鐃緒申鐃緒申Button鐃緒申鐃緒申
859 FDragWFirst : Boolean; //WebTab鐃緒申D&D鐃?
860
861 procedure SetBoardTreeNode;
862 function SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
863 function SetBoardListItem(Category: TCategory): Integer;
864 function SetThreadListItem(Board: TBoard): Integer;
865 // function GetRoundName(index: integer): string;
866
867 procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
868 procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
869 procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer);
870 procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
871 procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
872
873 procedure SetActiveList(Obj: TObject);
874 procedure ListClick;
875 procedure ListDoubleClick;
876 procedure BrowserMovement(AName: string);
877 procedure SelectListItem(List: TList);
878 // procedure SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
879 procedure DeleteTab(ThreadItem: TThreadItem);
880 function Hook(var Message: TMessage): Boolean;
881 procedure AddRoundNameMenu(MenuItem: TMenuItem);
882 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string);
883 procedure SetSelectRoundName(Sender: TObject);
884 function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
885
886 procedure SetMenuFont;
887 // procedure CreateFavMenu(Folder: TFavoriteFolder);
888 procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
889 procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;
890 procedure FavoriteClick(Sender: TObject); overload;
891 procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
892 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
893 function OnDocumentContextMenu(Sender: TObject): WordBool;
894 // function GetThreadText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean): string;
895 procedure SetResPopupText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean);
896 procedure ShowTextPopup;
897 //procedure ShowTextPopup(HintData: THintData);
898 // procedure SetStdToolBar;
899 // function GetAction(ActionName: string): TContainedAction;
900 procedure SetLinkBar;
901 function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
902 procedure MenuBarChevronMenu;
903 procedure LinkBarChevronMenu;
904 procedure ToolBarChevronMenu(ToolBar: TToolBar);
905 procedure ModifySelectList;
906 procedure FavoriteBrowseFolder( node: TTreeNode );
907 procedure LinkToolButtonDragDrop(Sender, Source: TObject; X, Y: Integer);
908 procedure LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
909 procedure LinkToolButtonOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
910 procedure LinkToolButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
911 procedure LinkToolButtonStartDrag(Sender: TObject; var DragObject: TDragObject);
912 function TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode;
913 procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );
914 procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject );
915 procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject );
916 //
917 procedure BrowserTabClick(Sender: TObject);
918 protected
919 procedure CreateParams(var Params: TCreateParams); override;
920 procedure WndProc(var Message: TMessage); override;
921 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
922 procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
923 procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
924 public
925 { Public 鐃緒申鐃緒申 }
926 // FDownload: TDownload;
927 FControlThread: TThreadControl;
928 procedure MoveToURL(URL: string);
929 procedure InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);
930 procedure ReloadBBS;
931 function GetHttpState: Boolean;
932 procedure SetEnabledCloseButton(Enabled: Boolean);
933 function GetTreeNode(Data: TObject): TTreeNode;
934 procedure AppFormDeactivate(Sender: TObject);
935 // procedure CabinetPanelVisible(PanelVisible: Boolean);
936 procedure ListViewAllSelect;
937
938 property ListStyle: TViewStyle read FListStyle write FListStyle;
939 property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
940 property ViewType: TGikoViewType read FViewType write FViewType;
941
942 property NameCookie: string read FNameCookie write FNameCookie;
943 property MailCookie: string read FMailCookie write FMailCookie;
944
945 procedure SetContent(ThreadItem: TThreadItem);
946 function GetActiveContent: TThreadItem;
947 function GetActiveList: TObject;
948
949 property ActiveList: TObject read GetActiveList write SetActiveList;
950 // property LastRoundTime: TDateTime read FLastRoundTime write FLastRoundTime;
951
952 procedure SetListViewType(AViewType: TGikoViewType); overload;
953 procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
954 procedure DownloadContent(ThreadItem: TThreadItem);
955 procedure DownloadList(Board: TBoard);
956 procedure PlaySound(SoundEventName: string);
957
958 function AddHistory(ThreadItem: TThreadItem): Boolean;
959 procedure DeleteHistory(ThreadItem: TThreadItem);
960 procedure ClearHistory;
961 procedure Show2chTree;
962 procedure ShowHistoryTree;
963 procedure SetHistoryTreeNode;
964 // procedure SelectTreeNode(Item: TObject);
965 procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
966 procedure SetBrowserTabState;
967 // property Favorite: TFavorite read FFavorite write FFavorite;
968 procedure SetToolBarPopup;
969 procedure ShowFavoriteAddDialog( Item : TObject );
970 published
971 property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
972 end;
973
974 TFavoriteMenuItem = class(TMenuItem)
975 private
976 FData : Pointer;
977 public
978 property Data: Pointer read FData write FData;
979 end;
980
981 TLinkToolButton = class(TToolButton)
982 private
983 FData : Pointer;
984 public
985 property Data: Pointer read FData write FData;
986 end;
987
988 var
989 GikoForm: TGikoForm;
990
991 implementation
992
993 uses
994 About, Option, Round, Splash, Sort, ListSelect,
995 NewBoard;
996
997 const
998 CAPTION_NAME: string = '鐃?鐃?鐃?鐃?';
999 BLANK_HTML: string = 'about:blank';
1000 SELECTCOMBOBOX_NAME: string = ''; // '鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申';
1001 SELECTCOMBOBOX_COLOR: TColor = clWindow;
1002 //D&D鐃緒申鐃?
1003 DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel)
1004 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1005 ITEM_ICON_2CH1 = 0; //2ch鐃?鐃?鐃?鐃緒申
1006 ITEM_ICON_2CH2 = 1; //2ch鐃?鐃?鐃?鐃緒申
1007 ITEM_ICON_CATEGORY1 = 2; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1008 ITEM_ICON_CATEGORY2 = 3; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1009 ITEM_ICON_BOARD1 = 4; //鐃緒申鐃?鐃?鐃?鐃緒申
1010 ITEM_ICON_BOARD2 = 5; //鐃緒申鐃?鐃?鐃?鐃緒申
1011 ITEM_ICON_THREADLOG1 = 6; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1012 ITEM_ICON_THREADLOG2 = 7; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1013 ITEM_ICON_THREAD1 = 8; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1014 ITEM_ICON_THREAD2 = 9; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1015 ITEM_ICON_THREADNEW1 = 10; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1016 ITEM_ICON_THREADNEW2 = 11; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1017 ITEM_ICON_SORT1 = 12; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
1018 ITEM_ICON_SORT2 = 13; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
1019
1020 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1021 TOOL_ICON_HEIGHT_MAX = 16; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1022 TOOL_ICON_HEIGHT_MIN = 17; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1023 TOOL_ICON_HEIGHT_NORMAL = 18; //鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1024 TOOL_ICON_WIDTH_MAX = 19; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1025 TOOL_ICON_WIDTH_MIN = 20; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1026 TOOL_ICON_WIDTH_NORMAL = 21; //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1027
1028 TOOL_ICON_FAV_FOLDER = 30; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申
1029 TOOL_ICON_FAV_BOARD = 31; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1030 TOOL_ICON_FAV_THREAD = 32; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1031
1032 HTML_FILE_NAME = 'temp_preview.html';
1033
1034 {$R *.DFM}
1035
1036 procedure TGikoForm.CreateParams(var Params: TCreateParams);
1037 begin
1038 inherited;
1039 if FormStyle in [fsNormal, fsStayOnTop] then begin
1040 if BorderStyle in [bsSingle, bsSizeable] then begin
1041 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
1042 Params.WndParent := 0;
1043 end;
1044 end;
1045 end;
1046
1047 procedure TGikoForm.FormCreate(Sender: TObject);
1048 const
1049 TVS_NOTOOLTIPS = $0080;
1050 var
1051 FileName: string;
1052 Style: DWORD;
1053 msg: string;
1054 i: Integer;
1055 wp: TWindowPlacement;
1056 s: string;
1057 begin
1058 {$IFDEF DEBUG}
1059 AllocConsole;
1060 Writeln('============================================================');
1061 Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
1062 Writeln('');
1063 Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
1064 Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
1065 Writeln('============================================================');
1066 {$ENDIF}
1067 Application.OnDeactivate := AppFormDeactivate;
1068 Self.OnDeactivate := AppFormDeactivate;
1069 Application.HookMainWindow(Hook);
1070
1071 FTreeType := gttNone;
1072
1073 FSearchDialog := nil;
1074
1075 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1076 Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
1077
1078 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1079 RoundList := TRoundList.Create;
1080 RoundList.LoadRoundFile;
1081
1082 //BBS鐃緒申鐃緒申
1083 BBS2ch := TBBS2ch.Create(GikoSys.Setting.LogFolder);
1084
1085 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1086 // FFavorite := TFavorite.Create(FavoriteTreeView);
1087 FavoriteDM.SetFavTreeView(FavoriteTreeView);
1088 FavoriteDM.ReadFavorite;
1089
1090 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1091 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1092
1093 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1094 InitializeBoardPlugIns;
1095
1096 EnabledCloseButton := True;
1097 BoardGroup.BBS2ch.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1098 // SetBoardTreeNode; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1099
1100 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1101 ListView.ViewStyle := GikoSys.Setting.ListStyle;
1102
1103 //鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1104 // MainCoolBar.Top := 0;
1105 // MainCoolBar.Left := 0;
1106
1107 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
1108 AnimePanel.Top := 0;
1109 AnimePanel.Left := 0;
1110
1111 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1112
1113 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1114 CabinetVisibleAction.Checked := not GikoSys.Setting.CabinetVisible;
1115 CabinetVisibleAction.Execute;
1116 CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
1117
1118 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1119 MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
1120 MsgBarVisibleActionExecute(nil);
1121 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
1122
1123 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1124 StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
1125 StatusBarVisibleActionExecute(nil);
1126
1127 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1128 TreeView.Items.BeginUpdate;
1129 FavoriteTreeView.Items.BeginUpdate;
1130 ListView.Items.BeginUpdate;
1131 try
1132 TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1133 TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1134 TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1135 TreeView.Color := GikoSys.Setting.CabinetBackColor;
1136
1137 FavoriteTreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1138 FavoriteTreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1139 FavoriteTreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1140 FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
1141
1142 ListView.Font.Name := GikoSys.Setting.ListFontName;
1143 ListView.Font.Size := GikoSys.Setting.ListFontSize;
1144 ListView.Font.Color := GikoSys.Setting.ListFontColor;
1145 ListView.Color := GikoSys.Setting.ListBackColor;
1146 finally
1147 TreeView.Items.EndUpdate;
1148 FavoriteTreeView.Items.EndUpdate;
1149 ListView.Items.EndUpdate;
1150 end;
1151 //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
1152 ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
1153
1154 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1155 BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1156 BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1157 FDragWFirst := false;
1158
1159 // TreeView.TopItem.Expanded := True; //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1160 // TreeView.Selected := TreeView.Items[0]; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1161 SetContent(nil); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1162
1163 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1164 wp.length := sizeof(wp);
1165 wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1166 wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1167 wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1168 wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1169 wp.showCmd := SW_HIDE;
1170 SetWindowPlacement(Handle, @wp);
1171
1172 // SetBounds(GikoSys.Setting.WindowLeft, GikoSys.Setting.WindowTop,
1173 // GikoSys.Setting.WindowWidth, GikoSys.Setting.WindowHeight);
1174 if GikoSys.Setting.WindowMax then
1175 WindowState := wsMaximized;
1176
1177 //鐃?鐃?鐃?鐃?鐃緒申
1178 try
1179 FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1180 if FileExists(FileName) then
1181 Animate.FileName := FileName;
1182 except
1183 end;
1184 // AnimePanel.Height := 26;
1185 // AnimePanel.Width := 39;
1186 // AnimePanel.Top := 2;
1187 // AnimePanel.Left := Width - 48;
1188
1189 //鐃?鐃?鐃?鐃?
1190 FNameCookie := '';
1191 FMailCookie := '';
1192
1193 //鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1194 AllItemAction.Checked := True;
1195 AllResAction.Checked := True;
1196
1197 //TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申
1198 Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
1199 Style := Style or TVS_NOTOOLTIPS;
1200 SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
1201
1202 // 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1203 TreeView.Align := alClient;
1204 FavoriteTreeView.Align := alClient;
1205 FavoriteTreeView.Visible := False;
1206
1207 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1208 // FBrowserSizeFlag := False;
1209 // FBrowserSizeHeight := ViewPanel.Height;
1210
1211 FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1212 FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1213
1214 ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1215 ArrangeAction.Execute;
1216
1217 if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1218 case GikoSys.Setting.ListWidthState of
1219 glsMax: begin
1220 ViewPanel.Width := 1;
1221 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1222 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1223 end;
1224 glsMin: begin
1225 ViewPanel.Width := GikoSys.Setting.ListWidth;
1226 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1227 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1228 end;
1229 else begin
1230 ViewPanel.Width := GikoSys.Setting.ListWidth;
1231 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1232 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1233 end;
1234 end;
1235 // if GikoSys.Setting.ListWidthMax then begin
1236 // ViewPanel.Width := 1;
1237 // BrowserSizeAction.ImageIndex := ICON_WIDTH_MIN;
1238 // end else begin
1239 // ViewPanel.Width := GikoSys.Setting.ListWidth;
1240 // BrowserSizeAction.ImageIndex := ICON_WIDTH_MAX;
1241 // end;
1242 end else begin
1243 case GikoSys.Setting.ListHeightState of
1244 glsMax: begin
1245 ViewPanel.Height := 1;
1246 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1247 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1248 end;
1249 glsMin: begin
1250 ViewPanel.Height := GikoSys.Setting.ListHeight;
1251 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1252 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1253 end;
1254 else begin
1255 ViewPanel.Height := GikoSys.Setting.ListHeight;
1256 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1257 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1258 end;
1259 end;
1260 // if GikoSys.Setting.ListHeightState = glsMax then begin
1261 // end else begin
1262 // ViewPanel.Height := GikoSys.Setting.ListHeight;
1263 // BrowserSizeAction.ImageIndex := ICON_HEIGHT_MAX;
1264 // end;
1265 end;
1266
1267 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1268 // ProgressBar.Visible := False;
1269 ProgressBar.Parent := StatusBar;
1270 ProgressBar.Top := 2;
1271 ProgressBar.Left := 0;
1272 ProgressBar.Width := StatusBar.Panels[0].Width;
1273 ProgressBar.Height := StatusBar.Height - 2;
1274 ProgressBar.Position := 0;
1275
1276 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1277 //formshow()鐃緒申鐃緒申鐃緒申
1278
1279 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1280 // FDownload := TDownload.Create;
1281 // FDownload.OnDownloadEnd := OnDonloadEnd;
1282 // FDownload.OnWork := Work;
1283 // FDownload.OnWorkBegin := WorkBegin;
1284 // FDownload.OnWorkEnd := WorkEnd;
1285
1286 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1287 FControlThread := TThreadControl.Create(True);
1288 FControlThread.MaxThreadCount := 1;
1289 FControlThread.Resume;
1290 FControlThread.OnDownloadEnd := DownloadEnd;
1291 FControlThread.OnDownloadMsg := DownloadMsg;
1292 FControlThread.OnWork := Work;
1293 FControlThread.OnWorkBegin := WorkBegin;
1294 FControlThread.OnWorkEnd := WorkEnd;
1295 // ProgressPanel.Width := FControlThread.MaxThreadCount * 12;
1296
1297 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1298 FHistoryList := TList.Create;
1299
1300 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1301 SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1302
1303 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1304 SetBrowserTabState;
1305
1306 BrowserBoardNameLabel.Caption := '';
1307 BrowserNameLabel.Caption := '';
1308 FWorkCount := 0;
1309
1310 // DetailIconAction.Execute;
1311
1312 // FBrowserSizeHeight := ViewPanel.Height;
1313 FTabHintIndex := -1;
1314
1315 //鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1316 // if not GikoSys.DirectoryExistsEx(BBS2ch.GetLogFolder) then begin
1317 // GikoSys.ForceDirectoriesEx(BBS2ch.GetLogFolder);
1318 // end;
1319 // FormResize(Sender);
1320 // MainCoolBarResize(Sender);
1321 // Application.ProcessMessages;
1322
1323 //鐃緒申鐃緒申鐃?鐃?鐃?
1324 SetLinkBar;
1325
1326 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
1327 SetMenuFont;
1328
1329 //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1330 ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1331 BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1332
1333 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1334 ReadToolBarSetting(ActionList, StdToolBar);
1335 ReadToolBarSetting(ActionList, ListToolBar);
1336 try
1337 for i := ListToolBar.ControlCount - 1 downto 0 do
1338 begin
1339 if ListToolBar.Controls[ i ].Action = SelectItemAction then
1340 begin
1341 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1342 if (i + 1) < ListToolBar.ControlCount then
1343 if ListToolBar.Controls[ i + 1 ] is TToolButton then
1344 if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
1345 ListToolBar.Controls[ i + 1 ].Visible := False;
1346
1347 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申
1348 ListToolBar.Controls[ i ].Visible := False;
1349 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申
1350 SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
1351 SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
1352 SelectComboBox.Parent := ListToolBar;
1353 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1354 SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
1355 SelectComboBoxSplitter.Parent := ListToolBar;
1356
1357 break;
1358 end;
1359 end;
1360 except
1361 end;
1362 ReadToolBarSetting(ActionList, BrowserToolBar);
1363 SetToolBarPopup;
1364 OnlyAHundredRes.Checked := GikoSys.Setting.OnlyAHundredRes;
1365 //鐃?鐃?鐃緒申鐃?鐃?鐃?
1366 AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1367
1368 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1369
1370 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1371 if not FileExists(GikoSys.GetBoardFileName) then begin
1372 msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1373 + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1374 + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1375 MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1376 NewBoardAction.Execute;
1377 end;
1378
1379 //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1380 GikoSys.LoadKeySetting(ActionList);
1381
1382 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1383 // FLastRoundTime := 0;
1384
1385 //ResHint
1386 FHint := TResPopup.Create(Self);
1387
1388 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申鐃緒申)
1389 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?)
1390 i := GikoSys.Setting.CabinetIndex;
1391 Cabinet2chAction.Execute;
1392 GikoSys.Setting.CabinetIndex := i;
1393
1394 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1395 Case GikoSys.Setting.CabinetIndex of
1396 0: Cabinet2chAction.Execute;
1397 1: CabinetHistoryAction.Execute;
1398 2: CabinetFavoriteAction.Execute;
1399 end;
1400
1401 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1402 if GikoSys.Setting.AutoLogin then
1403 LoginAction.Execute;
1404
1405 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1406 for i := 1 to ParamCount do begin
1407 MoveToURL(ParamStr(i));
1408 end;
1409 // SetStdToolBar;
1410 // SetLinkBar;
1411
1412 s := GikoSys.FAbon.NGwordname;
1413 StatusBar.Panels[2].Text := s;
1414 StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
1415 StatusBarResize(Sender);
1416 end;
1417
1418 //
1419 //
1420 //
1421 procedure TGikoForm.FormShow(Sender: TObject);
1422 var
1423 i: Integer;
1424 CoolSet: TCoolSet;
1425 begin
1426 ShowWindow(Application.Handle, SW_HIDE);
1427
1428 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1429 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1430 StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1431 StdToolBarVisibleActionExecute( nil );
1432 AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1433 AddressBarVisibleActionExecute( nil );
1434 LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1435 LinkBarVisibleActionExecute( nil );
1436 ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1437 ListToolBarVisibleActionExecute( nil );
1438 ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1439 ListNameBarVisibleActionExecute( nil );
1440 BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1441 BrowserToolBarVisibleActionExecute( nil );
1442 BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1443 BrowserNameBarVisibleActionExecute( nil );
1444
1445 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1446 BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1447 BrowserTabVisibleActionExecute(nil);
1448
1449 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1450 BrowserTabTopAction.Checked := True;
1451 BrowserTabTopActionExecute(nil);
1452 end else begin
1453 BrowserTabBottomAction.Checked := True;
1454 BrowserTabBottomActionExecute(nil);
1455 end;
1456
1457 if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1458 BrowserTabTabStyleAction.Checked := True;
1459 BrowserTabTabStyleActionExecute(nil);
1460 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1461 BrowserTabButtonStyleAction.Checked := True;
1462 BrowserTabButtonStyleActionExecute(nil);
1463 end else begin
1464 BrowserTabFlatStyleAction.Checked := True;
1465 BrowserTabFlatStyleActionExecute(nil);
1466 end;
1467
1468
1469 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1470 MainCoolBar.Bands.BeginUpdate;
1471 try
1472 for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1473 CoolSet := GikoSys.Setting.MainCoolSet[i];
1474 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1475 Continue;
1476 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1477 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1478 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1479 end;
1480 finally
1481 MainCoolBar.Bands.EndUpdate;
1482 end;
1483
1484 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1485 ListCoolBar.Bands.BeginUpdate;
1486 try
1487 for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1488 CoolSet := GikoSys.Setting.ListCoolSet[i];
1489 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1490 Continue;
1491 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1492 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1493 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1494 end;
1495 finally
1496 ListCoolBar.Bands.EndUpdate;
1497 end;
1498
1499 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1500 BrowserCoolBar.Bands.BeginUpdate;
1501 try
1502 for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1503 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1504 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1505 Continue;
1506 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1507 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1508 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1509 end;
1510 finally
1511 BrowserCoolBar.Bands.EndUpdate;
1512 end;
1513
1514 end;
1515 {
1516 procedure TGikoForm.SetStdToolBar;
1517 var
1518 i: Integer;
1519 FileName: string;
1520 ini: TMemIniFile;
1521 s: string;
1522 Action: TContainedAction;
1523 ToolButton: TToolButton;
1524 begin
1525 exit;
1526 for i := StdToolBar.ButtonCount - 1 downto 0 do begin
1527 StdToolBar.RemoveControl(StdToolBar.Buttons[i]);
1528 //StdToolBar.Buttons[i].Free;
1529 end;
1530 FileName := GikoSys.GetConfigDir + 'ToolBar.ini';
1531 ini := TMemIniFile.Create(FileName);
1532 i := 0;
1533 while true do begin
1534 s := ini.ReadString('StdToolBar', IntToStr(i), '');
1535 if s = '' then
1536 Break;
1537 if s = '-' then begin
1538 ToolButton := TToolButton.Create(StdToolBar);
1539 ToolButton.Style := tbsSeparator;
1540 ToolButton.Width := 8;
1541 ToolButton.Left := 10000;
1542 StdToolBar.InsertControl(ToolButton);
1543 end else begin
1544 Action := GetAction(s);
1545 if Action <> nil then begin
1546 ToolButton := TToolButton.Create(StdToolBar);
1547 ToolButton.Action := Action;
1548 ToolButton.Left := 10000;
1549 StdToolBar.InsertControl(ToolButton);
1550 end;
1551 end;
1552 Inc(i);
1553 end;
1554 end;
1555 }
1556 {function TGikoForm.GetAction(ActionName: string): TContainedAction;
1557 var
1558 i: Integer;
1559 begin
1560 for i := 0 to ActionList.ActionCount - 1 do begin
1561 if ActionList.Actions[i].Name = ActionName then begin
1562 Result := ActionList.Actions[i];
1563 Exit;
1564 end;
1565 end;
1566 Result := nil;
1567 end;}
1568
1569 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1570 var
1571 i: Integer;
1572 CoolSet: TCoolSet;
1573 wp: TWindowPlacement;
1574 begin
1575 if ( GikoSys.Setting.ShowDialogForEnd ) and
1576 (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1577 CanClose := false;
1578 Exit;
1579 end else begin
1580 CanClose := True;
1581 end;
1582 Application.OnDeactivate := nil;
1583 Self.OnDeactivate := nil;
1584
1585 //column鐃緒申
1586 if GetActiveList is TBBS2ch then begin
1587 for i := 0 to ListView.Columns.Count - 1 do
1588 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
1589 end else if GetActiveList is TCategory then begin
1590 for i := 0 to ListView.Columns.Count - 1 do
1591 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
1592 end else if GetActiveList is TBoard then begin
1593 for i := 0 to ListView.Columns.Count - 1 do
1594 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1595 end;
1596
1597 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1598 wp.length := sizeof(wp);
1599 GetWindowPlacement(Handle, @wp);
1600 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1601 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1602 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1603 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1604 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1605
1606 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1607 GikoSys.Setting.CabinetVisible := CabinetVisibleAction.Checked;
1608 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1609 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1610 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1611 if ArrangeAction.Checked then
1612 GikoSys.Setting.ListOrientation := gloVertical
1613 else
1614 GikoSys.Setting.ListOrientation := gloHorizontal;
1615 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1616
1617 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1618 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1619 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1620 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1621 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1622 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1623 end;
1624 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1625 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1626 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1627 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1628 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1629 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1630 end;
1631 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1632 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1633 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1634 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1635 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1636 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1637 end;
1638
1639 GikoSys.Setting.WriteWindowSettingFile;
1640 GikoSys.Setting.WriteNameMailSettingFile;
1641
1642 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1643 try
1644 FavoriteDM.WriteFavorite;
1645 except
1646 end;
1647 // Favorite.Free;
1648
1649 try
1650 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1651 NotSelectTabCloseAction.Execute;
1652 if BrowserTab.Tabs.Count >= 1 then begin
1653 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1654 end;
1655 except
1656 end;
1657
1658 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1659 try
1660 RoundList.SaveRoundFile;
1661 except
1662 end;
1663 try
1664 RoundList.Clear;
1665 except
1666 end;
1667 try
1668 RoundList.Free;
1669 except
1670 end;
1671
1672 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1673 try
1674 FHistoryList.Free;
1675 except
1676 end;
1677
1678 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1679 try
1680 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1681 except
1682 end;
1683
1684 try
1685 FControlThread.Terminate;
1686 except
1687 end;
1688
1689 // FDownload.Free;
1690 try
1691 SetActiveList(nil);
1692 except
1693 end;
1694 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1695 Sleep(10);
1696 try
1697 TreeView.Items.Clear;
1698 except
1699 end;
1700
1701 try
1702 if FavoriteDM <> nil then
1703 FavoriteDM.Free;
1704 FavoriteDM := nil;
1705 if AddressHistoryDM <> nil then
1706 AddressHistoryDM.Free;
1707 AddressHistoryDM := nil;
1708 except
1709 end;
1710 try
1711 if BBS2ch <> nil then
1712 BBS2ch.Free;
1713 BBS2ch := nil;
1714 except
1715 end;
1716
1717 try
1718 //Hint鐃?鐃緒申
1719 if FHint <> nil then begin
1720 FHint.ReleaseHandle;
1721 FHint.Free;
1722 FHint := nil;
1723 end;
1724 //Preview鐃?鐃緒申
1725 if TPreviewBrowser <> nil then begin
1726 FPreviewBrowser.Free;
1727 FPreviewBrowser := nil;
1728 end;
1729 except
1730 end;
1731 end;
1732
1733 procedure TGikoForm.FormDestroy(Sender: TObject);
1734 //var
1735 // wp: TWindowPlacement;
1736 begin
1737 { //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1738 FHistoryList.Free;
1739
1740 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1741 wp.length := sizeof(wp);
1742 GetWindowPlacement(Handle, @wp);
1743
1744 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1745 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1746 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1747 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1748 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1749
1750 GikoSys.Setting.CabinetVisible := CabinetPanel.Visible;
1751 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1752
1753 GikoSys.Setting.WriteWindowSettingFile;
1754 GikoSys.Setting.WriteNameMailSettingFile;
1755 FDownload.Free;
1756 BBS2ch.Free;}
1757 end;
1758
1759 //鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1760 procedure TGikoForm.FormClose(Sender: TObject; var Action: TCloseAction);
1761 begin
1762 Application.Terminate;
1763 Action := caFree;
1764 end;
1765
1766 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1767 procedure TGikoForm.CabinetPanelHide(Sender: TObject);
1768 begin
1769 CabinetVisibleAction.Execute;
1770 // CabinetPanelVisible(false);
1771 end;
1772
1773 procedure TGikoForm.ReloadBBS;
1774 begin
1775 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1776 NotSelectTabCloseAction.Execute;
1777 if BrowserTab.Tabs.Count >= 1 then
1778 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1779 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1780 FHistoryList.Clear;
1781 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1782 TreeView.Items.Clear;
1783
1784 //BBS鐃?鐃緒申
1785 BBS2ch.Free;
1786
1787 SetActiveList(nil);
1788
1789 FTreeType := gttNone;
1790
1791 //BBS鐃緒申鐃緒申
1792 BBS2ch := TBBS2ch.Create(GikoSys.Setting.LogFolder);
1793
1794 BBS2ch.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1795 Show2chTree;
1796 end;
1797
1798 //鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1799 procedure TGikoForm.SetBoardTreeNode;
1800 var
1801 i, j: integer;
1802 Root: TTreeNode;
1803 CategoryNode: TTreeNode;
1804 BoardNode: TTreeNode;
1805 Category: TCategory;
1806 Board: TBoard;
1807 begin
1808 TreeView.Items.BeginUpdate;
1809 TreeView.Items.Clear;
1810 try
1811 Root := TreeView.Items.Add(nil, BBS2ch.Title);
1812 Root.ImageIndex := ITEM_ICON_2CH1;
1813 Root.SelectedIndex := ITEM_ICON_2CH2;
1814 Root.Data := BBS2ch;
1815 if SplashWindow <> nil then
1816 SplashWindow.ProgressBar.Max := BoardGroup.BBS2ch.Count;
1817
1818 for i := 0 to BoardGroup.BBS2ch.Count - 1 do begin
1819 Category := TCategory(BoardGroup.BBS2ch.Items[i]);
1820 CategoryNode := TreeView.Items.AddChild(Root, Category.Title);
1821 CategoryNode.Data := Category;
1822 CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
1823 CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
1824
1825 for j := 0 to Category.Count - 1 do begin
1826 Board := TBoard(Category.Items[j]);
1827 Board.BeginUpdate;
1828 BoardNode := TreeView.Items.AddChild(CategoryNode, Board.Title);
1829 BoardNode.Data := Board;
1830 BoardNode.ImageIndex := ITEM_ICON_BOARD1;
1831 BoardNode.SelectedIndex := ITEM_ICON_BOARD2;
1832 Board.LoadSettings;
1833 Board.EndUpdate;
1834 end;
1835
1836 CategoryNode.Expanded := Category.NodeExpand;
1837
1838 if SplashWindow <> nil then begin
1839 SplashWindow.ProgressBar.StepIt;
1840 Application.ProcessMessages;
1841 end;
1842
1843 end;
1844 finally
1845 TreeView.Items.EndUpdate;
1846 end;
1847 end;
1848
1849 function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
1850 const
1851 COLUMN: array[0..0] of string = ('鐃?鐃?鐃?鐃緒申鐃緒申');
1852 var
1853 ListColumn: TListColumn;
1854 i: Integer;
1855 begin
1856 ListView.Items.BeginUpdate;
1857 try
1858 Screen.Cursor := crHourGlass;
1859
1860 ListView.Columns.Clear;
1861 for i := 0 to Length(COLUMN) - 1 do begin
1862 ListColumn := ListView.Columns.Add;
1863 ListColumn.Caption := COLUMN[i];
1864 ListColumn.Width := GikoSys.Setting.BBSColumnWidth[i];
1865 end;
1866
1867 ListView.Items.Count := 0;
1868 ListView.Items.Clear;
1869 ListView.Items.Count := ABBS2ch.Count;
1870
1871 // UpFolderAction.Enabled := False;
1872 // AllItemAction.Enabled := False;
1873 // LogItemAction.Enabled := False;
1874 // NewItemAction.Enabled := False;
1875 // SelectItemAction.Enabled := False;
1876 // ListDownloadToolButton.Enabled := False;
1877 // BoardReservToolButton.Enabled := False;
1878 // ListThreadDownloadToolButton.Enabled := False;
1879
1880 ListNameLabel.Caption := ABBS2ch.Title;
1881 FolderImage.Picture := nil;
1882 ItemIcon16.GetBitmap(1, FolderImage.Picture.Bitmap);
1883
1884 FSortIndex := 0;
1885 FSortOrder := False;
1886 ListViewColumnClick(nil, ListView.Column[0]);
1887
1888 Result := ABBS2ch.Count;
1889 finally
1890 Screen.Cursor := crDefault;
1891 ListView.Items.EndUpdate;
1892 end;
1893 end;
1894
1895 function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
1896 const
1897 COLUMN: array[0..2] of string = ('鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1898 var
1899 ListColumn: TListColumn;
1900 i: Integer;
1901 begin
1902 ListView.Items.BeginUpdate;
1903 try
1904 Screen.Cursor := crHourGlass;
1905
1906 ListView.Columns.Clear;
1907 for i := 0 to Length(COLUMN) - 1 do begin
1908 ListColumn := ListView.Columns.Add;
1909 ListColumn.Caption := COLUMN[i];
1910 ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[i];
1911 end;
1912
1913 ListView.Items.Count := 0;
1914 ListView.Items.Clear;
1915 ListView.Items.Count := Category.Count;
1916
1917 // UpFolderAction.Enabled := True;
1918 // AllItemAction.Enabled := False;
1919 // LogItemAction.Enabled := False;
1920 // NewItemAction.Enabled := False;
1921 // SelectItemAction.Enabled := False;
1922 // ListDownloadToolButton.Enabled := False;
1923 // BoardReservToolButton.Enabled := False;
1924 // ListThreadDownloadToolButton.Enabled := False;
1925
1926 ListNameLabel.Caption := Category.Title;
1927 FolderImage.Picture := nil;
1928 ItemIcon16.GetBitmap(3, FolderImage.Picture.Bitmap);
1929
1930 FSortIndex := 0;
1931 FSortOrder := False;
1932 ListViewColumnClick(nil, ListView.Column[0]);
1933
1934 Result := Category.Count;
1935 finally
1936 Screen.Cursor := crDefault;
1937 ListView.Items.EndUpdate;
1938 end;
1939 end;
1940
1941 function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
1942 const
1943 COLUMN: array[0..6] of string = ('鐃?鐃緒申鐃?鐃?鐃緒申', '鐃?鐃?鐃緒申鐃?', '鐃緒申鐃緒申', '鐃?鐃緒申',
1944 '鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1945 COLUMN_ALIGNMENT: array[0..6] of TAlignment = (taLeftJustify, taRightJustify,
1946 taRightJustify, taRightJustify,
1947 taRightJustify, taLeftJustify,
1948 taLeftJustify);
1949 //No, 鐃?鐃緒申鐃?鐃?鐃緒申, 鐃?鐃?鐃緒申鐃?, 鐃緒申鐃緒申鐃?鐃緒申, 鐃緒申鐃緒申鐃緒申鐃緒申
1950 var
1951 ListColumn: TListColumn;
1952 i: Integer;
1953 begin
1954 ListView.Items.BeginUpdate;
1955 try
1956 Screen.Cursor := crHourGlass;
1957
1958 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1959 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1960 if ListView.Columns.Count <> (High( COLUMN ) - Low( COLUMN ) + 1) then
1961 begin
1962 ListView.Columns.Clear;
1963 for i := 0 to Length(COLUMN) - 1 do begin
1964 ListColumn := ListView.Columns.Add;
1965 ListColumn.Caption := COLUMN[i];
1966 ListColumn.Width := GikoSys.Setting.BoardColumnWidth[i];
1967 ListColumn.Alignment := COLUMN_ALIGNMENT[i];
1968 end;
1969 end;
1970
1971 ListView.Items.Count := 0;
1972 ListView.Items.Clear;
1973
1974 case GikoForm.ViewType of
1975 gvtAll: ListView.Items.Count := Board.Count;
1976 gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
1977 gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
1978 gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
1979 end;
1980
1981 ListNameLabel.Caption := Board.Title;
1982 FolderImage.Picture := nil;
1983 ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
1984
1985 FSortIndex := 0;
1986 FSortOrder := False;
1987 ListViewColumnClick(nil, ListView.Column[0]);
1988
1989 Result := Board.Count;
1990 finally
1991 Screen.Cursor := crDefault;
1992 ListView.Items.EndUpdate;
1993 end;
1994 end;
1995
1996 procedure TGikoForm.TreeViewChange(Sender: TObject; Node: TTreeNode);
1997 var
1998 i: Integer;
1999 begin
2000 if FTreeType = gttHistory then begin
2001 // SetContent(TThreadItem(Node.Data));
2002 InsertBrowserTab(TThreadItem(Node.Data));
2003 Exit;
2004 end;
2005
2006 ListView.Selected := nil;
2007 ListView.Items.Count := 0;
2008 ListView.Items.Clear;
2009 // ListView.Columns.Clear;
2010
2011 Caption := CAPTION_NAME;
2012 //Application.Title := CAPTION_NAME;
2013
2014
2015 if GetActiveList is TBBS2ch then begin
2016 for i := 0 to ListView.Columns.Count - 1 do
2017 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
2018 end else if GetActiveList is TCategory then begin
2019 for i := 0 to ListView.Columns.Count - 1 do
2020 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
2021 end else if GetActiveList is TBoard then begin
2022 for i := 0 to ListView.Columns.Count - 1 do
2023 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
2024 end;
2025
2026 if TObject(Node.Data) is TBBS2ch then begin
2027 SetActiveList(Node.data);
2028 end else if TObject(Node.Data) is TCategory then begin
2029 SetActiveList(Node.data);
2030 end else if TObject(Node.Data) is TBoard then begin
2031 if not TBoard(Node.Data).IsThreadDatRead then begin
2032 Screen.Cursor := crHourGlass;
2033 try
2034 GikoSys.ReadSubjectFile(TBoard(Node.Data));
2035 finally
2036 Screen.Cursor := crDefault;
2037 end;
2038 end;
2039 SetActiveList(Node.data);
2040 end;
2041 end;
2042
2043 procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
2044 var
2045 // FileName: string;
2046 // DateTime: TDateTime;
2047 BoardCnt: Integer;
2048 BBS: TBBS2ch;
2049 Category: TCategory;
2050 Board: TBoard;
2051 ThreadItem: TThreadItem;
2052 RepStr: string;
2053 begin
2054 if ActiveList is TBBS2ch then begin
2055 BBS := TBBS2ch(ActiveList);
2056
2057 ListView.StateImages := nil;
2058
2059 if BBS = nil then Exit;
2060 if BBS.Count <= 0 then Exit;
2061 if Item = nil then Exit;
2062 if Item.Index > BBS.Count then Exit;
2063 if ListView.Items.Count = 0 then Exit;
2064
2065 if not (BBS.Items[Item.Index] is TCategory) then Exit;
2066 Category := TCategory(BBS.Items[Item.Index]);
2067
2068 if Category = nil then Exit;
2069
2070 if ListNumberVisibleAction.Checked then
2071 Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
2072 else
2073 Item.Caption := Category.Title;
2074
2075 Item.ImageIndex := ITEM_ICON_CATEGORY1;
2076 Item.Data := Category;
2077 end else if ActiveList is TCategory then begin
2078 Category := TCategory(ActiveList);
2079
2080 ListView.StateImages := nil;
2081
2082 if Category = nil then Exit;
2083 if Category.Count <= 0 then Exit;
2084 if Item = nil then Exit;
2085 if Item.Index >= Category.Count then Exit;
2086 if ListView.Items.Count = 0 then Exit;
2087
2088 if not (Category.Items[Item.Index] is TBoard) then Exit;
2089 Board := TBoard(Category.Items[Item.Index]);
2090
2091 if Board = nil then Exit;
2092
2093 if ListNumberVisibleAction.Checked then
2094 Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
2095 else
2096 Item.Caption := Board.Title;
2097
2098 if Item.SubItems.Count <> 2 then begin
2099 Item.SubItems.Clear;
2100 Item.SubItems.Add('');
2101 Item.SubItems.Add('');
2102 end;
2103
2104 Item.ImageIndex := ITEM_ICON_BOARD1;
2105
2106 if Board.Round then
2107 Item.SubItems[0] := Board.RoundName // '鐃?鐃緒申'
2108 else
2109 Item.SubItems[0] := '';
2110
2111 if Board.RoundDate = ZERO_DATE then begin
2112 Item.SubItems[1] := '';
2113 end else
2114 Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
2115 Item.Data := Board;
2116 end else if ActiveList is TBoard then begin
2117 Board := TBoard(ActiveList);
2118
2119 if GikoSys.Setting.ListIconVisible then
2120 ListView.StateImages := StateIconImageList
2121 else
2122 ListView.StateImages := nil;
2123
2124 case GikoForm.ViewType of
2125 gvtAll: BoardCnt := Board.Count;
2126 gvtLog: BoardCnt := Board.GetLogThreadCount;
2127 gvtNew: BoardCnt := Board.GetNewThreadCount;
2128 gvtUser: BoardCnt := Board.GetUserThreadCount;
2129 else
2130 BoardCnt := 0;
2131 end;
2132
2133 // if Board = nil then Exit;
2134 if BoardCnt <= 0 then Exit;
2135 if Item = nil then Exit;
2136 if Item.Index > BoardCnt then Exit;
2137 if ListView.Items.Count = 0 then Exit;
2138
2139 // if not (Board.Items[Item.Index] is TThreadItem) then Exit;
2140
2141 ThreadItem := nil;
2142 case GikoForm.ViewType of
2143 gvtAll: ThreadItem := TThreadItem(Board.Items[Item.Index]);
2144 gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
2145 gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
2146 gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
2147 end;
2148
2149 if ThreadItem = nil then Exit;
2150
2151 // if ListNumberVisibleAction.Checked then
2152 // RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title
2153 // else
2154 RepStr := ThreadItem.Title;
2155 //RepStr := StringReplace(RepStr, '&amp;', '&', [rfReplaceAll]);
2156 RepStr := StringReplace(RepStr, '&lt;', '<', [rfReplaceAll]);
2157 RepStr := StringReplace(RepStr, '&gt;', '>', [rfReplaceAll]);
2158 RepStr := StringReplace(RepStr, '&quot;', '"', [rfReplaceAll]);
2159 RepStr := StringReplace(RepStr, '&amp', '&', [rfReplaceAll]);
2160 //RepStr := StringReplace(RepStr, '鐃緒申鐃?', ',', [rfReplaceAll]);
2161
2162 if Item.SubItems.Count <> 6 then begin
2163 Item.SubItems.Clear;
2164 Item.SubItems.Add('');
2165 Item.SubItems.Add('');
2166 Item.SubItems.Add('');
2167 Item.SubItems.Add('');
2168 Item.SubItems.Add('');
2169 Item.SubItems.Add('');
2170 end;
2171
2172 if ListNumberVisibleAction.Checked then
2173 Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
2174 else
2175 Item.Caption := RepStr;
2176
2177 case ThreadItem.AgeSage of
2178 gasNone: Item.StateIndex := -1;
2179 gasNew: Item.StateIndex := 0;
2180 gasAge: Item.StateIndex := 1;
2181 gasSage: Item.StateIndex := 2;
2182 end;
2183
2184 if ThreadItem.IsLogFile then begin
2185 Item.ImageIndex := ITEM_ICON_THREADLOG1;
2186 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2187 Item.SubItems[1] := IntToStr(ThreadItem.Count);
2188 if ThreadItem.NewResCount = 0 then
2189 Item.SubItems[2] := ''
2190 else
2191 Item.SubItems[2] := IntToStr(ThreadItem.NewResCount);
2192 Item.SubItems[3] := '';
2193 if ThreadItem.Round then
2194 Item.SubItems[4] := ThreadItem.RoundName
2195 else
2196 Item.SubItems[4] := '';
2197 if ThreadItem.RoundDate = ZERO_DATE then begin
2198 Item.SubItems[5] := '';
2199 end else
2200 Item.SubItems[5] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
2201 if ThreadItem.NewArrival then
2202 Item.ImageIndex := ITEM_ICON_THREADNEW1;
2203 end else begin
2204 Item.ImageIndex := ITEM_ICON_THREAD1;
2205 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2206 Item.SubItems[1] := '';
2207 Item.SubItems[2] := '';
2208 Item.SubItems[3] := '';
2209 Item.SubItems[4] := '';
2210 Item.SubItems[5] := '';
2211 end;
2212 Item.Data := ThreadItem;
2213 end;
2214 end;
2215
2216 procedure TGikoForm.ListViewDataFind(Sender: TObject; Find: TItemFind;
2217 const FindString: String; const FindPosition: TPoint; FindData: Pointer;
2218 StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
2219 var Index: Integer);
2220 begin
2221 //
2222 end;
2223
2224 procedure TGikoForm.ListViewDataHint(Sender: TObject; StartIndex,
2225 EndIndex: Integer);
2226 begin
2227 //
2228 end;
2229
2230 procedure TGikoForm.ListViewDataStateChange(Sender: TObject; StartIndex,
2231 EndIndex: Integer; OldState, NewState: TItemStates);
2232 begin
2233 //
2234 end;
2235
2236 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
2237 var
2238 p: TPoint;
2239 s: string;
2240 tmp2: string;
2241 URL: string;
2242 ATitle: Boolean;
2243
2244 wkBBS: string;
2245 wkKey: string;
2246
2247 //wkInt: Integer;
2248 wkIntSt: Integer;
2249 wkIntTo: Integer;
2250
2251 ActiveFileName: string;
2252 e: IHTMLElement;
2253 Ext: string;
2254 PathRec: TPathRec;
2255 begin
2256 try
2257 try
2258 if (FActiveContent <> nil) and (Assigned(Browser.Document)) then begin
2259 if LowerCase(OleVariant(IHTMLDocument2(Browser.Document)).charset) <> 'shift_jis' then
2260 OleVariant(IHTMLDocument2(Browser.Document)).charset := 'shift_jis';
2261 end;
2262 except
2263 end;
2264 finally
2265 end;
2266 if PreviewTimer.Enabled then
2267 PreviewTimer.Enabled := False;
2268 Application.CancelHint;
2269 if GetActiveContent <> nil then
2270 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2271 else
2272 ActiveFileName := '';
2273
2274 StatusBar.Panels[1].Text := Text;
2275
2276 if FHint <> nil then begin
2277 FHint.ReleaseHandle;
2278 FHint.ClearAllRes;
2279 end;
2280 if FPreviewBrowser <> nil then
2281 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2282
2283 if not GikoSys.Setting.UnActivePopup then
2284 if not GikoForm.Active then
2285 Exit;
2286
2287 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2288 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2289
2290 s := '';
2291 Ext := AnsiLowerCase(ExtractFileExt(Text));
2292 if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
2293 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2294 if FPreviewBrowser = nil then begin
2295 FPreviewBrowser := TPreviewBrowser.Create(Self);
2296 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2297 TOleControl(FPreviewBrowser).Parent := nil;
2298 end;
2299 FPreviewBrowser.Navigate('about:blank');//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2300 FPreviewURL := Text;
2301 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2302 PreviewTimer.Enabled := True;
2303 end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
2304 if Pos('mailto:', Text) = 1 then begin
2305 s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
2306 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2307 GetCursorPos(p);
2308 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2309 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2310 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2311 if (Assigned(e)) then begin
2312 tmp2 := GikoSys.ZenToHan(e.Get_outerText);
2313 if (GikoSys.IsNumeric(tmp2)) then begin
2314 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2315 wkBBS := GetActiveContent.ParentBoard.BBSID;
2316 wkKey := ChangeFileExt(GetActiveContent.FileName, '');
2317 wkIntSt := StrToInt(tmp2);
2318 wkIntTo := StrToInt(tmp2);
2319 //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2320 FHint.PopupType := gptThread;
2321 SetResPopupText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2322 end else begin
2323 FHint.PopupType := gptRaw;
2324 FHint.Caption := s;
2325 end;
2326 end;
2327 end else begin
2328 URL := Text;
2329
2330 if Pos('about:blank..', URL) = 1 then
2331 URL := StringReplace(URL, 'about:blank..', 'http://www.2ch.net', []);
2332
2333 PathRec := Gikosys.Parse2chURL2(URL);
2334
2335 if PathRec.FDone then begin
2336
2337 wkIntSt := PathRec.FSt;
2338 wkIntTo := PathRec.FTo;
2339
2340 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2341 wkIntSt := 1;
2342 wkIntTo := 1;
2343 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2344 wkIntSt := wkIntTo;
2345 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2346 wkIntTo := wkIntSt;
2347 end else if wkIntSt > wkIntTo then begin
2348 //wkInt := wkIntTo;
2349 wkIntTo := wkIntSt;
2350 wkIntSt := wkIntTo;
2351 end;
2352 //if wkIntSt = 0 then
2353 // wkIntSt := 1;
2354 //if wkINtTo = 0 then
2355 // wkIntTo := 1;
2356 //if PathRec.FFirst then
2357 // wkIntSt := 1;
2358 if PathRec.FStBegin then
2359 wkIntSt := 1;
2360 if PathRec.FToEnd then
2361 wkIntTo := 9999;
2362
2363 ATitle := ActiveFileName <> PathRec.FKey;
2364
2365 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2366 FHint.PopupType := gptThread;
2367 SetResPopupText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2368 end;
2369 end;
2370
2371 //if s <> '' then
2372 // ShowTextPopup(s);
2373 if FHint.PopupType = gptRaw then begin
2374 if FHint.Caption <> '' then
2375 ShowTextPopup;
2376 end else begin
2377 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
2378 ShowTextPopup;
2379 end;
2380 end;
2381 end;
2382
2383 procedure TGikoForm.BrowserTitleChange(Sender: TObject;
2384 const Text: WideString);
2385 var
2386 Title: string;
2387 begin
2388 if (Text = BLANK_HTML) or (Text = GikoSys.GetHtmlTempFileName) then
2389 Title := CAPTION_NAME
2390 else
2391 Title := CAPTION_NAME + ' - [' + Text + ']';
2392 Caption := Title;
2393 //Application.Title := Title;
2394 end;
2395
2396 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2397 var
2398 SysMenu: HMenu;
2399 //SysMenuApp: HMenu;
2400 begin
2401 FEnabledCloseButton := Enabled;
2402 SysMenu := GetSystemMenu(Handle, False);
2403 //SysMenuApp := GetSystemMenu(Application.Handle, False);
2404
2405 if Enabled then begin
2406 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2407 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2408 end else begin
2409 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2410 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2411 end;
2412
2413 DrawMenuBar(Handle);
2414 //DrawMenuBar(Application.Handle);
2415 end;
2416
2417 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2418 var AllowChange: Boolean);
2419 begin
2420 if FTreeType = gtt2ch then
2421 FSortIndex := -1;
2422 end;
2423
2424 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2425 Shift: TShiftState);
2426 begin
2427 if Key = VK_BACK then begin
2428 // UpFolderButtonClick(Sender);
2429 end else if Key = VK_SPACE then begin
2430 // ListClick;
2431 end else if Key = VK_RETURN then begin
2432 ListDoubleClick;
2433 end;
2434 end;
2435
2436 function TGikoForm.GetHttpState: Boolean;
2437 begin
2438 Result := FHttpState;
2439 end;
2440
2441 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2442 Column: TListColumn);
2443 var
2444 i: Integer;
2445 wkBBS: TBBS2ch;
2446 wkCategory: TCategory;
2447 wkBoard: TBoard;
2448 begin
2449 if FSortIndex = Column.Index then
2450 FSortOrder := not FSortOrder
2451 else
2452 FSortOrder := False;
2453
2454 for i := 0 to ListView.Columns.Count - 1 do
2455 ListView.Column[i].ImageIndex := -1;
2456 if FSortOrder then
2457 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT1
2458 else
2459 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT2;
2460
2461 Sort.SortNoFlag := ListNumberVisibleAction.Checked;
2462
2463 if TObject(TreeView.Selected.Data) is TBBS2ch then begin
2464 wkBBS := TBBS2ch(TreeView.Selected.Data);
2465 Sort.SortOrder := FSortOrder;
2466 Sort.SortIndex := Column.Index;
2467 wkBBS.Sort(CategorySortProc);
2468 ListView.Refresh;
2469 end else if TObject(TreeView.Selected.Data) is TCategory then begin
2470 wkCategory := TCategory(TreeView.Selected.Data);
2471 Sort.SortOrder := FSortOrder;
2472 Sort.SortIndex := Column.Index;
2473 wkCategory.Sort(BoardSortProc);
2474 ListView.Refresh;
2475 end else if TObject(TreeView.Selected.Data) is TBoard then begin
2476 wkBoard := TBoard(TreeView.Selected.Data);
2477 Sort.SortOrder := FSortOrder;
2478 Sort.SortIndex := Column.Index;
2479 wkBoard.Sort(ThreadItemSortProc);
2480 ListView.Refresh;
2481 end;
2482 FSortIndex := Column.Index;
2483 end;
2484
2485 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2486 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2487 var
2488 ARect: TRect;
2489 begin
2490 DefaultDraw := True;
2491 Exit;
2492 DefaultDraw := False;
2493 if (cdsSelected in State) or (cdsHot in State) then begin
2494 Sender.Canvas.Brush.Color := clHighlight;
2495 Sender.Canvas.Font.Color := clHighlightText;
2496 end else begin
2497 Sender.Canvas.Brush.Color := clBtnFace;
2498 Sender.Canvas.Font.Color := clBtnText;
2499 end;
2500 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2501 Sender.Canvas.FillRect(ARect);
2502 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2503 end;
2504
2505 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2506 var
2507 Nodes: TTreeNodes;
2508 i: integer;
2509 begin
2510 Nodes := TreeView.Items;
2511
2512 for i := 0 to Nodes.Count - 1 do begin
2513 if Nodes.Item[i].Data = Data then begin
2514 Result := Nodes.Item[i];
2515 Exit;
2516 end;
2517 end;
2518 Result := nil;
2519 end;
2520
2521 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2522 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2523 Headers: OleVariant; var Cancel: WordBool);
2524 var
2525 sNo: string;
2526 p: TPoint;
2527 const
2528 kMenuName: string = 'menu:';
2529 begin
2530
2531 if Pos(kMenuName, URL) <> 0 then begin
2532 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2533
2534 if not GikoSys.IsNumeric(sNo) then Exit;
2535
2536 Cancel := True;
2537 GetCursorpos(p);
2538 KokoPopupMenu.Tag := StrToInt(sNo);
2539 KokoPopupMenu.Popup(p.x, p.y);
2540 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2541 Cancel := not GikoSys.Setting.OpenMailer;
2542 end;
2543
2544 end;
2545
2546 procedure TGikoForm.ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
2547 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
2548 var DefaultDraw: Boolean);
2549 var
2550 ThreadItem: TThreadItem;
2551 begin
2552 DefaultDraw := True;
2553 // TListView(Sender).Canvas.Font.Style := [];
2554 if TObject(Item.Data) is TThreadItem then begin
2555 ThreadItem := TThreadItem(Item.Data);
2556 // if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then
2557 if ThreadItem.UnRead then
2558 TListView(Sender).Canvas.Font.Style := [fsBold];
2559 end;
2560 end;
2561
2562 procedure TGikoForm.AppFormDeactivate(Sender: TObject);
2563 begin
2564 if Application.Terminated then
2565 Exit;
2566 if PreviewTimer.Enabled then
2567 PreviewTimer.Enabled := False;
2568 //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2569 if FHint <> nil then begin
2570 FHint.ReleaseHandle;
2571 FHint.ClearAllRes;
2572 // FHint.Free;
2573 // FHint := nil;
2574 end;
2575 if FPreviewBrowser <> nil then
2576 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2577
2578 end;
2579
2580 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2581 const ARect: TRect; var DefaultDraw: Boolean);
2582 var
2583 NodeRect: TRect;
2584 i, j: Integer;
2585 IsBoardNode: Boolean;
2586 Cnt: Integer;
2587 CntText: string;
2588 TextWidth: Integer;
2589 TextRect: TRect;
2590 Board: TBoard;
2591 Category: TCategory;
2592 Bitmap: TBitmap;
2593 NodeWidth: Integer;
2594 begin
2595 DefaultDraw := True;
2596
2597 if FTreeType = gttHistory then Exit;
2598
2599 TreeView.Canvas.Font.Color := clBlue;
2600 IsBoardNode := False;
2601
2602 for i := 0 to TreeView.Items.Count - 1 do begin
2603 Cnt := 0;
2604 if not TreeView.Items[i].IsVisible then
2605 continue;
2606
2607 if TObject(TreeView.Items[i].Data) is TCategory then begin
2608 if TreeView.Items[i].Expanded then
2609 continue;
2610
2611 IsBoardNode := False;
2612 Category := TCategory(TreeView.Items[i].Data);
2613 for j := 0 to Category.Count - 1 do begin
2614 Board := Category.Items[j];
2615 if Board <> nil then begin
2616 if Board.UnRead > 0 then begin
2617 Cnt := 1;
2618 Break;
2619 end;
2620 end;
2621 end;
2622 if Cnt <> 1 then
2623 continue;
2624 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2625 IsBoardNode := True;
2626 Board := TBoard(TreeView.Items[i].Data);
2627 Cnt := Board.UnRead;
2628 if Cnt <= 0 then
2629 continue;
2630 end else
2631 continue;
2632
2633 Bitmap := TBitmap.Create;
2634 try
2635 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2636 Bitmap.Canvas.Font.Style := [fsBold];
2637 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2638 finally
2639 Bitmap.Free;
2640 end;
2641
2642 NodeRect := TreeView.Items[i].DisplayRect(True);
2643
2644 if IsBoardNode then
2645 CntText := '(' + IntToStr(Cnt) + ')'
2646 else if Cnt = 1 then
2647 CntText := '(+)';
2648
2649
2650 TextWidth := TreeView.Canvas.TextWidth(CntText);
2651
2652 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2653 NodeRect.Top,
2654 NodeRect.Left + NodeWidth + TextWidth + 8,
2655 NodeRect.Bottom);
2656 DrawText(TreeView.Canvas.Handle,
2657 PChar(CntText),
2658 -1,
2659 TextRect,
2660 DT_SINGLELINE or DT_VCENTER);
2661 end;
2662 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2663 end;
2664
2665 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2666 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2667 var
2668 Board: TBoard;
2669 Category: TCategory;
2670 i: Integer;
2671 begin
2672 DefaultDraw := True;
2673
2674 if FTreeType = gttHistory then Exit;
2675
2676 TreeView.Canvas.Font.Style := [];
2677 if Node <> nil then begin
2678 if TObject(Node.Data) is TCategory then begin
2679 Category := TCategory(Node.Data);
2680 for i := 0 to Category.Count - 1 do begin
2681 Board := Category.Items[i];
2682 if Board <> nil then begin
2683 if Board.UnRead > 0 then begin
2684 TreeView.Canvas.Font.Style := [fsBold];
2685 Break;
2686 end;
2687 end;
2688 end;
2689 end else if TObject(Node.Data) is TBoard then begin
2690 Board := TBoard(Node.Data);
2691 if Board.UnRead > 0 then
2692 TreeView.Canvas.Font.Style := [fsBold];
2693 end;
2694 end;
2695 end;
2696
2697 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2698 begin
2699 TreeView.Invalidate;
2700
2701 if TObject(Node.Data) is TBBS2ch then begin
2702 TBBS2ch(Node.Data).NodeExpand := True;
2703 end else if TObject(Node.Data) is TCategory then begin
2704 TCategory(Node.Data).NodeExpand := True;
2705 end else if TObject(Node.Data) is TBoard then begin
2706 TBoard(Node.Data).NodeExpand := True;
2707 end;
2708 end;
2709
2710 {procedure TGikoForm.CabinetPanelVisible(PanelVisible: Boolean);
2711 begin
2712 TreeSplitter.Visible := PanelVisible;
2713 CabinetPanel.Visible := PanelVisible;
2714 CabinetToolButton.Down := PanelVisible;
2715 end;}
2716
2717 procedure TGikoForm.ListViewAllSelect;
2718 begin
2719 ListView.SetFocus;
2720 ListView.SelectAll;
2721 end;
2722
2723 procedure TGikoForm.TreeViewDblClick(Sender: TObject);
2724 var
2725 Board: TBoard;
2726 ThreadItem: TThreadItem;
2727 APoint: TPoint;
2728 HitTest: THitTests;
2729 begin
2730 GetCursorPos(APoint);
2731 APoint := TreeView.ScreenToClient(APoint);
2732 HitTest := TreeView.GetHitTestInfoAt(APoint.x, APoint.y);
2733 if not (htOnLabel in HitTest) then Exit;
2734 if TreeView.Selected = nil then Exit;
2735
2736 if FTreeType = gtt2ch then begin
2737 if not (TObject(TreeView.Selected.Data) is TBoard) then Exit;
2738 Board := TBoard(TreeView.Selected.Data);
2739 DownloadList(Board);
2740 end else if FTreeType = gttHistory then begin
2741 if not (TObject(TreeView.Selected.Data) is TThreadItem) then Exit;
2742 ThreadItem := TThreadItem(TreeView.Selected.Data);
2743 DownloadContent(ThreadItem);
2744 end;
2745 end;
2746
2747 procedure TGikoForm.FavoriteTreeViewClick(Sender: TObject);
2748 begin
2749
2750 FavoriteClick( TObject( FavoriteTreeView.Selected ) );
2751
2752 end;
2753
2754 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2755 begin
2756 AddMessageList(Msg, nil, Icon);
2757 end;
2758
2759 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2760 var
2761 ATitle: string;
2762 s: string;
2763 begin
2764 try
2765 if Item.DownType = gdtBoard then
2766 ATitle := Item.Board.Title
2767 else
2768 ATitle := Item.ThreadItem.Title;
2769 if ATitle = '' then
2770 ATitle := '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?';
2771
2772 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2773 //鐃緒申鐃緒申鐃?鐃緒申
2774 if Item.DownType = gdtBoard then begin
2775 //鐃緒申
2776 Item.SaveListFile;
2777 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2778 if GetActiveList = Item.Board then
2779 SetActiveList(Item.Board);
2780 Item.Board.Modified := True;
2781 Item.Board.IsThreadDatRead := True;
2782 PlaySound('New');
2783 end else if Item.DownType = gdtThread then begin
2784 //鐃?鐃緒申
2785 Item.SaveItemFile;
2786 Item.ThreadItem.NewArrival := True;
2787 if AddHistory(Item.ThreadItem) then begin
2788 if GetActiveContent = Item.ThreadItem then
2789 InsertBrowserTab(Item.ThreadItem)
2790 else
2791 InsertBrowserTab(Item.ThreadItem, False);
2792 end;
2793
2794 if Item.State = gdsComplete then begin
2795 PlaySound('New');
2796 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2797 end else begin
2798 PlaySound('NewDiff');
2799 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2800 end;
2801
2802 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2803 if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
2804 Item.ThreadItem.Round := False;
2805 Item.ThreadItem.RoundName := '';
2806 AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
2807 end;
2808
2809 TreeView.Refresh;
2810 end;
2811 ListView.Refresh;
2812 end else if Item.State = gdsNotModify then begin
2813 //鐃緒申鐃?鐃?鐃?
2814 { if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
2815 //SetContent(Item.ThreadItem);
2816 InsertBrowserTab(Item.ThreadItem);
2817 end;}
2818 AddMessageList(ATitle + ' [鐃緒申鐃?鐃?]', nil, gmiSAD);
2819 PlaySound('NoChange');
2820 Screen.Cursor := crDefault;
2821 end else if Item.State = gdsAbort then begin
2822 //鐃緒申鐃?
2823 AddMessageList(ATitle + ' [鐃緒申鐃?]', nil, gmiSAD);
2824 end else if Item.State = gdsError then begin
2825 //鐃?鐃緒申鐃?
2826 s := Item.ErrText;
2827 if s <> '' then
2828 s := ':' + s;
2829 AddMessageList(ATitle + ' [鐃?鐃緒申鐃?(' + IntToStr(Item.ResponseCode) + s + ')]', nil, gmiNG);
2830 // if Item.ResponseCode = 302 then
2831 // AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG);
2832 PlaySound('Error');
2833 end;
2834 finally
2835 Item.Free;
2836 Dec(FWorkCount);
2837 if FWorkCount < 0 then FWorkCount := 0;
2838 if FWorkCount = 0 then begin
2839 try
2840 Animate.Active := False;
2841 except
2842 Screen.Cursor := crDefault;
2843 end;
2844 end;
2845
2846 end;
2847 end;
2848
2849 procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer);
2850 begin
2851 // SetProgressValue(Number, 0, AWorkCountMax);
2852 // ProgressBar.Visible := True;
2853 ProgressBar.Position := 0;
2854 ProgressBar.Max := AWorkCountMax;
2855 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申';
2856 FDownloadMax := AWorkCountMax;
2857 end;
2858
2859 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
2860 begin
2861 // ProgressBar.Visible := False;
2862 ProgressBar.Position := 0;
2863 // SetProgressValue(Number, 0);
2864 if FDownloadMax <> 0 then
2865 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
2866 end;
2867
2868 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
2869 begin
2870 ProgressBar.Position := AWorkCount;
2871 // SetProgressValue(Number, AWorkCount);
2872 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
2873 end;
2874
2875 {
2876 procedure TGikoForm.SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
2877 var
2878 Component: TComponent;
2879 begin
2880 Component := FindComponent('ProgressBar' + IntToStr(Number + 1));
2881 if Component <> nil then begin
2882 if not (Component is TProgressBar) then Exit;
2883 if Max <> -1 then
2884 TProgressBar(Component).Max := Max;
2885 TProgressBar(Component).Position := Value;
2886 end;
2887 end;
2888 }
2889
2890 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
2891 var
2892 ListItem: TListItem;
2893 begin
2894 MessageListView.Items.BeginUpdate;
2895 try
2896 ListItem := MessageListView.Items.Add;
2897 ListItem.Caption := ACaption;
2898 ListItem.Data := AObject;
2899 ListItem.MakeVisible(False);
2900 case Icon of
2901 gmiOK: ListItem.ImageIndex := 0;
2902 gmiSAD: ListItem.ImageIndex := 1;
2903 gmiNG: ListItem.ImageIndex := 2;
2904 gmiWhat: ListItem.ImageIndex := 3;
2905 end;
2906 finally
2907 MessageListView.Items.EndUpdate;
2908 end;
2909 end;
2910
2911 {procedure TGikoForm.BrowserTabChange(Sender: TObject);
2912 var
2913 index: Integer;
2914 ThreadItem: TThreadItem;
2915 begin
2916 ThreadItem := GetActiveContent;
2917 if ThreadItem <> nil then begin
2918 SetContent(ThreadItem);
2919 end;
2920 end;}
2921
2922 procedure TGikoForm.InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);
2923 var
2924 i: Integer;
2925 // OldIndex: Integer;
2926 begin
2927 if ThreadItem.IsLogFile then begin
2928 for i := 0 to BrowserTab.Tabs.Count - 1 do begin
2929 if TObject(BrowserTab.Tabs.Objects[i]) is TThreadItem then begin
2930 if TThreadItem(BrowserTab.Tabs.Objects[i]) = ThreadItem then begin
2931 if ActiveTab then begin
2932 //OldIndex := BrowserTab.TabIndex;
2933 BrowserTab.TabIndex := i;
2934 // if OldIndex <> i then
2935 BrowserTab.OnChange(nil);
2936 BrowserTab.Repaint;
2937 end;
2938 Exit;
2939 end;
2940 end;
2941 end;
2942 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
2943 BrowserTab.Tabs.Insert(0, GikoSys.GetShortName(ThreadItem.Title, 20));
2944 BrowserTab.Tabs.Objects[0] := ThreadItem;
2945 if ActiveTab then
2946 BrowserTab.TabIndex := 0;
2947 end else begin
2948 i := BrowserTab.Tabs.Add(GikoSys.GetShortName(ThreadItem.Title, 20));
2949 BrowserTab.Tabs.Objects[i] := ThreadItem;
2950 if ActiveTab then
2951 BrowserTab.TabIndex := i;
2952 end;
2953 if ActiveTab then begin
2954 BrowserTab.OnChange(nil);
2955 BrowserNullTab := nil;
2956 end;