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