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.115 - (show annotations) (download) (as text)
Thu Nov 20 06:19:25 2003 UTC (20 years, 5 months ago) by yoffy
Branch: MAIN
Changes since 1.114: +34 -12 lines
File MIME type: text/x-pascal
・subject.txt をダウンロードしていない板のスレッドをアドレスバーに入力した場合、
 今までは「移動」ボタンを 2 回押す必要があったが、今回から 1 回押すだけでよくなった。
・プラグイン使用時は板リストに登録されていないスレッドでもギコナビで開くことが出来るようになった。
 ※今までのギコナビは板リストに登録されていないスレッドは IE で開いていた

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