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.263 - (show annotations) (download) (as text)
Fri Apr 9 00:15:48 2004 UTC (20 years ago) by yoffy
Branch: MAIN
Changes since 1.262: +69 -26 lines
File MIME type: text/x-pascal
・ツールバーの設定がない場合、ツールバーの配置が保存されないバグを修正。
・ツールバーがより良い座標を算出するように調整。

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