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.221 - (show annotations) (download) (as text)
Mon Mar 22 12:44:49 2004 UTC (20 years, 1 month ago) by h677
Branch: MAIN
Changes since 1.220: +6 -6 lines
File MIME type: text/x-pascal
ClearLinkBarを弄ってたの元に戻し忘れたので。

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