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.341 - (show annotations) (download) (as text)
Sat Jun 19 14:42:45 2004 UTC (19 years, 10 months ago) by h677
Branch: MAIN
Changes since 1.340: +45 -1 lines
File MIME type: text/x-pascal
未読・既読機能の復帰

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