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.109 - (show annotations) (download) (as text)
Sun Nov 16 19:34:37 2003 UTC (20 years, 5 months ago) by h677
Branch: MAIN
Changes since 1.108: +26 -3 lines
File MIME type: text/x-pascal
取得レス数とスレッドのレス数が異なったときにListViewの背景色を変える
機能を追加。

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