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.329 - (show annotations) (download) (as text)
Thu Jun 3 12:29:11 2004 UTC (19 years, 10 months ago) by yoffy
Branch: MAIN
Changes since 1.328: +9 -1 lines
File MIME type: text/x-pascal
r1.327 の変更でスレ一覧からスレをクリックしただけでドラッグ扱いになってしまっていたので修正。

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