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.219 - (show annotations) (download) (as text)
Thu Mar 18 14:16:57 2004 UTC (20 years, 1 month ago) by h677
Branch: MAIN
Changes since 1.218: +43 -14 lines
File MIME type: text/x-pascal
メモリ関係の整理

1 unit Giko;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils, Math,
8 {$IF Defined(DELPRO) }
9 SHDocVw,
10 MSHTML,
11 {$ELSE}
12 SHDocVw_TLB,
13 MSHTML_TLB,
14 {$IFEND}
15 IdHTTP, ActiveX, ActnList, ImgList,
16 ToolWin, Buttons, {Clipbrd,} {HTTPApp,} YofUtils, IdComponent,
17 ShellAPI, UrlMon, Tabs, IdGlobal, StrUtils,
18 CommCtrl, IniFiles, Dialogs,
19 GikoSystem, GikoUtil, Setting, BoardGroup, ThreadControl, ItemDownload,
20 Editor, RoundData, RoundName, KeySetting, GikoPanel, Favorite, FavoriteAdd,
21 FavoriteArrange, AddressHistory, Preview, HTMLDocumentEvent, Kotehan,
22 HintWindow, GikoCoolBar, GikoListView, ToolBarSetting, ToolBarUtil,
23 IndividualAbon, Search, ExternalBoardManager, ExternalBoardPlugInMain,
24 StdActns, GikoXMLDoc;
25
26 type
27 TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite);
28
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 try
1746 ClearLinkBar;
1747 except
1748 end;
1749
1750 // FDownload.Free;
1751 try
1752 //SetActiveList(nil);
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 for i := FavoriteTreeView.Items.Count - 1 downto 0 do begin
1765 TObject(FavoriteTreeView.Items.Item[i].Data).Free;
1766 FavoriteTreeView.Items.Item[i].Free;
1767 end;
1768 FavoriteTreeView.Items.Clear;
1769 except
1770 end;
1771
1772 try
1773 if FavoriteDM <> nil then
1774 FavoriteDM.Free;
1775 FavoriteDM := nil;
1776 if AddressHistoryDM <> nil then
1777 AddressHistoryDM.Free;
1778 AddressHistoryDM := nil;
1779 except
1780 end;
1781 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1782 try
1783 RoundList.SaveRoundFile;
1784 except
1785 end;
1786
1787 try
1788
1789 RoundList.Clear;
1790 except
1791 end;
1792 try
1793 RoundList.Free;
1794 except
1795 end;
1796
1797
1798 try
1799 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1800 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1801 CabinetSelectPopupMenu.Items[ i ].Free;
1802 CabinetMenu.Items[ i ].Free;
1803 end;
1804 end;
1805 except
1806 end;
1807 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1808 // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1809 // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1810 try
1811 for i := 0 to Length( BBSs ) - 1 do begin
1812 if BBSs[ i ] <> nil then
1813 BBSs[ i ].Free;
1814 BBSs[ i ] := nil;
1815 end;
1816 except
1817 end;
1818
1819 try
1820 for i := 0 to Length( BoardPlugIns ) - 1 do begin
1821 if BoardPlugIns[ i ] <> nil then
1822 BoardPlugIns[ i ].Free;
1823 BoardPlugIns[ i ] := nil;
1824 end;
1825 except
1826 end;
1827
1828
1829 try
1830 //Hint鐃?鐃緒申
1831 if FHint <> nil then begin
1832 FHint.ReleaseHandle;
1833 FHint.Free;
1834 FHint := nil;
1835 end;
1836 //Preview鐃?鐃緒申
1837 if TPreviewBrowser <> nil then begin
1838 FPreviewBrowser.Free;
1839 FPreviewBrowser := nil;
1840 end;
1841 except
1842 end;
1843
1844
1845 end;
1846
1847 procedure TGikoForm.FormDestroy(Sender: TObject);
1848 begin
1849 ;
1850 end;
1851
1852 //鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1853 procedure TGikoForm.FormClose(Sender: TObject; var Action: TCloseAction);
1854 begin
1855 // ListCoolBar.WindowProc := nil;
1856 // BrowserCoolBar.WindowProc := nil;
1857 // MainCoolBar.WindowProc := nil;
1858 Application.Terminate;
1859 Action := caFree;
1860 // Application.UnhookMainWindow(Hook);
1861 end;
1862
1863 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1864 procedure TGikoForm.CabinetPanelHide(Sender: TObject);
1865 begin
1866 CabinetVisibleAction.Execute;
1867 // CabinetPanelVisible(false);
1868 end;
1869
1870 procedure TGikoForm.ReloadBBS;
1871 var
1872 i : Integer;
1873 item : TBBSMenuItem;
1874 begin
1875 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1876 NotSelectTabCloseAction.Execute;
1877 if BrowserTab.Tabs.Count >= 1 then
1878 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1879 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1880 //FHistoryList.Clear;
1881 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1882 TreeView.Items.Clear;
1883
1884 //BBS鐃?鐃緒申
1885 try
1886 for i := Length( BBSs ) - 1 downto 0 do begin
1887 if BBSs[ i ] <> nil then
1888 BBSs[ i ].Free;
1889 BBSs[ i ] := nil;
1890 end;
1891 except
1892 end;
1893
1894 ActiveList := nil;
1895
1896 FTreeType := gttNone;
1897
1898 GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1899 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1900 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1901 try
1902 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1903 CabinetSelectPopupMenu.Items[ i ].Free;
1904 CabinetMenu.Items[ i ].Free;
1905 end;
1906 except
1907 end;
1908 end;
1909 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1910 for i := Length( BBSs ) - 1 downto 0 do begin
1911 try
1912 item := TBBSMenuItem.Create( PopupMenu );
1913 item.Caption := BBSs[ i ].Title;
1914 item.Data := BBSs[ i ];
1915 item.OnClick := BBSMenuItemOnClick;
1916 CabinetSelectPopupMenu.Items.Insert( 0, item );
1917 item := TBBSMenuItem.Create( PopupMenu );
1918 item.Caption := BBSs[ i ].Title;
1919 item.Data := BBSs[ i ];
1920 item.OnClick := BBSMenuItemOnClick;
1921 CabinetMenu.Insert( 0, item );
1922 except
1923 end;
1924 end;
1925 ShowBBSTree( BBSs[ 0 ] );
1926
1927 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1928 SaveHistory;
1929 {
1930 try
1931 for i := FHistoryList.Count - 1 downto 0 do begin
1932 TFavoriteThreadItem( FHistoryList[ i ] ).Free;
1933 FHistoryList.Delete(i);
1934 end;
1935
1936 except
1937 end;
1938 FHistoryList.Clear;
1939 FHistoryList.Capacity := FHistoryList.Count;
1940 }
1941 ClearHistory;
1942 LoadHistory;
1943
1944 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1945 // FFavorite := TFavorite.Create(FavoriteTreeView);
1946 FavoriteTreeView.Items.Clear;
1947 FavoriteDM.SetFavTreeView(FavoriteTreeView);
1948 FavoriteDM.ReadFavorite;
1949 SetLinkBar;
1950
1951 end;
1952
1953 //鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1954 procedure TGikoForm.SetBoardTreeNode(
1955 inBBS : TBBS
1956 );
1957 var
1958 i, j, k: integer;
1959 Root: TTreeNode;
1960 CategoryNode: TTreeNode;
1961 BoardNode: TTreeNode;
1962 Category: TCategory;
1963 Board: TBoard;
1964 begin
1965 // 鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1966 FActiveBBS := inBBS;
1967 TreeView.Items.BeginUpdate;
1968 TreeView.Items.Clear;
1969 try
1970 if not inBBS.IsBoardFileRead then
1971 GikoSys.ReadBoardFile( inBBS );
1972 try
1973 if SplashWindow <> nil then
1974 SplashWindow.ProgressBar.Max := inBBS.Count;
1975 except
1976 end;
1977
1978 Root := TreeView.Items.Add( nil, inBBS.Title );
1979 Root.ImageIndex := ITEM_ICON_2CH1;
1980 Root.SelectedIndex := ITEM_ICON_2CH2;
1981 Root.Data := inBBS;
1982 for i := 0 to inBBS.Count - 1 do begin
1983 Category := TCategory(inBBS.Items[i]);
1984 CategoryNode := TreeView.Items.AddChild(Root, Category.Title);
1985 CategoryNode.Data := Category;
1986 CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
1987 CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
1988
1989 for j := 0 to Category.Count - 1 do begin
1990 Board := TBoard(Category.Items[j]);
1991 Board.BeginUpdate;
1992 BoardNode := TreeView.Items.AddChild(CategoryNode, Board.Title);
1993 BoardNode.Data := Board;
1994 //if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then begin
1995 if not Board.IsLogFile then begin
1996 BoardNode.ImageIndex := ITEM_ICON_BOARD_NOSUBJECT;
1997 BoardNode.SelectedIndex := ITEM_ICON_BOARD_NOSUBJECT;
1998 end else begin
1999 BoardNode.ImageIndex := ITEM_ICON_BOARD1;
2000 BoardNode.SelectedIndex := ITEM_ICON_BOARD2;
2001 for k := 0 to Board.Count - 1 do begin
2002 if Board.Items[ k ].IsLogFile then begin
2003 BoardNode.ImageIndex := ITEM_ICON_BOARD_LOG;
2004 BoardNode.SelectedIndex := ITEM_ICON_BOARD_LOG;
2005
2006 Break;
2007 end;
2008 end;
2009 end;
2010 Board.EndUpdate;
2011 end;
2012
2013 CategoryNode.Expanded := Category.NodeExpand;
2014
2015 if SplashWindow <> nil then begin
2016 SplashWindow.ProgressBar.StepIt;
2017 Application.ProcessMessages;
2018 end;
2019 end;
2020 finally
2021 TreeView.Items.EndUpdate;
2022 end;
2023 end;
2024
2025 function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS): Integer;
2026 const
2027 COLUMN: array[0..0] of string = ('鐃?鐃?鐃?鐃緒申鐃緒申');
2028 var
2029 ListColumn: TListColumn;
2030 i: Integer;
2031 begin
2032 ListView.Items.BeginUpdate;
2033 try
2034 Screen.Cursor := crHourGlass;
2035
2036 ListView.Columns.Clear;
2037 for i := 0 to Length(COLUMN) - 1 do begin
2038 ListColumn := ListView.Columns.Add;
2039 ListColumn.Caption := COLUMN[i];
2040 ListColumn.Width := GikoSys.Setting.BBSColumnWidth[i];
2041 end;
2042
2043 ListView.Items.Count := 0;
2044 ListView.Items.Clear;
2045 ListView.Items.Count := ABBS2ch.Count;
2046
2047 // UpFolderAction.Enabled := False;
2048 // AllItemAction.Enabled := False;
2049 // LogItemAction.Enabled := False;
2050 // NewItemAction.Enabled := False;
2051 // SelectItemAction.Enabled := False;
2052 // ListDownloadToolButton.Enabled := False;
2053 // BoardReservToolButton.Enabled := False;
2054 // ListThreadDownloadToolButton.Enabled := False;
2055
2056 ListNameLabel.Caption := ABBS2ch.Title;
2057 FolderImage.Picture := nil;
2058 ItemIcon16.GetBitmap(1, FolderImage.Picture.Bitmap);
2059
2060 FSortIndex := 0;
2061 FSortOrder := False;
2062 ListViewColumnClick(nil, ListView.Column[0]);
2063
2064 Result := ABBS2ch.Count;
2065 finally
2066 Screen.Cursor := crDefault;
2067 ListView.Items.EndUpdate;
2068 end;
2069 end;
2070
2071 function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
2072 const
2073 COLUMN: array[0..2] of string = ('鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
2074 var
2075 ListColumn: TListColumn;
2076 i: Integer;
2077 begin
2078 ListView.Items.BeginUpdate;
2079 try
2080 Screen.Cursor := crHourGlass;
2081
2082 ListView.Columns.Clear;
2083 for i := 0 to Length(COLUMN) - 1 do begin
2084 ListColumn := ListView.Columns.Add;
2085 ListColumn.Caption := COLUMN[i];
2086 ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[i];
2087 end;
2088
2089 ListView.Items.Count := 0;
2090 ListView.Items.Clear;
2091 ListView.Items.Count := Category.Count;
2092
2093 // UpFolderAction.Enabled := True;
2094 // AllItemAction.Enabled := False;
2095 // LogItemAction.Enabled := False;
2096 // NewItemAction.Enabled := False;
2097 // SelectItemAction.Enabled := False;
2098 // ListDownloadToolButton.Enabled := False;
2099 // BoardReservToolButton.Enabled := False;
2100 // ListThreadDownloadToolButton.Enabled := False;
2101
2102 ListNameLabel.Caption := Category.Title;
2103 FolderImage.Picture := nil;
2104 ItemIcon16.GetBitmap(3, FolderImage.Picture.Bitmap);
2105
2106 FSortIndex := 0;
2107 FSortOrder := False;
2108 ListViewColumnClick(nil, ListView.Column[0]);
2109
2110 Result := Category.Count;
2111 finally
2112 Screen.Cursor := crDefault;
2113 ListView.Items.EndUpdate;
2114 end;
2115 end;
2116
2117 function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
2118 const
2119 COLUMN: array[0..7] of string = ('鐃?鐃緒申鐃?鐃?鐃緒申', '鐃?鐃?鐃緒申鐃?', '鐃緒申鐃緒申', '鐃?鐃緒申',
2120 '鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申', '鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
2121 COLUMN_ALIGNMENT: array[0..7] of TAlignment = (taLeftJustify, taRightJustify,
2122 taRightJustify, taRightJustify,
2123 taRightJustify, taLeftJustify,
2124 taLeftJustify, taLeftJustify);
2125 //No, 鐃?鐃緒申鐃?鐃?鐃緒申, 鐃?鐃?鐃緒申鐃?, 鐃緒申鐃緒申鐃?鐃緒申, 鐃緒申鐃緒申鐃緒申鐃緒申
2126 var
2127 ListColumn: TListColumn;
2128 i: Integer;
2129 begin
2130 ListView.Items.BeginUpdate;
2131 try
2132 Screen.Cursor := crHourGlass;
2133
2134 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2135 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2136 if ListView.Columns.Count <> (High( COLUMN ) - Low( COLUMN ) + 1) then
2137 begin
2138 ListView.Columns.Clear;
2139 for i := 0 to Length(COLUMN) - 1 do begin
2140 ListColumn := ListView.Columns.Add;
2141 ListColumn.Caption := COLUMN[i];
2142 ListColumn.Width := GikoSys.Setting.BoardColumnWidth[i];
2143 ListColumn.Alignment := COLUMN_ALIGNMENT[i];
2144 end;
2145 end;
2146
2147 ListView.Items.Count := 0;
2148 ListView.Items.Clear;
2149
2150 case GikoForm.ViewType of
2151 gvtAll: ListView.Items.Count := Board.Count;
2152 gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
2153 gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
2154 gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
2155 end;
2156
2157 ListNameLabel.Caption := Board.Title;
2158 FolderImage.Picture := nil;
2159 ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
2160
2161 FSortIndex := 0;
2162 FSortOrder := False;
2163 ListViewColumnClick(nil, ListView.Column[0]);
2164
2165 Result := Board.Count;
2166 finally
2167 Screen.Cursor := crDefault;
2168 ListView.Items.EndUpdate;
2169 end;
2170 end;
2171
2172 procedure TGikoForm.TreeViewChange(Sender: TObject; Node: TTreeNode);
2173 var
2174 i: Integer;
2175 begin
2176 if FTreeType = gttHistory then begin
2177 if Node <> nil then
2178 if TObject( Node.Data ) is TFavoriteThreadItem then
2179 if GetActiveContent <> TFavoriteThreadItem( Node.Data ).Item then
2180 FavoriteClick( Node );
2181 Exit;
2182 end;
2183
2184 ListView.Selected := nil;
2185 ListView.Items.Count := 0;
2186 ListView.Items.Clear;
2187 // ListView.Columns.Clear;
2188
2189 Caption := CAPTION_NAME;
2190 //Application.Title := CAPTION_NAME;
2191
2192
2193 if GetActiveList is TBBS then begin
2194 for i := 0 to ListView.Columns.Count - 1 do
2195 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
2196 end else if GetActiveList is TCategory then begin
2197 for i := 0 to ListView.Columns.Count - 1 do
2198 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
2199 end else if GetActiveList is TBoard then begin
2200 for i := 0 to ListView.Columns.Count - 1 do
2201 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
2202 end;
2203
2204 if TObject(Node.Data) is TBBS then begin
2205 SetActiveList(Node.data);
2206 end else if TObject(Node.Data) is TCategory then begin
2207 SetActiveList(Node.data);
2208 end else if TObject(Node.Data) is TBoard then begin
2209 if not TBoard(Node.Data).IsThreadDatRead then begin
2210 Screen.Cursor := crHourGlass;
2211 try
2212 GikoSys.ReadSubjectFile(TBoard(Node.Data));
2213 finally
2214 Screen.Cursor := crDefault;
2215 end;
2216 end;
2217 SetActiveList(Node.data);
2218 end;
2219 end;
2220
2221 procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
2222 var
2223 // FileName: string;
2224 // DateTime: TDateTime;
2225 BoardCnt: Integer;
2226 BBS: TBBS;
2227 Category: TCategory;
2228 Board: TBoard;
2229 ThreadItem: TThreadItem;
2230 RepStr: string;
2231 ActivListObj : TObject;
2232 begin
2233 ActivListObj := ActiveList;
2234 if ActivListObj is TBBS then begin
2235 BBS := TBBS(ActivListObj);
2236
2237 ListView.StateImages := nil;
2238
2239 if BBS = nil then Exit;
2240 if BBS.Count <= 0 then Exit;
2241 if Item = nil then Exit;
2242 if Item.Index > BBS.Count then Exit;
2243 if ListView.Items.Count = 0 then Exit;
2244
2245 if not (BBS.Items[Item.index] is TCategory) then Exit;
2246 Category := TCategory(BBS.Items[Item.index]);
2247
2248 if Category = nil then Exit;
2249
2250 if ListNumberVisibleAction.Checked then
2251 Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
2252 else
2253 Item.Caption := Category.Title;
2254
2255 Item.ImageIndex := ITEM_ICON_CATEGORY1;
2256 Item.Data := Category;
2257 end else if ActivListObj is TCategory then begin
2258 Category := TCategory(ActivListObj);
2259
2260 ListView.StateImages := nil;
2261
2262 if Category = nil then Exit;
2263 if Category.Count <= 0 then Exit;
2264 if Item = nil then Exit;
2265 if Item.Index >= Category.Count then Exit;
2266 if ListView.Items.Count = 0 then Exit;
2267
2268 if not (Category.Items[Item.Index] is TBoard) then Exit;
2269 Board := TBoard(Category.Items[Item.Index]);
2270
2271 if Board = nil then Exit;
2272
2273 if ListNumberVisibleAction.Checked then
2274 Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
2275 else
2276 Item.Caption := Board.Title;
2277
2278 if Item.SubItems.Count <> 2 then begin
2279 Item.SubItems.Clear;
2280 Item.SubItems.Add('');
2281 Item.SubItems.Add('');
2282 end;
2283
2284 Item.ImageIndex := ITEM_ICON_BOARD1;
2285
2286 if Board.Round then
2287 Item.SubItems[0] := Board.RoundName // '鐃?鐃緒申'
2288 else
2289 Item.SubItems[0] := '';
2290
2291 if Board.RoundDate = ZERO_DATE then begin
2292 Item.SubItems[1] := '';
2293 end else
2294 Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
2295 Item.Data := Board;
2296 end else if ActivListObj is TBoard then begin
2297 Board := TBoard(ActivListObj);
2298
2299 if GikoSys.Setting.ListIconVisible then
2300 ListView.StateImages := StateIconImageList
2301 else
2302 ListView.StateImages := nil;
2303
2304 case GikoForm.ViewType of
2305 gvtAll: BoardCnt := Board.Count;
2306 gvtLog: BoardCnt := Board.GetLogThreadCount;
2307 gvtNew: BoardCnt := Board.GetNewThreadCount;
2308 gvtUser: BoardCnt := Board.GetUserThreadCount;
2309 else
2310 BoardCnt := 0;
2311 end;
2312
2313 // if Board = nil then Exit;
2314 if BoardCnt <= 0 then Exit;
2315 if Item = nil then Exit;
2316 if Item.Index > BoardCnt then Exit;
2317 if ListView.Items.Count = 0 then Exit;
2318
2319 // if not (Board.Items[Item.Index] is TThreadItem) then Exit;
2320
2321 ThreadItem := nil;
2322 case GikoForm.ViewType of
2323 gvtAll: ThreadItem := TThreadItem(Board.Items[Item.Index]);
2324 gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
2325 gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
2326 gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
2327 end;
2328
2329 if ThreadItem = nil then Exit;
2330
2331 // if ListNumberVisibleAction.Checked then
2332 // RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title
2333 // else
2334 RepStr := ThreadItem.Title;
2335 RepStr := CustomStringReplace(RepStr, '&lt;', '<' );
2336 RepStr := CustomStringReplace(RepStr, '&gt;', '>' );
2337 RepStr := CustomStringReplace(RepStr, '&quot;', '"' );
2338 RepStr := CustomStringReplace(RepStr, '&amp;', '&' );
2339 //RepStr := StringReplace(RepStr, '鐃緒申鐃?', ',', [rfReplaceAll]);
2340
2341 if Item.SubItems.Count <> 7 then begin
2342 Item.SubItems.Clear;
2343 Item.SubItems.Add('');
2344 Item.SubItems.Add('');
2345 Item.SubItems.Add('');
2346 Item.SubItems.Add('');
2347 Item.SubItems.Add('');
2348 Item.SubItems.Add('');
2349 Item.SubItems.Add('');
2350 end;
2351
2352 if ListNumberVisibleAction.Checked then
2353 Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
2354 else
2355 Item.Caption := RepStr;
2356
2357 case ThreadItem.AgeSage of
2358 gasNone: Item.StateIndex := -1;
2359 gasNew: Item.StateIndex := 0;
2360 gasAge: Item.StateIndex := 1;
2361 gasSage: Item.StateIndex := 2;
2362 end;
2363
2364 if ThreadItem.IsLogFile then begin
2365 Item.ImageIndex := ITEM_ICON_THREADLOG1;
2366 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2367 Item.SubItems[1] := IntToStr(ThreadItem.Count);
2368 if ThreadItem.NewResCount = 0 then
2369 Item.SubItems[2] := ''
2370 else
2371 Item.SubItems[2] := IntToStr(ThreadItem.NewResCount);
2372 Item.SubItems[3] := '';
2373 if ThreadItem.Round then
2374 Item.SubItems[4] := ThreadItem.RoundName
2375 else
2376 Item.SubItems[4] := '';
2377 if ThreadItem.RoundDate = ZERO_DATE then begin
2378 Item.SubItems[5] := '';
2379 end else
2380 Item.SubItems[5] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
2381 if ThreadItem.NewArrival then
2382 Item.ImageIndex := ITEM_ICON_THREADNEW1;
2383 if ThreadItem.CreateDate = ZERO_DATE then begin
2384 Item.SubItems[6] := '';
2385 end else
2386 Item.SubItems[6] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
2387
2388 end else begin
2389 Item.ImageIndex := ITEM_ICON_THREAD1;
2390 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2391 Item.SubItems[1] := '';
2392 Item.SubItems[2] := '';
2393 Item.SubItems[3] := '';
2394 Item.SubItems[4] := '';
2395 Item.SubItems[5] := '';
2396 if not GikoSys.Setting.CreationTimeLogs then
2397 if ThreadItem.CreateDate = ZERO_DATE then
2398 Item.SubItems[6] := ''
2399 else
2400 Item.SubItems[6] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
2401
2402 end;
2403
2404 Item.Data := ThreadItem;
2405 end;
2406 end;
2407
2408 procedure TGikoForm.ListViewDataFind(Sender: TObject; Find: TItemFind;
2409 const FindString: String; const FindPosition: TPoint; FindData: Pointer;
2410 StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
2411 var Index: Integer);
2412 begin
2413
2414 //
2415 end;
2416
2417 procedure TGikoForm.ListViewDataHint(Sender: TObject; StartIndex,
2418 EndIndex: Integer);
2419 begin
2420 //
2421 end;
2422
2423 procedure TGikoForm.ListViewDataStateChange(Sender: TObject; StartIndex,
2424 EndIndex: Integer; OldState, NewState: TItemStates);
2425 begin
2426 //
2427 end;
2428
2429 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
2430 var
2431 p: TPoint;
2432 s: string;
2433 tmp2: string;
2434 URL: string;
2435 ATitle: Boolean;
2436
2437 threadItem : TThreadItem;
2438 board : TBoard;
2439 Protocol, Host, Path, Document, Port, Bookmark: string;
2440
2441 //wkInt: Integer;
2442 wkIntSt: Integer;
2443 wkIntTo: Integer;
2444 ActiveFileName: string;
2445 e: IHTMLElement;
2446 Ext: string;
2447 buf: string;
2448 PathRec: TPathRec;
2449 begin
2450 try
2451 try
2452 if (FActiveContent <> nil) and (Assigned(Browser.Document)) then begin
2453 if LowerCase(OleVariant(IHTMLDocument2(Browser.Document)).charset) <> 'shift_jis' then
2454 OleVariant(IHTMLDocument2(Browser.Document)).charset := 'shift_jis';
2455 end;
2456 except
2457 end;
2458 finally
2459 end;
2460 if PreviewTimer.Enabled then
2461 PreviewTimer.Enabled := False;
2462 Application.CancelHint;
2463 if GetActiveContent <> nil then
2464 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2465 else
2466 ActiveFileName := '';
2467
2468 StatusBar.Panels[1].Text := Text;
2469
2470 if FHint <> nil then begin
2471 FHint.ReleaseHandle;
2472 FHint.ClearAllRes;
2473 end;
2474 if FPreviewBrowser <> nil then
2475 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2476
2477 if not GikoSys.Setting.UnActivePopup then
2478 if not GikoForm.Active then
2479 Exit;
2480
2481 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2482 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2483
2484 s := '';
2485 Ext := AnsiLowerCase(ExtractFileExt(Text));
2486 if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
2487 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2488 if FPreviewBrowser = nil then begin
2489 FPreviewBrowser := TPreviewBrowser.Create(Self);
2490 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2491 TOleControl(FPreviewBrowser).Parent := nil;
2492 end;
2493 FPreviewBrowser.Navigate('about:blank');//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2494 FPreviewURL := Text;
2495 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2496 PreviewTimer.Enabled := True;
2497 end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
2498 if Pos('mailto:', Text) = 1 then begin
2499 s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
2500 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2501 GetCursorPos(p);
2502 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2503 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2504 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2505 if (Assigned(e)) then begin
2506 tmp2 := GikoSys.ZenToHan(e.Get_outerText);
2507 if (GikoSys.IsNumeric(tmp2)) then begin
2508 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2509 wkIntSt := StrToInt(tmp2);
2510 wkIntTo := StrToInt(tmp2);
2511 //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2512 FHint.PopupType := gptThread;
2513 SetResPopupText(GetActiveContent, wkIntSt, wkIntTo, False, False);
2514 end else begin
2515 FHint.PopupType := gptRaw;
2516 FHint.Caption := s;
2517 end;
2518 end;
2519 end else begin
2520 URL := Text;
2521
2522 if Pos('about:blank..', URL) = 1 then begin
2523 threadItem := GetActiveContent;
2524 if AnsiPos('http://jbbs.shitaraba.com/', threadItem.URL) <> 0 then begin
2525 URL := Copy(threadItem.URL, 1, LastDelimiter('/',threadItem.URL));
2526 Gikosys.GetPopupResNumber(Text,PathRec.FSt,PathRec.FTo);
2527 if ( PathRec.FSt <> 0 ) and ( PathRec.FTo <> 0 ) then
2528 buf := IntToStr(PathRec.FSt) + '-' + IntToStr(PathRec.FTo)
2529 else if( PathRec.FSt <> 0 ) then
2530 buf := IntToStr(PathRec.FSt);
2531 end else if AnsiPos('machi.to/bbs/', threadItem.URL) <> 0 then begin
2532 URL := threaditem.URL;
2533 buf := Copy(Text,AnsiPos('&st=',Text),Length(Text)-AnsiPos('&st=',Text) + 1);
2534 end else begin
2535
2536 URL := Copy(threadItem.URL, 1, LastDelimiter('/',threadItem.URL));
2537 buf := Copy(Text,LastDelimiter('/',Text)+1,Length(Text)-LastDelimiter('/',Text));
2538 end;
2539 URL := URL + buf;
2540 end;
2541 PathRec := Gikosys.Parse2chURL2(URL);
2542 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2543 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2544
2545 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
2546
2547 URL := GikoSys.GetBrowsableThreadURL( URL );
2548 wkIntSt := PathRec.FSt;
2549 wkIntTo := PathRec.FTo;
2550
2551 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2552 wkIntSt := 1;
2553 wkIntTo := 1;
2554 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2555 wkIntSt := wkIntTo;
2556 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2557 wkIntTo := wkIntSt;
2558 end else if wkIntSt > wkIntTo then begin
2559 //wkInt := wkIntTo;
2560 wkIntTo := wkIntSt;
2561 wkIntSt := wkIntTo;
2562 end;
2563 //if wkIntSt = 0 then
2564 // wkIntSt := 1;
2565 //if wkINtTo = 0 then
2566 // wkIntTo := 1;
2567 //if PathRec.FFirst then
2568 // wkIntSt := 1;
2569 if PathRec.FStBegin then
2570 wkIntSt := 1;
2571 if PathRec.FToEnd then
2572 wkIntTo := 9999;
2573
2574 //ATitle := ActiveFileName <> PathRec.FKey;
2575 if GetActiveContent.URL = URL then
2576 ATitle := false
2577 else
2578 ATitle := true;
2579
2580 threadItem := BBSsFindThreadFromURL( URL );
2581
2582 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2583 board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2584 if board <> nil then
2585 threadItem := board.Find( PathRec.FKey + '.dat' );
2586
2587 end;
2588
2589 if threadItem <> nil then begin
2590 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2591 FHint.PopupType := gptThread;
2592 SetResPopupText( threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2593 end;
2594 end;
2595 end;
2596
2597 //if s <> '' then
2598 // ShowTextPopup(s);
2599 if FHint.PopupType = gptRaw then begin
2600 if FHint.Caption <> '' then
2601 ShowTextPopup;
2602 end else begin
2603 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
2604 ShowTextPopup;
2605 end;
2606 end;
2607 end;
2608
2609 procedure TGikoForm.BrowserTitleChange(Sender: TObject;
2610 const Text: WideString);
2611 var
2612 Title: string;
2613 begin
2614 if (Text = BLANK_HTML) or (Text = GikoSys.GetHtmlTempFileName) then
2615 Title := CAPTION_NAME
2616 else
2617 Title := CAPTION_NAME + ' - [' + Text + ']';
2618 Caption := Title;
2619 //Application.Title := Title;
2620 end;
2621
2622 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2623 var
2624 SysMenu: HMenu;
2625 //SysMenuApp: HMenu;
2626 begin
2627 FEnabledCloseButton := Enabled;
2628 SysMenu := GetSystemMenu(Handle, False);
2629 //SysMenuApp := GetSystemMenu(Application.Handle, False);
2630
2631 if Enabled then begin
2632 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2633 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2634 end else begin
2635 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2636 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2637 end;
2638
2639 DrawMenuBar(Handle);
2640 //DrawMenuBar(Application.Handle);
2641 end;
2642
2643 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2644 var AllowChange: Boolean);
2645 begin
2646 if FTreeType = gtt2ch then
2647 FSortIndex := -1;
2648 end;
2649
2650 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2651 Shift: TShiftState);
2652 begin
2653 if Key = VK_BACK then begin
2654 // UpFolderButtonClick(Sender);
2655 end else if Key = VK_SPACE then begin
2656 // ListClick;
2657 end else if Key = VK_RETURN then begin
2658 ListDoubleClick;
2659 end;
2660 end;
2661
2662 function TGikoForm.GetHttpState: Boolean;
2663 begin
2664 Result := FHttpState;
2665 end;
2666
2667 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2668 Column: TListColumn);
2669 var
2670 i: Integer;
2671 wkBBS: TBBS;
2672 wkCategory: TCategory;
2673 wkBoard: TBoard;
2674 begin
2675 if FSortIndex = Column.Index then
2676 FSortOrder := not FSortOrder
2677 else
2678 FSortOrder := False;
2679
2680 for i := 0 to ListView.Columns.Count - 1 do
2681 ListView.Column[i].ImageIndex := -1;
2682 if FSortOrder then
2683 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT1
2684 else
2685 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT2;
2686
2687 Sort.SortNoFlag := ListNumberVisibleAction.Checked;
2688
2689 //if TObject(TreeView.Selected.Data) is TBBS then begin
2690 if TObject( FActiveList ) is TBBS then begin
2691 //wkBBS := TBBS(TreeView.Selected.Data);
2692 wkBBS := TBBS( FActiveList );
2693 Sort.SortOrder := FSortOrder;
2694 Sort.SortIndex := Column.Index;
2695 wkBBS.Sort(CategorySortProc);
2696 ListView.Refresh;
2697 //end else if TObject(TreeView.Selected.Data) is TCategory then begin
2698 end else if TObject( FActiveList ) is TCategory then begin
2699 //wkCategory := TCategory(TreeView.Selected.Data);
2700 wkCategory := TCategory( FActiveList );
2701 Sort.SortOrder := FSortOrder;
2702 Sort.SortIndex := Column.Index;
2703 wkCategory.Sort(BoardSortProc);
2704 ListView.Refresh;
2705 //end else if TObject(TreeView.Selected.Data) is TBoard then begin
2706 end else if TObject( FActiveList ) is TBoard then begin
2707 //wkBoard := TBoard(TreeView.Selected.Data);
2708 wkBoard := TBoard( FActiveList );
2709 Sort.SortOrder := FSortOrder;
2710 Sort.SortIndex := Column.Index;
2711 wkBoard.Sort(ThreadItemSortProc);
2712 ListView.Refresh;
2713 end;
2714 FSortIndex := Column.Index;
2715 end;
2716
2717 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2718 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2719 var
2720 ARect: TRect;
2721 begin
2722 DefaultDraw := True;
2723 Exit;
2724 DefaultDraw := False;
2725 if (cdsSelected in State) or (cdsHot in State) then begin
2726 Sender.Canvas.Brush.Color := clHighlight;
2727 Sender.Canvas.Font.Color := clHighlightText;
2728 end else begin
2729 Sender.Canvas.Brush.Color := clBtnFace;
2730 Sender.Canvas.Font.Color := clBtnText;
2731 end;
2732 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2733 Sender.Canvas.FillRect(ARect);
2734 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2735 end;
2736
2737 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2738 var
2739 Nodes: TTreeNodes;
2740 i: integer;
2741 begin
2742 Nodes := TreeView.Items;
2743
2744 for i := 0 to Nodes.Count - 1 do begin
2745 if Nodes.Item[i].Data = Data then begin
2746 Result := Nodes.Item[i];
2747 Exit;
2748 end;
2749 end;
2750 Result := nil;
2751 end;
2752
2753 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2754 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2755 Headers: OleVariant; var Cancel: WordBool);
2756 var
2757 sNo: string;
2758 p: TPoint;
2759 const
2760 kMenuName: string = 'menu:';
2761 begin
2762
2763 if Pos(kMenuName, URL) <> 0 then begin
2764 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2765
2766 if not GikoSys.IsNumeric(sNo) then Exit;
2767
2768 Cancel := True;
2769 GetCursorpos(p);
2770 KokoPopupMenu.Tag := StrToInt(sNo);
2771 KokoPopupMenu.Popup(p.x, p.y);
2772 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2773 Cancel := not GikoSys.Setting.OpenMailer;
2774 end;
2775
2776 end;
2777
2778 procedure TGikoForm.ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
2779 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
2780 var DefaultDraw: Boolean);
2781 var
2782 ThreadItem: TThreadItem;
2783 begin
2784 //
2785 // TListView(Sender).Canvas.Font.Style := [];
2786 if TObject(Item.Data) is TThreadItem then begin
2787 ThreadItem := TThreadItem(Item.Data);
2788 if ( FUseOddResOddColor ) and ( ThreadItem.Count <> 0 ) and ( ThreadItem.AllResCount <> ThreadItem.Count) then begin
2789 ListView.Canvas.Brush.Color := FOddColor;
2790 end else begin
2791 ListView.Canvas.Brush.Color := FListViewBackGroundColor;
2792 end;
2793 // if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then
2794 if ThreadItem.UnRead then
2795 TListView(Sender).Canvas.Font.Style := [fsBold];
2796 end;
2797 end;
2798
2799 procedure TGikoForm.AppFormDeactivate(Sender: TObject);
2800 begin
2801 if Application.Terminated then
2802 Exit;
2803 if PreviewTimer.Enabled then
2804 PreviewTimer.Enabled := False;
2805 //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2806 if FHint <> nil then begin
2807 FHint.ReleaseHandle;
2808 FHint.ClearAllRes;
2809 // FHint.Free;
2810 // FHint := nil;
2811 end;
2812 if FPreviewBrowser <> nil then
2813 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2814
2815 end;
2816
2817 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2818 const ARect: TRect; var DefaultDraw: Boolean);
2819 var
2820 NodeRect: TRect;
2821 i, j: Integer;
2822 IsBoardNode: Boolean;
2823 Cnt: Integer;
2824 CntText: string;
2825 TextWidth: Integer;
2826 TextRect: TRect;
2827 Board: TBoard;
2828 Category: TCategory;
2829 Bitmap: TBitmap;
2830 NodeWidth: Integer;
2831 begin
2832 DefaultDraw := True;
2833
2834 if FTreeType = gttHistory then Exit;
2835
2836 TreeView.Canvas.Font.Color := clBlue;
2837 IsBoardNode := False;
2838 for i := 0 to TreeView.Items.Count - 1 do begin
2839 Cnt := 0;
2840 if not TreeView.Items[i].IsVisible then
2841 continue;
2842
2843 if TObject(TreeView.Items[i].Data) is TCategory then begin
2844 if TreeView.Items[i].Expanded then
2845 continue;
2846
2847 IsBoardNode := False;
2848 Category := TCategory(TreeView.Items[i].Data);
2849 for j := 0 to Category.Count - 1 do begin
2850 Board := Category.Items[j];
2851 if Board <> nil then begin
2852 if Board.UnRead > 0 then begin
2853 Cnt := 1;
2854 Break;
2855 end;
2856 end;
2857 end;
2858 if Cnt <> 1 then
2859 continue;
2860 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2861 IsBoardNode := True;
2862 Board := TBoard(TreeView.Items[i].Data);
2863 Cnt := Board.UnRead;
2864 if Cnt <= 0 then
2865 continue;
2866 end else
2867 continue;
2868
2869 Bitmap := TBitmap.Create;
2870 try
2871 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2872 Bitmap.Canvas.Font.Style := [fsBold];
2873 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2874 finally
2875 Bitmap.Free;
2876 end;
2877
2878 NodeRect := TreeView.Items[i].DisplayRect(True);
2879
2880 if IsBoardNode then
2881 CntText := '(' + IntToStr(Cnt) + ')'
2882 else if Cnt = 1 then
2883 CntText := '(+)';
2884
2885
2886 TextWidth := TreeView.Canvas.TextWidth(CntText);
2887
2888 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2889 NodeRect.Top,
2890 NodeRect.Left + NodeWidth + TextWidth + 8,
2891 NodeRect.Bottom);
2892 DrawText(TreeView.Canvas.Handle,
2893 PChar(CntText),
2894 -1,
2895 TextRect,
2896 DT_SINGLELINE or DT_VCENTER);
2897 end;
2898 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2899 end;
2900
2901 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2902 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2903 var
2904 Board: TBoard;
2905 Category: TCategory;
2906 i: Integer;
2907 begin
2908 DefaultDraw := True;
2909
2910 if FTreeType = gttHistory then Exit;
2911
2912 TreeView.Canvas.Font.Style := [];
2913 if Node <> nil then begin
2914 if TObject(Node.Data) is TCategory then begin
2915 Category := TCategory(Node.Data);
2916 for i := 0 to Category.Count - 1 do begin
2917 Board := Category.Items[i];
2918 if Board <> nil then begin