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.85 - (show annotations) (download) (as text)
Thu Oct 2 13:16:24 2003 UTC (20 years, 6 months ago) by yoffy
Branch: MAIN
Changes since 1.84: +47 -57 lines
File MIME type: text/x-pascal
・rev 1.74 のビジュアルドラッグアンドドロップが機能するように。

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