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.310 - (show annotations) (download) (as text)
Sun May 23 09:33:24 2004 UTC (19 years, 11 months ago) by h677
Branch: MAIN
Changes since 1.309: +8 -12 lines
File MIME type: text/x-pascal
スレの描画で極端に遅くなる不具合の修正と、ログを持ってないスレを表示した後に、
ログを持ってないスレをDLさせ、その途中で表示中のスレを切り替えても、表示が
切り替わらない不具合の修正

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