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.183 - (show annotations) (download) (as text)
Sat Dec 13 09:19:24 2003 UTC (20 years, 4 months ago) by h677
Branch: MAIN
Changes since 1.182: +120 -87 lines
File MIME type: text/x-pascal
●用SSL障害のため強制ログインモード追加(2003/12/21まで)

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