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.186 - (show annotations) (download) (as text)
Sun Dec 14 15:55:52 2003 UTC (20 years, 4 months ago) by h677
Branch: MAIN
Changes since 1.185: +58 -34 lines
File MIME type: text/x-pascal
証明書切れ問題用強制ログインモード作成

1 unit Giko;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils, Math,
8 {$IF Defined(DELPRO) }
9 SHDocVw,
10 MSHTML,
11 {$ELSE}
12 SHDocVw_TLB,
13 MSHTML_TLB,
14 {$IFEND}
15 IdHTTP, ActiveX, ActnList, ImgList,
16 ToolWin, Buttons, {Clipbrd,} {HTTPApp,} YofUtils, IdComponent,
17 ShellAPI, UrlMon, Tabs, IdGlobal, StrUtils,
18 CommCtrl, IniFiles, Dialogs,
19 GikoSystem, GikoUtil, Setting, BoardGroup, ThreadControl, ItemDownload,
20 Editor, RoundData, RoundName, KeySetting, GikoPanel, Favorite, FavoriteAdd,
21 FavoriteArrange, AddressHistory, Preview, HTMLDocumentEvent, Kotehan,
22 HintWindow, GikoCoolBar, GikoListView, ToolBarSetting, ToolBarUtil,
23 IndividualAbon, Search, ExternalBoardManager, ExternalBoardPlugInMain,
24 StdActns, GikoXMLDoc;
25
26 type
27 TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite);
28
29 TGikoForm = class(TForm)
30 StatusBar: TStatusBar;
31 MainPanel: TPanel;
32 ClientPanel: TPanel;
33 TreeSplitter: TSplitter;
34 CabinetPanel: TPanel;
35 TreeView: TTreeView;
36 ThreadMainPanel: TPanel;
37 ListSplitter: TSplitter;
38 ViewPanel: TPanel;
39 ListView: TGikoListView;
40 ThreadPanel: TPanel;
41 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 //
945 procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
946 protected
947 procedure CreateParams(var Params: TCreateParams); override;
948 procedure WndProc(var Message: TMessage); override;
949 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
950 procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
951 procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
952 public
953 { Public 鐃緒申鐃緒申 }
954 // FDownload: TDownload;
955 FControlThread: TThreadControl;
956 procedure MoveToURL(URL: string);
957 procedure InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);
958 procedure ReloadBBS;
959 function GetHttpState: Boolean;
960 procedure SetEnabledCloseButton(Enabled: Boolean);
961 function GetTreeNode(Data: TObject): TTreeNode;
962 procedure AppFormDeactivate(Sender: TObject);
963 // procedure CabinetPanelVisible(PanelVisible: Boolean);
964 procedure ListViewAllSelect;
965
966 property ListStyle: TViewStyle read FListStyle write FListStyle;
967 property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
968 property ViewType: TGikoViewType read FViewType write FViewType;
969
970 property NameCookie: string read FNameCookie write FNameCookie;
971 property MailCookie: string read FMailCookie write FMailCookie;
972
973 procedure SetContent(ThreadItem: TThreadItem);
974 function GetActiveContent: TThreadItem;
975 function GetActiveList: TObject;
976
977 property ActiveList: TObject read GetActiveList write SetActiveList;
978 // property LastRoundTime: TDateTime read FLastRoundTime write FLastRoundTime;
979
980 procedure SetListViewType(AViewType: TGikoViewType); overload;
981 procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
982 procedure DownloadContent(ThreadItem: TThreadItem);
983 procedure DownloadList(Board: TBoard);
984 procedure PlaySound(SoundEventName: string);
985
986 function AddHistory( FavItem: TFavoriteThreadItem ): Boolean;
987 procedure DeleteHistory( threadItem: TThreadItem );
988 procedure ClearHistory;
989 procedure SaveHistory;
990 procedure LoadHistory;
991 procedure ShowBBSTree( inBBS : TBBS );
992 procedure ShowHistoryTree;
993 procedure SetHistoryTreeNode;
994 // procedure SelectTreeNode(Item: TObject);
995 procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
996 procedure SetBrowserTabState;
997 // property Favorite: TFavorite read FFavorite write FFavorite;
998 procedure SetToolBarPopup;
999 procedure ShowFavoriteAddDialog( Item : TObject );
1000 property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
1001 property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
1002 property OddColor : TColor read FOddColor write FOddColor;
1003
1004 published
1005 property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
1006 end;
1007
1008 TFavoriteMenuItem = class(TMenuItem)
1009 private
1010 FData : Pointer;
1011 public
1012 property Data: Pointer read FData write FData;
1013 end;
1014
1015 TBBSMenuItem = class(TMenuItem)
1016 private
1017 FData : Pointer;
1018 public
1019 property Data: Pointer read FData write FData;
1020 end;
1021
1022 TLinkToolButton = class(TToolButton)
1023 private
1024 FData : Pointer;
1025 public
1026 property Data: Pointer read FData write FData;
1027 end;
1028
1029 var
1030 GikoForm: TGikoForm;
1031
1032 implementation
1033
1034 uses
1035 About, Option, Round, Splash, Sort, ListSelect,
1036 NewBoard, MojuUtils,Clipbrd;
1037
1038 const
1039 CAPTION_NAME: string = '鐃?鐃?鐃?鐃?';
1040 BLANK_HTML: string = 'about:blank';
1041 SELECTCOMBOBOX_NAME: string = ''; // '鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申';
1042 SELECTCOMBOBOX_COLOR: TColor = clWindow;
1043 //D&D鐃緒申鐃?
1044 DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel)
1045 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1046 ITEM_ICON_2CH1 = 0; //2ch鐃?鐃?鐃?鐃緒申
1047 ITEM_ICON_2CH2 = 1; //2ch鐃?鐃?鐃?鐃緒申
1048 ITEM_ICON_CATEGORY1 = 2; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1049 ITEM_ICON_CATEGORY2 = 3; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1050 ITEM_ICON_BOARD_NOSUBJECT = 3; //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1051 ITEM_ICON_BOARD1 = 4; //鐃緒申鐃?鐃?鐃?鐃緒申
1052 ITEM_ICON_BOARD2 = 5; //鐃緒申鐃?鐃?鐃?鐃緒申
1053 ITEM_ICON_THREADLOG1 = 6; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1054 ITEM_ICON_THREADLOG2 = 7; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1055 ITEM_ICON_THREAD1 = 8; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1056 ITEM_ICON_THREAD2 = 9; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
1057 ITEM_ICON_THREADNEW1 = 10; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1058 ITEM_ICON_THREADNEW2 = 11; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1059 ITEM_ICON_SORT1 = 12; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
1060 ITEM_ICON_SORT2 = 13; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
1061 ITEM_ICON_BOARD_LOG = 17; //鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1062 ITEM_ICON_BOARD_NEW = 18; //鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1063
1064 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1065 TOOL_ICON_HEIGHT_MAX = 16; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1066 TOOL_ICON_HEIGHT_MIN = 17; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1067 TOOL_ICON_HEIGHT_NORMAL = 18; //鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1068 TOOL_ICON_WIDTH_MAX = 19; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1069 TOOL_ICON_WIDTH_MIN = 20; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1070 TOOL_ICON_WIDTH_NORMAL = 21; //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1071
1072 TOOL_ICON_FAV_FOLDER = 30; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申
1073 TOOL_ICON_FAV_BOARD = 31; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1074 TOOL_ICON_FAV_THREAD = 32; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1075
1076 HTML_FILE_NAME = 'temp_preview.html';
1077
1078 {$R *.DFM}
1079
1080 procedure TGikoForm.CreateParams(var Params: TCreateParams);
1081 begin
1082 inherited;
1083 if FormStyle in [fsNormal, fsStayOnTop] then begin
1084 if BorderStyle in [bsSingle, bsSizeable] then begin
1085 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
1086 Params.WndParent := 0;
1087 end;
1088 end;
1089 end;
1090
1091 procedure TGikoForm.FormCreate(Sender: TObject);
1092 const
1093 TVS_NOTOOLTIPS = $0080;
1094 var
1095 FileName: string;
1096 Style: DWORD;
1097 msg: string;
1098 i: Integer;
1099 wp: TWindowPlacement;
1100 s: string;
1101 item : TBBSMenuItem;
1102 begin
1103 {$IFDEF DEBUG}
1104 AllocConsole;
1105 Writeln('============================================================');
1106 Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
1107 Writeln('');
1108 Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
1109 Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
1110 Writeln('============================================================');
1111 {$ENDIF}
1112 Application.OnDeactivate := AppFormDeactivate;
1113 Self.OnDeactivate := AppFormDeactivate;
1114 Application.HookMainWindow(Hook);
1115
1116 FTreeType := gttNone;
1117
1118 FSearchDialog := nil;
1119
1120 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1121 Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
1122
1123
1124 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1125 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1126
1127 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1128 InitializeBoardPlugIns;
1129
1130 EnabledCloseButton := True;
1131
1132
1133 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1134 RoundList := TRoundList.Create;
1135 RoundList.LoadRoundBoardFile;
1136
1137 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申(ReadFavorite 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1138 GikoSys.ReadBoardFile;
1139
1140 RoundList.LoadRoundThreadFile;
1141
1142 if RoundList.OldFileRead or ( RoundList.Count[grtItem] > 0 ) then
1143 GikoSys.ReadBoardFile;
1144
1145 // SetBoardTreeNode; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1146 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1147 for i := Length( BBSs ) - 1 downto 0 do begin
1148 try
1149 item := TBBSMenuItem.Create( PopupMenu );
1150 item.Caption := BBSs[ i ].Title;
1151 item.Data := BBSs[ i ];
1152 item.OnClick := BBSMenuItemOnClick;
1153 CabinetSelectPopupMenu.Items.Insert( 0, item );
1154 item := TBBSMenuItem.Create( PopupMenu );
1155 item.Caption := BBSs[ i ].Title;
1156 item.Data := BBSs[ i ];
1157 item.OnClick := BBSMenuItemOnClick;
1158 CabinetMenu.Insert( 0, item );
1159 except
1160 end;
1161 end;
1162
1163
1164 // 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?(LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1165 FHistoryList := TList.Create;
1166
1167 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1168 LoadHistory;
1169
1170 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1171 // FFavorite := TFavorite.Create(FavoriteTreeView);
1172 FavoriteDM.SetFavTreeView(FavoriteTreeView);
1173 FavoriteDM.ReadFavorite;
1174
1175 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1176 ListView.ViewStyle := GikoSys.Setting.ListStyle;
1177
1178 //鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1179 // MainCoolBar.Top := 0;
1180 // MainCoolBar.Left := 0;
1181
1182 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
1183 AnimePanel.Top := 0;
1184 AnimePanel.Left := 0;
1185
1186 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1187
1188 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1189 CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
1190
1191 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1192 MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
1193 MsgBarVisibleActionExecute(nil);
1194 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
1195
1196 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1197 StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
1198 StatusBarVisibleActionExecute(nil);
1199
1200 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1201 TreeView.Items.BeginUpdate;
1202 FavoriteTreeView.Items.BeginUpdate;
1203 ListView.Items.BeginUpdate;
1204 try
1205 TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1206 TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1207 TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1208 TreeView.Color := GikoSys.Setting.CabinetBackColor;
1209
1210 FavoriteTreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1211 FavoriteTreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1212 FavoriteTreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1213 FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
1214
1215 ListView.Font.Name := GikoSys.Setting.ListFontName;
1216 ListView.Font.Size := GikoSys.Setting.ListFontSize;
1217 ListView.Font.Color := GikoSys.Setting.ListFontColor;
1218 //ListView.Color := GikoSys.Setting.ListBackColor;
1219 ListViewBackGroundColor := GikoSys.Setting.ListBackColor;
1220 FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
1221 FOddColor := GikoSys.Setting.OddColor;
1222
1223 finally
1224 TreeView.Items.EndUpdate;
1225 FavoriteTreeView.Items.EndUpdate;
1226 ListView.Items.EndUpdate;
1227 end;
1228 //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
1229 ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
1230
1231 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1232 BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1233 BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1234 FDragWFirst := false;
1235
1236 // TreeView.TopItem.Expanded := True; //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1237 // TreeView.Selected := TreeView.Items[0]; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1238 SetContent(nil); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1239
1240 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1241 wp.length := sizeof(wp);
1242 wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1243 wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1244 wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1245 wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1246 wp.showCmd := SW_HIDE;
1247 SetWindowPlacement(Handle, @wp);
1248
1249 // SetBounds(GikoSys.Setting.WindowLeft, GikoSys.Setting.WindowTop,
1250 // GikoSys.Setting.WindowWidth, GikoSys.Setting.WindowHeight);
1251 if GikoSys.Setting.WindowMax then
1252 WindowState := wsMaximized;
1253
1254 //鐃?鐃?鐃?鐃?鐃緒申
1255 try
1256 FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1257 if FileExists(FileName) then
1258 Animate.FileName := FileName;
1259 except
1260 end;
1261
1262 //鐃?鐃?鐃?鐃?
1263 FNameCookie := '';
1264 FMailCookie := '';
1265
1266 //鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1267 AllItemAction.Checked := True;
1268 AllResAction.Checked := True;
1269
1270 //TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申
1271 Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
1272 Style := Style or TVS_NOTOOLTIPS;
1273 SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
1274
1275 // 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1276 TreeView.Align := alClient;
1277 FavoriteTreeView.Align := alClient;
1278 FavoriteTreeView.Visible := False;
1279
1280 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1281 // FBrowserSizeFlag := False;
1282 // FBrowserSizeHeight := ViewPanel.Height;
1283
1284 FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1285 FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1286
1287 ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1288 ArrangeAction.Execute;
1289
1290 if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1291 case GikoSys.Setting.ListWidthState of
1292 glsMax: begin
1293 ViewPanel.Width := 1;
1294 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1295 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1296 end;
1297 glsMin: begin
1298 ViewPanel.Width := GikoSys.Setting.ListWidth;
1299 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1300 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1301 end;
1302 else begin
1303 ViewPanel.Width := GikoSys.Setting.ListWidth;
1304 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1305 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1306 end;
1307 end;
1308 end else begin
1309 case GikoSys.Setting.ListHeightState of
1310 glsMax: begin
1311 ViewPanel.Height := 1;
1312 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1313 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1314 end;
1315 glsMin: begin
1316 ViewPanel.Height := GikoSys.Setting.ListHeight;
1317 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1318 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1319 end;
1320 else begin
1321 ViewPanel.Height := GikoSys.Setting.ListHeight;
1322 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1323 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1324 end;
1325 end;
1326 end;
1327
1328 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1329 // ProgressBar.Visible := False;
1330 ProgressBar.Parent := StatusBar;
1331 ProgressBar.Top := 2;
1332 ProgressBar.Left := 0;
1333 ProgressBar.Width := StatusBar.Panels[0].Width;
1334 ProgressBar.Height := StatusBar.Height - 2;
1335 ProgressBar.Position := 0;
1336
1337 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1338 FControlThread := TThreadControl.Create(True);
1339 FControlThread.MaxThreadCount := 1;
1340 FControlThread.Resume;
1341 FControlThread.OnDownloadEnd := DownloadEnd;
1342 FControlThread.OnDownloadMsg := DownloadMsg;
1343 FControlThread.OnWork := Work;
1344 FControlThread.OnWorkBegin := WorkBegin;
1345 FControlThread.OnWorkEnd := WorkEnd;
1346 // ProgressPanel.Width := FControlThread.MaxThreadCount * 12;
1347
1348 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1349 SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1350
1351 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1352 SetBrowserTabState;
1353
1354 BrowserBoardNameLabel.Caption := '';
1355 BrowserNameLabel.Caption := '';
1356 FWorkCount := 0;
1357
1358 FTabHintIndex := -1;
1359
1360 //鐃緒申鐃緒申鐃?鐃?鐃?
1361 SetLinkBar;
1362
1363 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
1364 SetMenuFont;
1365
1366 //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1367 ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1368 BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1369
1370 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1371 ReadToolBarSetting(ActionList, StdToolBar);
1372 ReadToolBarSetting(ActionList, ListToolBar);
1373 try
1374 for i := ListToolBar.ControlCount - 1 downto 0 do
1375 begin
1376 if ListToolBar.Controls[ i ].Action = SelectItemAction then
1377 begin
1378 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1379 if (i + 1) < ListToolBar.ControlCount then
1380 if ListToolBar.Controls[ i + 1 ] is TToolButton then
1381 if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
1382 ListToolBar.Controls[ i + 1 ].Visible := False;
1383
1384 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申
1385 ListToolBar.Controls[ i ].Visible := False;
1386 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申
1387 SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
1388 SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
1389 SelectComboBox.Parent := ListToolBar;
1390 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1391 SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
1392 SelectComboBoxSplitter.Parent := ListToolBar;
1393
1394 break;
1395 end;
1396 end;
1397 except
1398 end;
1399 ReadToolBarSetting(ActionList, BrowserToolBar);
1400 SetToolBarPopup;
1401 OnlyAHundredRes.Checked := GikoSys.Setting.OnlyAHundredRes;
1402 //鐃?鐃?鐃緒申鐃?鐃?鐃?
1403 AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1404
1405 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1406
1407 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1408 if not FileExists(GikoSys.GetBoardFileName) then begin
1409 msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1410 + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1411 + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1412 MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1413 NewBoardAction.Execute;
1414 end;
1415
1416 //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1417 GikoSys.LoadKeySetting(ActionList);
1418
1419 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1420 // FLastRoundTime := 0;
1421
1422 //ResHint
1423 FHint := TResPopup.Create(Self);
1424
1425 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1426 CabinetVisible( False );
1427 if GikoSys.Setting.CabinetVisible then begin
1428 i := CabinetSelectPopupMenu.Items.Count - 1;
1429 if GikoSys.Setting.CabinetIndex = i - 1 then
1430 CabinetHistoryAction.Execute
1431 else if GikoSys.Setting.CabinetIndex = i then
1432 CabinetFavoriteAction.Execute
1433 else begin
1434 if GikoSys.Setting.CabinetIndex < Length( BBSs ) then
1435 ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] );
1436 CabinetBBSAction.Execute;
1437 end;
1438 end else begin
1439 ShowBBSTree( BBSs[ 0 ] );
1440 end;
1441
1442 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1443 if GikoSys.Setting.AutoLogin then
1444 LoginAction.Execute;
1445
1446 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1447 for i := 1 to ParamCount do begin
1448 MoveToURL(ParamStr(i));
1449 end;
1450 // SetStdToolBar;
1451 // SetLinkBar;
1452
1453 s := GikoSys.FAbon.NGwordname;
1454 StatusBar.Panels[2].Text := s;
1455 StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
1456 StatusBarResize(Sender);
1457 end;
1458
1459 //
1460 //
1461 //
1462 procedure TGikoForm.FormShow(Sender: TObject);
1463 var
1464 i: Integer;
1465 CoolSet: TCoolSet;
1466 begin
1467 ShowWindow(Application.Handle, SW_HIDE);
1468
1469 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1470 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1471 StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1472 StdToolBarVisibleActionExecute( nil );
1473 AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1474 AddressBarVisibleActionExecute( nil );
1475 LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1476 LinkBarVisibleActionExecute( nil );
1477 ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1478 ListToolBarVisibleActionExecute( nil );
1479 ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1480 ListNameBarVisibleActionExecute( nil );
1481 BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1482 BrowserToolBarVisibleActionExecute( nil );
1483 BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1484 BrowserNameBarVisibleActionExecute( nil );
1485
1486 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1487 BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1488 BrowserTabVisibleActionExecute(nil);
1489
1490 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1491 BrowserTabTopAction.Checked := True;
1492 BrowserTabTopActionExecute(nil);
1493 end else begin
1494 BrowserTabBottomAction.Checked := True;
1495 BrowserTabBottomActionExecute(nil);
1496 end;
1497
1498 if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1499 BrowserTabTabStyleAction.Checked := True;
1500 BrowserTabTabStyleActionExecute(nil);
1501 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1502 BrowserTabButtonStyleAction.Checked := True;
1503 BrowserTabButtonStyleActionExecute(nil);
1504 end else begin
1505 BrowserTabFlatStyleAction.Checked := True;
1506 BrowserTabFlatStyleActionExecute(nil);
1507 end;
1508
1509
1510 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1511 MainCoolBar.Bands.BeginUpdate;
1512 try
1513 for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1514 CoolSet := GikoSys.Setting.MainCoolSet[i];
1515 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1516 Continue;
1517 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1518 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1519 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1520 end;
1521 finally
1522 MainCoolBar.Bands.EndUpdate;
1523 end;
1524
1525 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1526 ListCoolBar.Bands.BeginUpdate;
1527 try
1528 for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1529 CoolSet := GikoSys.Setting.ListCoolSet[i];
1530 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1531 Continue;
1532 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1533 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1534 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1535 end;
1536 finally
1537 ListCoolBar.Bands.EndUpdate;
1538 end;
1539
1540 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1541 BrowserCoolBar.Bands.BeginUpdate;
1542 try
1543 for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1544 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1545 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1546 Continue;
1547 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1548 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1549 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1550 end;
1551 finally
1552 BrowserCoolBar.Bands.EndUpdate;
1553 end;
1554
1555 end;
1556 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1557 var
1558 i: Integer;
1559 CoolSet: TCoolSet;
1560 wp: TWindowPlacement;
1561 begin
1562 if ( GikoSys.Setting.ShowDialogForEnd ) and
1563 (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1564 CanClose := false;
1565 Exit;
1566 end else begin
1567 CanClose := True;
1568 end;
1569 // Application.OnDeactivate := nil;
1570 // Self.OnDeactivate := nil;
1571
1572 //column鐃緒申
1573 if GetActiveList is TBBS then begin
1574 for i := 0 to ListView.Columns.Count - 1 do
1575 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
1576 end else if GetActiveList is TCategory then begin
1577 for i := 0 to ListView.Columns.Count - 1 do
1578 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
1579 end else if GetActiveList is TBoard then begin
1580 for i := 0 to ListView.Columns.Count - 1 do
1581 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1582 end;
1583
1584 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1585 wp.length := sizeof(wp);
1586 GetWindowPlacement(Handle, @wp);
1587 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1588 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1589 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1590 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1591 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1592
1593 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1594 GikoSys.Setting.CabinetVisible := CabinetVisibleAction.Checked;
1595 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1596 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1597 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1598 if ArrangeAction.Checked then
1599 GikoSys.Setting.ListOrientation := gloVertical
1600 else
1601 GikoSys.Setting.ListOrientation := gloHorizontal;
1602 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1603
1604 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1605 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1606 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1607 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1608 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1609 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1610 end;
1611 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1612 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1613 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1614 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1615 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1616 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1617 end;
1618 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1619 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1620 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1621 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1622 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1623 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1624 end;
1625
1626 GikoSys.Setting.WriteWindowSettingFile;
1627 GikoSys.Setting.WriteNameMailSettingFile;
1628
1629 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1630 try
1631 FavoriteDM.WriteFavorite;
1632 except
1633 end;
1634 // Favorite.Free;
1635
1636 try
1637 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1638 NotSelectTabCloseAction.Execute;
1639 if BrowserTab.Tabs.Count >= 1 then begin
1640 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1641 end;
1642 except
1643 end;
1644
1645 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1646 try
1647 SaveHistory;
1648 except
1649 end;
1650
1651 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1652 try
1653 FHistoryList.Free;
1654 except
1655 end;
1656
1657 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1658 try
1659 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1660 except
1661 end;
1662
1663 try
1664 FControlThread.Terminate;
1665 except
1666 end;
1667
1668
1669
1670 // FDownload.Free;
1671 try
1672 //SetActiveList(nil);
1673 except
1674 end;
1675
1676 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1677 //Sleep(10);
1678 Application.ProcessMessages;
1679 try
1680 TreeView.Items.Clear;
1681 except
1682 end;
1683
1684 try
1685 if FavoriteDM <> nil then
1686 FavoriteDM.Free;
1687 FavoriteDM := nil;
1688 if AddressHistoryDM <> nil then
1689 AddressHistoryDM.Free;
1690 AddressHistoryDM := nil;
1691 except
1692 end;
1693 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1694 try
1695 RoundList.SaveRoundFile;
1696 except
1697 end;
1698
1699 try
1700 RoundList.Clear;
1701 except
1702 end;
1703 try
1704 //RoundList.Free;
1705 except
1706 end;
1707
1708 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1709 // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1710 // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1711 try
1712 for i := 0 to Length( BBSs ) - 1 do begin
1713 if BBSs[ i ] <> nil then
1714 BBSs[ i ].Free;
1715 BBSs[ i ] := nil;
1716 end;
1717 except
1718 end;
1719
1720 try
1721 for i := 0 to Length( BoardPlugIns ) - 1 do begin
1722 if BoardPlugIns[ i ] <> nil then
1723 BoardPlugIns[ i ].Free;
1724 BoardPlugIns[ i ] := nil;
1725 end;
1726 except
1727 end;
1728
1729 try
1730 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1731 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1732 CabinetSelectPopupMenu.Items[ i ].Free;
1733 CabinetMenu.Items[ i ].Free;
1734 end;
1735 end;
1736 except
1737 end;
1738
1739
1740 try
1741 //Hint鐃?鐃緒申
1742 if FHint <> nil then begin
1743 FHint.ReleaseHandle;
1744 FHint.Free;
1745 FHint := nil;
1746 end;
1747 //Preview鐃?鐃緒申
1748 if TPreviewBrowser <> nil then begin
1749 FPreviewBrowser.Free;
1750 FPreviewBrowser := nil;
1751 end;
1752 except
1753 end;
1754 end;
1755
1756 procedure TGikoForm.FormDestroy(Sender: TObject);
1757 begin
1758 ;
1759 end;
1760
1761 //鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1762 procedure TGikoForm.FormClose(Sender: TObject; var Action: TCloseAction);
1763 begin
1764 // ListCoolBar.WindowProc := nil;
1765 // BrowserCoolBar.WindowProc := nil;
1766 // MainCoolBar.WindowProc := nil;
1767 Application.Terminate;
1768 Action := caFree;
1769 // Application.UnhookMainWindow(Hook);
1770 end;
1771
1772 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1773 procedure TGikoForm.CabinetPanelHide(Sender: TObject);
1774 begin
1775 CabinetVisibleAction.Execute;
1776 // CabinetPanelVisible(false);
1777 end;
1778
1779 procedure TGikoForm.ReloadBBS;
1780 var
1781 i : Integer;
1782 item : TBBSMenuItem;
1783 begin
1784 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1785 NotSelectTabCloseAction.Execute;
1786 if BrowserTab.Tabs.Count >= 1 then
1787 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1788 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1789 //FHistoryList.Clear;
1790 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1791 TreeView.Items.Clear;
1792
1793 //BBS鐃?鐃緒申
1794 try
1795 for i := Length( BBSs ) - 1 downto 0 do begin
1796 if BBSs[ i ] <> nil then
1797 BBSs[ i ].Free;
1798 BBSs[ i ] := nil;
1799 end;
1800 except
1801 end;
1802
1803 ActiveList := nil;
1804
1805 FTreeType := gttNone;
1806
1807 GikoSys.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1808 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1809 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1810 try
1811 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1812 CabinetSelectPopupMenu.Items[ i ].Free;
1813 CabinetMenu.Items[ i ].Free;
1814 end;
1815 except
1816 end;
1817 end;
1818 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1819 for i := Length( BBSs ) - 1 downto 0 do begin
1820 try
1821 item := TBBSMenuItem.Create( PopupMenu );
1822 item.Caption := BBSs[ i ].Title;
1823 item.Data := BBSs[ i ];
1824 item.OnClick := BBSMenuItemOnClick;
1825 CabinetSelectPopupMenu.Items.Insert( 0, item );
1826 item := TBBSMenuItem.Create( PopupMenu );
1827 item.Caption := BBSs[ i ].Title;
1828 item.Data := BBSs[ i ];
1829 item.OnClick := BBSMenuItemOnClick;
1830 CabinetMenu.Insert( 0, item );
1831 except
1832 end;
1833 end;
1834 ShowBBSTree( BBSs[ 0 ] );
1835
1836 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1837 SaveHistory;
1838 try
1839 for i := FHistoryList.Count - 1 downto 0 do
1840 TFavoriteThreadItem( FHistoryList[ i ] ).Free;
1841 except
1842 end;
1843 FHistoryList.Clear;
1844 LoadHistory;
1845
1846 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1847 // FFavorite := TFavorite.Create(FavoriteTreeView);
1848 FavoriteTreeView.Items.Clear;
1849 FavoriteDM.SetFavTreeView(FavoriteTreeView);
1850 FavoriteDM.ReadFavorite;
1851 SetLinkBar;
1852
1853 end;
1854
1855 //鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1856 procedure TGikoForm.SetBoardTreeNode(
1857 inBBS : TBBS
1858 );
1859 var
1860 i, j, k: integer;
1861 Root: TTreeNode;
1862 CategoryNode: TTreeNode;
1863 BoardNode: TTreeNode;
1864 Category: TCategory;
1865 Board: TBoard;
1866 begin
1867 // 鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1868 FActiveBBS := inBBS;
1869 TreeView.Items.BeginUpdate;
1870 TreeView.Items.Clear;
1871 try
1872 try
1873 if SplashWindow <> nil then
1874 SplashWindow.ProgressBar.Max := BBSs[ 0 ].Count;
1875 except
1876 end;
1877
1878 Root := TreeView.Items.Add( nil, inBBS.Title );
1879 Root.ImageIndex := ITEM_ICON_2CH1;
1880 Root.SelectedIndex := ITEM_ICON_2CH2;
1881 Root.Data := inBBS;
1882 for i := 0 to inBBS.Count - 1 do begin
1883 Category := TCategory(inBBS.Items[i]);
1884 CategoryNode := TreeView.Items.AddChild(Root, Category.Title);
1885 CategoryNode.Data := Category;
1886 CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
1887 CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
1888
1889 for j := 0 to Category.Count - 1 do begin
1890 Board := TBoard(Category.Items[j]);
1891 Board.BeginUpdate;
1892 BoardNode := TreeView.Items.AddChild(CategoryNode, Board.Title);
1893 BoardNode.Data := Board;
1894 //if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then begin
1895 if not Board.IsLogFile then begin
1896 BoardNode.ImageIndex := ITEM_ICON_BOARD_NOSUBJECT;
1897 BoardNode.SelectedIndex := ITEM_ICON_BOARD_NOSUBJECT;
1898 end else begin
1899 BoardNode.ImageIndex := ITEM_ICON_BOARD1;
1900 BoardNode.SelectedIndex := ITEM_ICON_BOARD2;
1901 for k := 0 to Board.Count - 1 do begin
1902 if Board.Items[ k ].IsLogFile then begin
1903 BoardNode.ImageIndex := ITEM_ICON_BOARD_LOG;
1904 BoardNode.SelectedIndex := ITEM_ICON_BOARD_LOG;
1905
1906 Break;
1907 end;
1908 end;
1909 end;
1910 Board.EndUpdate;
1911 end;
1912
1913 CategoryNode.Expanded := Category.NodeExpand;
1914
1915 if SplashWindow <> nil then begin
1916 SplashWindow.ProgressBar.StepIt;
1917 Application.ProcessMessages;
1918 end;
1919 end;
1920 finally
1921 TreeView.Items.EndUpdate;
1922 end;
1923 end;
1924
1925 function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS): Integer;
1926 const
1927 COLUMN: array[0..0] of string = ('鐃?鐃?鐃?鐃緒申鐃緒申');
1928 var
1929 ListColumn: TListColumn;
1930 i: Integer;
1931 begin
1932 ListView.Items.BeginUpdate;
1933 try
1934 Screen.Cursor := crHourGlass;
1935
1936 ListView.Columns.Clear;
1937 for i := 0 to Length(COLUMN) - 1 do begin
1938 ListColumn := ListView.Columns.Add;
1939 ListColumn.Caption := COLUMN[i];
1940 ListColumn.Width := GikoSys.Setting.BBSColumnWidth[i];
1941 end;
1942
1943 ListView.Items.Count := 0;
1944 ListView.Items.Clear;
1945 ListView.Items.Count := ABBS2ch.Count;
1946
1947 // UpFolderAction.Enabled := False;
1948 // AllItemAction.Enabled := False;
1949 // LogItemAction.Enabled := False;
1950 // NewItemAction.Enabled := False;
1951 // SelectItemAction.Enabled := False;
1952 // ListDownloadToolButton.Enabled := False;
1953 // BoardReservToolButton.Enabled := False;
1954 // ListThreadDownloadToolButton.Enabled := False;
1955
1956 ListNameLabel.Caption := ABBS2ch.Title;
1957 FolderImage.Picture := nil;
1958 ItemIcon16.GetBitmap(1, FolderImage.Picture.Bitmap);
1959
1960 FSortIndex := 0;
1961 FSortOrder := False;
1962 ListViewColumnClick(nil, ListView.Column[0]);
1963
1964 Result := ABBS2ch.Count;
1965 finally
1966 Screen.Cursor := crDefault;
1967 ListView.Items.EndUpdate;
1968 end;
1969 end;
1970
1971 function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
1972 const
1973 COLUMN: array[0..2] of string = ('鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1974 var
1975 ListColumn: TListColumn;
1976 i: Integer;
1977 begin
1978 ListView.Items.BeginUpdate;
1979 try
1980 Screen.Cursor := crHourGlass;
1981
1982 ListView.Columns.Clear;
1983 for i := 0 to Length(COLUMN) - 1 do begin
1984 ListColumn := ListView.Columns.Add;
1985 ListColumn.Caption := COLUMN[i];
1986 ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[i];
1987 end;
1988
1989 ListView.Items.Count := 0;
1990 ListView.Items.Clear;
1991 ListView.Items.Count := Category.Count;
1992
1993 // UpFolderAction.Enabled := True;
1994 // AllItemAction.Enabled := False;
1995 // LogItemAction.Enabled := False;
1996 // NewItemAction.Enabled := False;
1997 // SelectItemAction.Enabled := False;
1998 // ListDownloadToolButton.Enabled := False;
1999 // BoardReservToolButton.Enabled := False;
2000 // ListThreadDownloadToolButton.Enabled := False;
2001
2002 ListNameLabel.Caption := Category.Title;
2003 FolderImage.Picture := nil;
2004 ItemIcon16.GetBitmap(3, FolderImage.Picture.Bitmap);
2005
2006 FSortIndex := 0;
2007 FSortOrder := False;
2008 ListViewColumnClick(nil, ListView.Column[0]);
2009
2010 Result := Category.Count;
2011 finally
2012 Screen.Cursor := crDefault;
2013 ListView.Items.EndUpdate;
2014 end;
2015 end;
2016
2017 function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
2018 const
2019 COLUMN: array[0..6] of string = ('鐃?鐃緒申鐃?鐃?鐃緒申', '鐃?鐃?鐃緒申鐃?', '鐃緒申鐃緒申', '鐃?鐃緒申',
2020 '鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
2021 COLUMN_ALIGNMENT: array[0..6] of TAlignment = (taLeftJustify, taRightJustify,
2022 taRightJustify, taRightJustify,
2023 taRightJustify, taLeftJustify,
2024 taLeftJustify);
2025 //No, 鐃?鐃緒申鐃?鐃?鐃緒申, 鐃?鐃?鐃緒申鐃?, 鐃緒申鐃緒申鐃?鐃緒申, 鐃緒申鐃緒申鐃緒申鐃緒申
2026 var
2027 ListColumn: TListColumn;
2028 i: Integer;
2029 begin
2030 ListView.Items.BeginUpdate;
2031 try
2032 Screen.Cursor := crHourGlass;
2033
2034 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2035 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2036 if ListView.Columns.Count <> (High( COLUMN ) - Low( COLUMN ) + 1) then
2037 begin
2038 ListView.Columns.Clear;
2039 for i := 0 to Length(COLUMN) - 1 do begin
2040 ListColumn := ListView.Columns.Add;
2041 ListColumn.Caption := COLUMN[i];
2042 ListColumn.Width := GikoSys.Setting.BoardColumnWidth[i];
2043 ListColumn.Alignment := COLUMN_ALIGNMENT[i];
2044 end;
2045 end;
2046
2047 ListView.Items.Count := 0;
2048 ListView.Items.Clear;
2049
2050 case GikoForm.ViewType of
2051 gvtAll: ListView.Items.Count := Board.Count;
2052 gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
2053 gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
2054 gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
2055 end;
2056
2057 ListNameLabel.Caption := Board.Title;
2058 FolderImage.Picture := nil;
2059 ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
2060
2061 FSortIndex := 0;
2062 FSortOrder := False;
2063 ListViewColumnClick(nil, ListView.Column[0]);
2064
2065 Result := Board.Count;
2066 finally
2067 Screen.Cursor := crDefault;
2068 ListView.Items.EndUpdate;
2069 end;
2070 end;
2071
2072 procedure TGikoForm.TreeViewChange(Sender: TObject; Node: TTreeNode);
2073 var
2074 i: Integer;
2075 begin
2076 if FTreeType = gttHistory then begin
2077 if GetActiveContent <> TFavoriteThreadItem( Node ).Item then
2078 FavoriteClick( Node );
2079 Exit;
2080 end;
2081
2082 ListView.Selected := nil;
2083 ListView.Items.Count := 0;
2084 ListView.Items.Clear;
2085 // ListView.Columns.Clear;
2086
2087 Caption := CAPTION_NAME;
2088 //Application.Title := CAPTION_NAME;
2089
2090
2091 if GetActiveList is TBBS then begin
2092 for i := 0 to ListView.Columns.Count - 1 do
2093 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
2094 end else if GetActiveList is TCategory then begin
2095 for i := 0 to ListView.Columns.Count - 1 do
2096 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
2097 end else if GetActiveList is TBoard then begin
2098 for i := 0 to ListView.Columns.Count - 1 do
2099 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
2100 end;
2101
2102 if TObject(Node.Data) is TBBS then begin
2103 SetActiveList(Node.data);
2104 end else if TObject(Node.Data) is TCategory then begin
2105 SetActiveList(Node.data);
2106 end else if TObject(Node.Data) is TBoard then begin
2107 if not TBoard(Node.Data).IsThreadDatRead then begin
2108 Screen.Cursor := crHourGlass;
2109 try
2110 GikoSys.ReadSubjectFile(TBoard(Node.Data));
2111 finally
2112 Screen.Cursor := crDefault;
2113 end;
2114 end;
2115 SetActiveList(Node.data);
2116 end;
2117 end;
2118
2119 procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
2120 var
2121 // FileName: string;
2122 // DateTime: TDateTime;
2123 BoardCnt: Integer;
2124 BBS: TBBS;
2125 Category: TCategory;
2126 Board: TBoard;
2127 ThreadItem: TThreadItem;
2128 RepStr: string;
2129 ActivListObj : TObject;
2130 begin
2131 ActivListObj := ActiveList;
2132 if ActivListObj is TBBS then begin
2133 BBS := TBBS(ActivListObj);
2134
2135 ListView.StateImages := nil;
2136
2137 if BBS = nil then Exit;
2138 if BBS.Count <= 0 then Exit;
2139 if Item = nil then Exit;
2140 if Item.Index > BBS.Count then Exit;
2141 if ListView.Items.Count = 0 then Exit;
2142
2143 if not (BBS.Items[Item.index] is TCategory) then Exit;
2144 Category := TCategory(BBS.Items[Item.index]);
2145
2146 if Category = nil then Exit;
2147
2148 if ListNumberVisibleAction.Checked then
2149 Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
2150 else
2151 Item.Caption := Category.Title;
2152
2153 Item.ImageIndex := ITEM_ICON_CATEGORY1;
2154 Item.Data := Category;
2155 end else if ActivListObj is TCategory then begin
2156 Category := TCategory(ActivListObj);
2157
2158 ListView.StateImages := nil;
2159
2160 if Category = nil then Exit;
2161 if Category.Count <= 0 then Exit;
2162 if Item = nil then Exit;
2163 if Item.Index >= Category.Count then Exit;
2164 if ListView.Items.Count = 0 then Exit;
2165
2166 if not (Category.Items[Item.Index] is TBoard) then Exit;
2167 Board := TBoard(Category.Items[Item.Index]);
2168
2169 if Board = nil then Exit;
2170
2171 if ListNumberVisibleAction.Checked then
2172 Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
2173 else
2174 Item.Caption := Board.Title;
2175
2176 if Item.SubItems.Count <> 2 then begin
2177 Item.SubItems.Clear;
2178 Item.SubItems.Add('');
2179 Item.SubItems.Add('');
2180 end;
2181
2182 Item.ImageIndex := ITEM_ICON_BOARD1;
2183
2184 if Board.Round then
2185 Item.SubItems[0] := Board.RoundName // '鐃?鐃緒申'
2186 else
2187 Item.SubItems[0] := '';
2188
2189 if Board.RoundDate = ZERO_DATE then begin
2190 Item.SubItems[1] := '';
2191 end else
2192 Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
2193 Item.Data := Board;
2194 end else if ActivListObj is TBoard then begin
2195 Board := TBoard(ActivListObj);
2196
2197 if GikoSys.Setting.ListIconVisible then
2198 ListView.StateImages := StateIconImageList
2199 else
2200 ListView.StateImages := nil;
2201
2202 case GikoForm.ViewType of
2203 gvtAll: BoardCnt := Board.Count;
2204 gvtLog: BoardCnt := Board.GetLogThreadCount;
2205 gvtNew: BoardCnt := Board.GetNewThreadCount;
2206 gvtUser: BoardCnt := Board.GetUserThreadCount;
2207 else
2208 BoardCnt := 0;
2209 end;
2210
2211 // if Board = nil then Exit;
2212 if BoardCnt <= 0 then Exit;
2213 if Item = nil then Exit;
2214 if Item.Index > BoardCnt then Exit;
2215 if ListView.Items.Count = 0 then Exit;
2216
2217 // if not (Board.Items[Item.Index] is TThreadItem) then Exit;
2218
2219 ThreadItem := nil;
2220 case GikoForm.ViewType of
2221 gvtAll: ThreadItem := TThreadItem(Board.Items[Item.Index]);
2222 gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
2223 gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
2224 gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
2225 end;
2226
2227 if ThreadItem = nil then Exit;
2228
2229 // if ListNumberVisibleAction.Checked then
2230 // RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title
2231 // else
2232 RepStr := ThreadItem.Title;
2233 RepStr := CustomStringReplace(RepStr, '&lt;', '<' );
2234 RepStr := CustomStringReplace(RepStr, '&gt;', '>' );
2235 RepStr := CustomStringReplace(RepStr, '&quot;', '"' );
2236 RepStr := CustomStringReplace(RepStr, '&amp', '&' );
2237 //RepStr := StringReplace(RepStr, '鐃緒申鐃?', ',', [rfReplaceAll]);
2238
2239 if Item.SubItems.Count <> 6 then begin
2240 Item.SubItems.Clear;
2241 Item.SubItems.Add('');
2242 Item.SubItems.Add('');
2243 Item.SubItems.Add('');
2244 Item.SubItems.Add('');
2245 Item.SubItems.Add('');
2246 Item.SubItems.Add('');
2247 end;
2248
2249 if ListNumberVisibleAction.Checked then
2250 Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
2251 else
2252 Item.Caption := RepStr;
2253
2254 case ThreadItem.AgeSage of
2255 gasNone: Item.StateIndex := -1;
2256 gasNew: Item.StateIndex := 0;
2257 gasAge: Item.StateIndex := 1;
2258 gasSage: Item.StateIndex := 2;
2259 end;
2260
2261 if ThreadItem.IsLogFile then begin
2262 Item.ImageIndex := ITEM_ICON_THREADLOG1;
2263 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2264 Item.SubItems[1] := IntToStr(ThreadItem.Count);
2265 if ThreadItem.NewResCount = 0 then
2266 Item.SubItems[2] := ''
2267 else
2268 Item.SubItems[2] := IntToStr(ThreadItem.NewResCount);
2269 Item.SubItems[3] := '';
2270 if ThreadItem.Round then
2271 Item.SubItems[4] := ThreadItem.RoundName
2272 else
2273 Item.SubItems[4] := '';
2274 if ThreadItem.RoundDate = ZERO_DATE then begin
2275 Item.SubItems[5] := '';
2276 end else
2277 Item.SubItems[5] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
2278 if ThreadItem.NewArrival then
2279 Item.ImageIndex := ITEM_ICON_THREADNEW1;
2280 end else begin
2281 Item.ImageIndex := ITEM_ICON_THREAD1;
2282 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2283 Item.SubItems[1] := '';
2284 Item.SubItems[2] := '';
2285 Item.SubItems[3] := '';
2286 Item.SubItems[4] := '';
2287 Item.SubItems[5] := '';
2288 end;
2289 Item.Data := ThreadItem;
2290 end;
2291 end;
2292
2293 procedure TGikoForm.ListViewDataFind(Sender: TObject; Find: TItemFind;
2294 const FindString: String; const FindPosition: TPoint; FindData: Pointer;
2295 StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
2296 var Index: Integer);
2297 begin
2298 //
2299 end;
2300
2301 procedure TGikoForm.ListViewDataHint(Sender: TObject; StartIndex,
2302 EndIndex: Integer);
2303 begin
2304 //
2305 end;
2306
2307 procedure TGikoForm.ListViewDataStateChange(Sender: TObject; StartIndex,
2308 EndIndex: Integer; OldState, NewState: TItemStates);
2309 begin
2310 //
2311 end;
2312
2313 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
2314 var
2315 p: TPoint;
2316 s: string;
2317 tmp2: string;
2318 URL: string;
2319 ATitle: Boolean;
2320
2321 threadItem : TThreadItem;
2322 board : TBoard;
2323 Protocol, Host, Path, Document, Port, Bookmark: string;
2324
2325 //wkInt: Integer;
2326 wkIntSt: Integer;
2327 wkIntTo: Integer;
2328 ActiveFileName: string;
2329 e: IHTMLElement;
2330 Ext: string;
2331 buf: string;
2332 PathRec: TPathRec;
2333 begin
2334 try
2335 try
2336 if (FActiveContent <> nil) and (Assigned(Browser.Document)) then begin
2337 if LowerCase(OleVariant(IHTMLDocument2(Browser.Document)).charset) <> 'shift_jis' then
2338 OleVariant(IHTMLDocument2(Browser.Document)).charset := 'shift_jis';
2339 end;
2340 except
2341 end;
2342 finally
2343 end;
2344 if PreviewTimer.Enabled then
2345 PreviewTimer.Enabled := False;
2346 Application.CancelHint;
2347 if GetActiveContent <> nil then
2348 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2349 else
2350 ActiveFileName := '';
2351
2352 StatusBar.Panels[1].Text := Text;
2353
2354 if FHint <> nil then begin
2355 FHint.ReleaseHandle;
2356 FHint.ClearAllRes;
2357 end;
2358 if FPreviewBrowser <> nil then
2359 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2360
2361 if not GikoSys.Setting.UnActivePopup then
2362 if not GikoForm.Active then
2363 Exit;
2364
2365 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2366 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2367
2368 s := '';
2369 Ext := AnsiLowerCase(ExtractFileExt(Text));
2370 if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
2371 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2372 if FPreviewBrowser = nil then begin
2373 FPreviewBrowser := TPreviewBrowser.Create(Self);
2374 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2375 TOleControl(FPreviewBrowser).Parent := nil;
2376 end;
2377 FPreviewBrowser.Navigate('about:blank');//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2378 FPreviewURL := Text;
2379 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2380 PreviewTimer.Enabled := True;
2381 end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
2382 if Pos('mailto:', Text) = 1 then begin
2383 s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
2384 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2385 GetCursorPos(p);
2386 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2387 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2388 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2389 if (Assigned(e)) then begin
2390 tmp2 := GikoSys.ZenToHan(e.Get_outerText);
2391 if (GikoSys.IsNumeric(tmp2)) then begin
2392 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2393 wkIntSt := StrToInt(tmp2);
2394 wkIntTo := StrToInt(tmp2);
2395 //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2396 FHint.PopupType := gptThread;
2397 SetResPopupText(GetActiveContent, wkIntSt, wkIntTo, False, False);
2398 end else begin
2399 FHint.PopupType := gptRaw;
2400 FHint.Caption := s;
2401 end;
2402 end;
2403 end else begin
2404 URL := Text;
2405
2406 if Pos('about:blank..', URL) = 1 then begin
2407 threadItem := GetActiveContent;
2408 if AnsiPos('http://jbbs.shitaraba.com/', threadItem.URL) <> 0 then begin
2409 URL := Copy(threadItem.URL, 1, LastDelimiter('/',threadItem.URL));
2410 Gikosys.GetPopupResNumber(Text,PathRec.FSt,PathRec.FTo);
2411 if ( PathRec.FSt <> 0 ) and ( PathRec.FTo <> 0 ) then
2412 buf := IntToStr(PathRec.FSt) + '-' + IntToStr(PathRec.FTo)
2413 else if( PathRec.FSt <> 0 ) then
2414 buf := IntToStr(PathRec.FSt);
2415 end else if AnsiPos('machi.to/bbs/', threadItem.URL) <> 0 then begin
2416 URL := threaditem.URL;
2417 buf := Copy(Text,AnsiPos('&st=',Text),Length(Text)-AnsiPos('&st=',Text) + 1);
2418 end else begin
2419
2420 URL := Copy(threadItem.URL, 1, LastDelimiter('/',threadItem.URL));
2421 buf := Copy(Text,LastDelimiter('/',Text)+1,Length(Text)-LastDelimiter('/',Text));
2422 end;
2423 URL := URL + buf;
2424 end;
2425 PathRec := Gikosys.Parse2chURL2(URL);
2426 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2427 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2428
2429 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
2430
2431 URL := GikoSys.GetBrowsableThreadURL( URL );
2432 wkIntSt := PathRec.FSt;
2433 wkIntTo := PathRec.FTo;
2434
2435 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2436 wkIntSt := 1;
2437 wkIntTo := 1;
2438 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2439 wkIntSt := wkIntTo;
2440 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2441 wkIntTo := wkIntSt;
2442 end else if wkIntSt > wkIntTo then begin
2443 //wkInt := wkIntTo;
2444 wkIntTo := wkIntSt;
2445 wkIntSt := wkIntTo;
2446 end;
2447 //if wkIntSt = 0 then
2448 // wkIntSt := 1;
2449 //if wkINtTo = 0 then
2450 // wkIntTo := 1;
2451 //if PathRec.FFirst then
2452 // wkIntSt := 1;
2453 if PathRec.FStBegin then
2454 wkIntSt := 1;
2455 if PathRec.FToEnd then
2456 wkIntTo := 9999;
2457
2458 ATitle := ActiveFileName <> PathRec.FKey;
2459
2460 threadItem := BBSsFindThreadFromURL( URL );
2461
2462 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2463 board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2464 if board <> nil then
2465 threadItem := board.Find( PathRec.FKey + '.dat' );
2466
2467 end;
2468
2469 if threadItem <> nil then begin
2470 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2471 FHint.PopupType := gptThread;
2472 SetResPopupText( threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2473 end;
2474 end;
2475 end;
2476
2477 //if s <> '' then
2478 // ShowTextPopup(s);
2479 if FHint.PopupType = gptRaw then begin
2480 if FHint.Caption <> '' then
2481 ShowTextPopup;
2482 end else begin
2483 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
2484 ShowTextPopup;
2485 end;
2486 end;
2487 end;
2488
2489 procedure TGikoForm.BrowserTitleChange(Sender: TObject;
2490 const Text: WideString);
2491 var
2492 Title: string;
2493 begin
2494 if (Text = BLANK_HTML) or (Text = GikoSys.GetHtmlTempFileName) then
2495 Title := CAPTION_NAME
2496 else
2497 Title := CAPTION_NAME + ' - [' + Text + ']';
2498 Caption := Title;
2499 //Application.Title := Title;
2500 end;
2501
2502 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2503 var
2504 SysMenu: HMenu;
2505 //SysMenuApp: HMenu;
2506 begin
2507 FEnabledCloseButton := Enabled;
2508 SysMenu := GetSystemMenu(Handle, False);
2509 //SysMenuApp := GetSystemMenu(Application.Handle, False);
2510
2511 if Enabled then begin
2512 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2513 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2514 end else begin
2515 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2516 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2517 end;
2518
2519 DrawMenuBar(Handle);
2520 //DrawMenuBar(Application.Handle);
2521 end;
2522
2523 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2524 var AllowChange: Boolean);
2525 begin
2526 if FTreeType = gtt2ch then
2527 FSortIndex := -1;
2528 end;
2529
2530 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2531 Shift: TShiftState);
2532 begin
2533 if Key = VK_BACK then begin
2534 // UpFolderButtonClick(Sender);
2535 end else if Key = VK_SPACE then begin
2536 // ListClick;
2537 end else if Key = VK_RETURN then begin
2538 ListDoubleClick;
2539 end;
2540 end;
2541
2542 function TGikoForm.GetHttpState: Boolean;
2543 begin
2544 Result := FHttpState;
2545 end;
2546
2547 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2548 Column: TListColumn);
2549 var
2550 i: Integer;
2551 wkBBS: TBBS;
2552 wkCategory: TCategory;
2553 wkBoard: TBoard;
2554 begin
2555 if FSortIndex = Column.Index then
2556 FSortOrder := not FSortOrder
2557 else
2558 FSortOrder := False;
2559
2560 for i := 0 to ListView.Columns.Count - 1 do
2561 ListView.Column[i].ImageIndex := -1;
2562 if FSortOrder then
2563 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT1
2564 else
2565 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT2;
2566
2567 Sort.SortNoFlag := ListNumberVisibleAction.Checked;
2568
2569 //if TObject(TreeView.Selected.Data) is TBBS then begin
2570 if TObject( FActiveList ) is TBBS then begin
2571 //wkBBS := TBBS(TreeView.Selected.Data);
2572 wkBBS := TBBS( FActiveList );
2573 Sort.SortOrder := FSortOrder;
2574 Sort.SortIndex := Column.Index;
2575 wkBBS.Sort(CategorySortProc);
2576 ListView.Refresh;
2577 //end else if TObject(TreeView.Selected.Data) is TCategory then begin
2578 end else if TObject( FActiveList ) is TCategory then begin
2579 //wkCategory := TCategory(TreeView.Selected.Data);
2580 wkCategory := TCategory( FActiveList );
2581 Sort.SortOrder := FSortOrder;
2582 Sort.SortIndex := Column.Index;
2583 wkCategory.Sort(BoardSortProc);
2584 ListView.Refresh;
2585 //end else if TObject(TreeView.Selected.Data) is TBoard then begin
2586 end else if TObject( FActiveList ) is TBoard then begin
2587 //wkBoard := TBoard(TreeView.Selected.Data);
2588 wkBoard := TBoard( FActiveList );
2589 Sort.SortOrder := FSortOrder;
2590 Sort.SortIndex := Column.Index;
2591 wkBoard.Sort(ThreadItemSortProc);
2592 ListView.Refresh;
2593 end;
2594 FSortIndex := Column.Index;
2595 end;
2596
2597 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2598 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2599 var
2600 ARect: TRect;
2601 begin
2602 DefaultDraw := True;
2603 Exit;
2604 DefaultDraw := False;
2605 if (cdsSelected in State) or (cdsHot in State) then begin
2606 Sender.Canvas.Brush.Color := clHighlight;
2607 Sender.Canvas.Font.Color := clHighlightText;
2608 end else begin
2609 Sender.Canvas.Brush.Color := clBtnFace;
2610 Sender.Canvas.Font.Color := clBtnText;
2611 end;
2612 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2613 Sender.Canvas.FillRect(ARect);
2614 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2615 end;
2616
2617 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2618 var
2619 Nodes: TTreeNodes;
2620 i: integer;
2621 begin
2622 Nodes := TreeView.Items;
2623
2624 for i := 0 to Nodes.Count - 1 do begin
2625 if Nodes.Item[i].Data = Data then begin
2626 Result := Nodes.Item[i];
2627 Exit;
2628 end;
2629 end;
2630 Result := nil;
2631 end;
2632
2633 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2634 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2635 Headers: OleVariant; var Cancel: WordBool);
2636 var
2637 sNo: string;
2638 p: TPoint;
2639 const
2640 kMenuName: string = 'menu:';
2641 begin
2642
2643 if Pos(kMenuName, URL) <> 0 then begin
2644 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2645
2646 if not GikoSys.IsNumeric(sNo) then Exit;
2647
2648 Cancel := True;
2649 GetCursorpos(p);
2650 KokoPopupMenu.Tag := StrToInt(sNo);
2651 KokoPopupMenu.Popup(p.x, p.y);
2652 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2653 Cancel := not GikoSys.Setting.OpenMailer;
2654 end;
2655
2656 end;
2657
2658 procedure TGikoForm.ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
2659 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
2660 var DefaultDraw: Boolean);
2661 var
2662 ThreadItem: TThreadItem;
2663 begin
2664 //
2665 // TListView(Sender).Canvas.Font.Style := [];
2666 if TObject(Item.Data) is TThreadItem then begin
2667 ThreadItem := TThreadItem(Item.Data);
2668 if ( FUseOddResOddColor ) and ( ThreadItem.Count <> 0 ) and ( ThreadItem.AllResCount <> ThreadItem.Count) then begin
2669 ListView.Canvas.Brush.Color := FOddColor;
2670 end else begin
2671 ListView.Canvas.Brush.Color := FListViewBackGroundColor;
2672 end;
2673 // if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then
2674 if ThreadItem.UnRead then
2675 TListView(Sender).Canvas.Font.Style := [fsBold];
2676 end;
2677 end;
2678
2679 procedure TGikoForm.AppFormDeactivate(Sender: TObject);
2680 begin
2681 if Application.Terminated then
2682 Exit;
2683 if PreviewTimer.Enabled then
2684 PreviewTimer.Enabled := False;
2685 //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2686 if FHint <> nil then begin
2687 FHint.ReleaseHandle;
2688 FHint.ClearAllRes;
2689 // FHint.Free;
2690 // FHint := nil;
2691 end;
2692 if FPreviewBrowser <> nil then
2693 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2694
2695 end;
2696
2697 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2698 const ARect: TRect; var DefaultDraw: Boolean);
2699 var
2700 NodeRect: TRect;
2701 i, j: Integer;
2702 IsBoardNode: Boolean;
2703 Cnt: Integer;
2704 CntText: string;
2705 TextWidth: Integer;
2706 TextRect: TRect;
2707 Board: TBoard;
2708 Category: TCategory;
2709 Bitmap: TBitmap;
2710 NodeWidth: Integer;
2711 begin
2712 DefaultDraw := True;
2713
2714 if FTreeType = gttHistory then Exit;
2715
2716 TreeView.Canvas.Font.Color := clBlue;
2717 IsBoardNode := False;
2718
2719 for i := 0 to TreeView.Items.Count - 1 do begin
2720 Cnt := 0;
2721 if not TreeView.Items[i].IsVisible then
2722 continue;
2723
2724 if TObject(TreeView.Items[i].Data) is TCategory then begin
2725 if TreeView.Items[i].Expanded then
2726 continue;
2727
2728 IsBoardNode := False;
2729 Category := TCategory(TreeView.Items[i].Data);
2730 for j := 0 to Category.Count - 1 do begin
2731 Board := Category.Items[j];
2732 if Board <> nil then begin
2733 if Board.UnRead > 0 then begin
2734 Cnt := 1;
2735 Break;
2736 end;
2737 end;
2738 end;
2739 if Cnt <> 1 then
2740 continue;
2741 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2742 IsBoardNode := True;
2743 Board := TBoard(TreeView.Items[i].Data);
2744 Cnt := Board.UnRead;
2745 if Cnt <= 0 then
2746 continue;
2747 end else
2748 continue;
2749
2750 Bitmap := TBitmap.Create;
2751 try
2752 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2753 Bitmap.Canvas.Font.Style := [fsBold];
2754 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2755 finally
2756 Bitmap.Free;
2757 end;
2758
2759 NodeRect := TreeView.Items[i].DisplayRect(True);
2760
2761 if IsBoardNode then
2762 CntText := '(' + IntToStr(Cnt) + ')'
2763 else if Cnt = 1 then
2764 CntText := '(+)';
2765
2766
2767 TextWidth := TreeView.Canvas.TextWidth(CntText);
2768
2769 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2770 NodeRect.Top,
2771 NodeRect.Left + NodeWidth + TextWidth + 8,
2772 NodeRect.Bottom);
2773 DrawText(TreeView.Canvas.Handle,
2774 PChar(CntText),
2775 -1,
2776 TextRect,
2777 DT_SINGLELINE or DT_VCENTER);
2778 end;
2779 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2780 end;
2781
2782 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2783 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2784 var
2785 Board: TBoard;
2786 Category: TCategory;
2787 i: Integer;
2788 begin
2789 DefaultDraw := True;
2790
2791 if FTreeType = gttHistory then Exit;
2792
2793 TreeView.Canvas.Font.Style := [];
2794 if Node <> nil then begin
2795 if TObject(Node.Data) is TCategory then begin
2796 Category := TCategory(Node.Data);
2797 for i := 0 to Category.Count - 1 do begin
2798 Board := Category.Items[i];
2799 if Board <> nil then begin
2800 if Board.UnRead > 0 then begin
2801 TreeView.Canvas.Font.Style := [fsBold];
2802 Break;
2803 end;
2804 end;
2805 end;
2806 end else if TObject(Node.Data) is TBoard then begin
2807 Board := TBoard(Node.Data);
2808 if Board.UnRead > 0 then
2809 TreeView.Canvas.Font.Style := [fsBold];
2810 end;
2811 end;
2812 end;
2813
2814 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2815 begin
2816 TreeView.Invalidate;
2817
2818 if TObject(Node.Data) is TBBS then begin
2819 TBBS(Node.Data).NodeExpand := True;
2820 end else if TObject(Node.Data) is TCategory then begin
2821 TCategory(Node.Data).NodeExpand := True;
2822 end else if TObject(Node.Data) is TBoard then begin
2823 TBoard(Node.Data).NodeExpand := True;
2824 end;
2825 end;
2826
2827 {procedure TGikoForm.CabinetPanelVisible(PanelVisible: Boolean);
2828 begin
2829 TreeSplitter.Visible := PanelVisible;
2830 CabinetPanel.Visible := PanelVisible;
2831 CabinetToolButton.Down := PanelVisible;
2832 end;}
2833
2834 procedure TGikoForm.ListViewAllSelect;
2835 begin
2836 ListView.SetFocus;
2837 ListView.SelectAll;
2838 end;
2839
2840 procedure TGikoForm.TreeViewDblClick(Sender: TObject);
2841 var
2842 Board: TBoard;
2843 ThreadItem: TThreadItem;
2844 APoint: TPoint;
2845 HitTest: THitTests;
2846 begin
2847 GetCursorPos(APoint);
2848 APoint := TreeView.ScreenToClient(APoint);
2849 HitTest := TreeView.GetHitTestInfoAt(APoint.x, APoint.y);
2850 if not (htOnLabel in HitTest) then Exit;
2851 if TreeView.Selected = nil then Exit;
2852
2853 if FTreeType = gtt2ch then begin
2854 if not (TObject(TreeView.Selected.Data) is TBoard) then Exit;
2855 Board := TBoard(TreeView.Selected.Data);
2856 DownloadList(Board);
2857 end else if FTreeType = gttHistory then begin
2858 if not (TObject(TreeView.Selected.Data) is TFavoriteThreadItem) then Exit;
2859 ThreadItem := TFavoriteThreadItem(TreeView.Selected.Data).Item;
2860 DownloadContent(ThreadItem);
2861 end;
2862 end;
2863
2864 procedure TGikoForm.FavoriteTreeViewClick(Sender: TObject);
2865 begin
2866
2867 FavoriteClick( TObject( FavoriteTreeView.Selected ) );
2868
2869 end;
2870
2871 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2872 begin
2873 AddMessageList(Msg, nil, Icon);
2874 end;
2875
2876 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2877 var
2878 ATitle: string;
2879 s: string;
2880 begin
2881 try
2882 if Item.DownType = gdtBoard then
2883 ATitle := Item.Board.Title
2884 else
2885 ATitle := Item.ThreadItem.Title;
2886 if ATitle = '' then
2887 ATitle := '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?';
2888
2889 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2890 //鐃緒申鐃緒申鐃?鐃緒申
2891 if Item.DownType = gdtBoard then begin
2892 //鐃緒申
2893 Item.SaveListFile;
2894 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2895 if GetActiveList = Item.Board then
2896 SetActiveList(Item.Board);
2897 Item.Board.Modified := True;
2898 Item.Board.IsThreadDatRead := True;
2899 PlaySound('New');
2900 end else if Item.DownType = gdtThread then begin
2901 //鐃?鐃緒申
2902 Item.SaveItemFile;
2903 Item.ThreadItem.NewArrival := True;
2904 if GetActiveContent = Item.ThreadItem then
2905 InsertBrowserTab(Item.ThreadItem)
2906 else
2907 InsertBrowserTab(Item.ThreadItem, False);
2908
2909 if Item.State = gdsComplete then begin