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.343 - (show annotations) (download) (as text)
Sun Jun 20 05:40:40 2004 UTC (19 years, 10 months ago) by h677
Branch: MAIN
Changes since 1.342: +125 -34 lines
File MIME type: text/x-pascal
選択スレッドの保存をHTML化保存とDat保存の二つに。
ココにレスで1000レスチェックが残っていたので削除

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