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.91 - (show annotations) (download) (as text)
Sun Oct 5 17:15:00 2003 UTC (20 years, 6 months ago) by h677
Branch: MAIN
Changes since 1.90: +24 -41 lines
File MIME type: text/x-pascal
ブラウザタブのスタイルによってD&D時にエラーが出るのを修正

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