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