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.155 - (show annotations) (download) (as text)
Thu Nov 27 14:08:43 2003 UTC (20 years, 4 months ago) by yoffy
Branch: MAIN
Changes since 1.154: +29 -28 lines
File MIME type: text/x-pascal
・メニューの開放に Delete ではなく Free を使うように。
 ※詳しくは TMenuItem のヘルプ参照

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