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.281 - (show annotations) (download) (as text)
Mon Apr 12 13:06:51 2004 UTC (20 years ago) by yoffy
Branch: MAIN
Changes since 1.280: +13 -13 lines
File MIME type: text/x-pascal
・ブラウザ最大化時のスレリストの展開は、スレリスト(≠カテゴリリスト)を表示する時のみにしてみた。

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