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.300 - (show annotations) (download) (as text)
Wed May 19 15:56:29 2004 UTC (19 years, 11 months ago) by h677
Branch: MAIN
Changes since 1.299: +7 -6 lines
File MIME type: text/x-pascal
全てのタブ閉じるで、BrowserPanelが見えてしまう不具合の解消と
タブ閉じるとかのボタンの有効/無効のチェックの修正

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