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.319 - (show annotations) (download) (as text)
Sun May 30 17:23:09 2004 UTC (19 years, 10 months ago) by h677
Branch: MAIN
Changes since 1.318: +72 -58 lines
File MIME type: text/x-pascal
スキンを使わなくても、レスアンカーをクリックするとそのレスに飛ぶようにした。

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