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.76 - (show annotations) (download) (as text)
Tue Sep 30 11:39:43 2003 UTC (20 years, 6 months ago) by h677
Branch: MAIN
Changes since 1.75: +2 -0 lines
File MIME type: text/x-pascal
ツールボタンのデフォルト配列に最新100レスを追加

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