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.301 - (show annotations) (download) (as text)
Thu May 20 13:03:45 2004 UTC (19 years, 11 months ago) by h677
Branch: MAIN
Changes since 1.300: +44 -64 lines
File MIME type: text/x-pascal
まちBBSのスレを表示できない不具合を修正

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