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.274 - (show annotations) (download) (as text)
Sun Apr 11 19:33:04 2004 UTC (20 years ago) by yoffy
Branch: MAIN
Changes since 1.273: +32 -31 lines
File MIME type: text/x-pascal
・過去ログ html の URL に対してポップアップ出来ないバグを修正。

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 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 2
1512 FIsIgnoreResize := True;
1513 CabinetBBSAction.Execute;
1514 end;
1515 end else begin
1516 ShowBBSTreeOld( BBSs[ 0 ] );
1517 PostMessage( Handle, USER_TREECLICK, 0, 0 );
1518 end;
1519
1520 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 3
1521 FIsIgnoreResize := True;
1522
1523 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1524 if GikoSys.Setting.AutoLogin then
1525 LoginAction.Execute;
1526
1527 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1528 for i := 1 to ParamCount do begin
1529 MoveToURL(ParamStr(i));
1530 end;
1531 // SetStdToolBar;
1532 // SetLinkBar;
1533
1534 s := GikoSys.FAbon.NGwordname;
1535 StatusBar.Panels[2].Text := s;
1536 StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
1537 StatusBarResize(Sender);
1538
1539 dummy1.Caption := ItemReservPMenu.Caption;
1540 dummy1.Hint := ItemReservPMenu.Hint;
1541
1542 //Samba24鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?
1543 GikoSys.SambaFileExists();
1544 end;
1545
1546 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1547 procedure TGikoForm.SaveCoolBarSettings;
1548 var
1549 i : Integer;
1550 CoolSet : TCoolSet;
1551 begin
1552
1553 if IsIconic( Handle ) or FIsIgnoreResize then
1554 Exit;
1555
1556 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1557 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1558 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1559 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1560 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1561 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1562 end;
1563 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1564 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1565 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1566 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1567 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1568 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1569 end;
1570 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1571 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1572 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1573 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1574 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1575 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1576 end;
1577
1578 end;
1579
1580 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1581 procedure TGikoForm.LoadCoolBarSettings;
1582 var
1583 i : Integer;
1584 CoolSet : TCoolSet;
1585 begin
1586
1587 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1588 MainCoolBar.Bands.BeginUpdate;
1589 try
1590 // for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1591 for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin
1592 CoolSet := GikoSys.Setting.MainCoolSet[i];
1593 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1594 FIsIgnoreResize := False;
1595 SaveCoolBarSettings;
1596 Exit;
1597 end;
1598 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1599 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1600 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1601 end;
1602 finally
1603 MainCoolBar.Bands.EndUpdate;
1604 end;
1605
1606 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1607 ListCoolBar.Bands.BeginUpdate;
1608 try
1609 // for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1610 for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin
1611 CoolSet := GikoSys.Setting.ListCoolSet[i];
1612 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1613 FIsIgnoreResize := False;
1614 SaveCoolBarSettings;
1615 Exit;
1616 end;
1617 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1618 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1619 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1620 end;
1621 finally
1622 ListCoolBar.Bands.EndUpdate;
1623 end;
1624
1625 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1626 BrowserCoolBar.Bands.BeginUpdate;
1627 try
1628 // for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1629 for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
1630 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1631 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1632 FIsIgnoreResize := False;
1633 SaveCoolBarSettings;
1634 Exit;
1635 end;
1636 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1637 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1638 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1639 end;
1640 finally
1641 BrowserCoolBar.Bands.EndUpdate;
1642 end;
1643
1644 end;
1645
1646 //
1647 //
1648 //
1649 procedure TGikoForm.FormShow(Sender: TObject);
1650 begin
1651 ShowWindow(Application.Handle, SW_HIDE);
1652
1653 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1654 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1655 StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1656 StdToolBarVisibleActionExecute( nil );
1657 AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1658 AddressBarVisibleActionExecute( nil );
1659 LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1660 LinkBarVisibleActionExecute( nil );
1661 ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1662 ListToolBarVisibleActionExecute( nil );
1663 ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1664 ListNameBarVisibleActionExecute( nil );
1665 BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1666 BrowserToolBarVisibleActionExecute( nil );
1667 BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1668 BrowserNameBarVisibleActionExecute( nil );
1669
1670 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1671 BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1672 BrowserTabVisibleActionExecute(nil);
1673
1674 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1675 BrowserTabTopAction.Checked := True;
1676 BrowserTabTopActionExecute(nil);
1677 end else begin
1678 BrowserTabBottomAction.Checked := True;
1679 BrowserTabBottomActionExecute(nil);
1680 end;
1681
1682 if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1683 BrowserTabTabStyleAction.Checked := True;
1684 BrowserTabTabStyleActionExecute(nil);
1685 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1686 BrowserTabButtonStyleAction.Checked := True;
1687 BrowserTabButtonStyleActionExecute(nil);
1688 end else begin
1689 BrowserTabFlatStyleAction.Checked := True;
1690 BrowserTabFlatStyleActionExecute(nil);
1691 end;
1692
1693 // CoolBar 鐃緒申鐃緒申
1694 LoadCoolBarSettings;
1695
1696 FIsIgnoreResize := False;
1697 end;
1698
1699 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1700 begin
1701 if ( GikoSys.Setting.ShowDialogForEnd ) and
1702 (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1703 CanClose := false;
1704 Exit;
1705 end else begin
1706 CanClose := True;
1707 end;
1708 //Application.HookMainWindow(Hook);
1709 Application.UnhookMainWindow(Hook);
1710 Application.Terminate;
1711 end;
1712
1713 procedure TGikoForm.FormDestroy(Sender: TObject);
1714 var
1715 i: Integer;
1716 // CoolSet: TCoolSet;
1717 wp: TWindowPlacement;
1718 begin
1719 // Application.OnDeactivate := nil;
1720 // Self.OnDeactivate := nil;
1721 try
1722 //column鐃緒申
1723 if GetActiveList is TBBS then begin
1724 for i := 0 to ListView.Columns.Count - 1 do
1725 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
1726 end else if GetActiveList is TCategory then begin
1727 for i := 0 to ListView.Columns.Count - 1 do
1728 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
1729 end else if GetActiveList is TBoard then begin
1730 for i := 0 to ListView.Columns.Count - 1 do
1731 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1732 end;
1733 except
1734 end;
1735 try
1736 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1737 wp.length := sizeof(wp);
1738 GetWindowPlacement(Handle, @wp);
1739 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1740 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1741 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1742 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1743 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1744
1745 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1746 GikoSys.Setting.CabinetVisible := CabinetVisibleAction.Checked;
1747 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1748 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1749 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1750 if ArrangeAction.Checked then
1751 GikoSys.Setting.ListOrientation := gloVertical
1752 else
1753 GikoSys.Setting.ListOrientation := gloHorizontal;
1754 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1755 except
1756 end;
1757
1758 // 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申 CoolBar 鐃緒申鐃緒申
1759 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1760 {
1761 // 鐃緒申FormDestroy鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?2004/04/09鐃?
1762 // CoolBar 鐃緒申鐃緒申
1763 if GikoForm.WindowState <> wsMinimized then
1764 SaveCoolBarSettings;
1765 }
1766 try
1767 GikoSys.Setting.WriteWindowSettingFile;
1768 GikoSys.Setting.WriteNameMailSettingFile;
1769 except
1770 end;
1771
1772 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1773 try
1774 //FavoriteDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1775 FavoriteDM.WriteFavorite;
1776 FavoriteDM.Clear;
1777 except
1778 end;
1779
1780 try
1781 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1782 //NotSelectTabCloseAction.Execute;
1783 {if BrowserTab.Tabs.Count >= 1 then begin
1784 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1785 end;
1786 }
1787 except
1788 end;
1789
1790 try
1791 TreeView.Items.BeginUpdate;
1792 for i := TreeView.Items.Count - 1 downto 0 do begin
1793 TreeView.Items[i].Free;
1794 end;
1795 TreeView.Items.Clear;
1796 TreeView.Items.EndUpdate;
1797 except
1798 end;
1799
1800 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1801 try
1802 //AddressHistoryDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1803 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1804 except
1805 end;
1806
1807 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1808 try
1809 SaveHistory;
1810 except
1811 end;
1812 try
1813 try
1814 ClearHistory;
1815 except
1816 end;
1817 finally
1818 FHistoryList.Free;
1819 end;
1820
1821 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1822 try
1823 RoundList.SaveRoundFile;
1824 except
1825 end;
1826 try
1827 try
1828 RoundList.Clear;
1829 except
1830 end;
1831 finally
1832 RoundList.Free;
1833 end;
1834
1835 try
1836 try
1837 FControlThread.Terminate;
1838 FControlThread.WaitFor;
1839 except
1840 end;
1841 finally
1842 FControlThread.Free;
1843 end;
1844
1845 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1846 // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1847 // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1848 try
1849 for i := Length( BBSs ) - 1 downto 0 do begin
1850 if BBSs[ i ] <> nil then
1851 BBSs[ i ].Free;
1852 BBSs[ i ] := nil;
1853 end;
1854 except
1855 end;
1856
1857 try
1858 for i := Length( BoardPlugIns ) - 1 downto 0 do begin
1859 if BoardPlugIns[ i ] <> nil then
1860 BoardPlugIns[ i ].Free;
1861 BoardPlugIns[ i ] := nil;
1862 end;
1863 except
1864 end;
1865
1866 try
1867 if FEvent <> nil then
1868 FEvent.Free;
1869
1870 //Hint鐃?鐃緒申
1871 if FHint <> nil then begin
1872 FHint.ReleaseHandle;
1873 FHint.Free;
1874 FHint := nil;
1875 end;
1876 //Preview鐃?鐃緒申
1877 if TPreviewBrowser <> nil then begin
1878 FPreviewBrowser.Free;
1879 FPreviewBrowser := nil;
1880 end;
1881 except
1882 end;
1883
1884 end;
1885
1886 //鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1887 procedure TGikoForm.FormClose(Sender: TObject; var Action: TCloseAction);
1888 begin
1889 end;
1890 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1891 procedure TGikoForm.CabinetPanelHide(Sender: TObject);
1892 begin
1893 CabinetVisibleAction.Execute;
1894 // CabinetPanelVisible(false);
1895 end;
1896
1897 procedure TGikoForm.ReloadBBS;
1898 var
1899 i : Integer;
1900 item : TBBSMenuItem;
1901 begin
1902 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1903 NotSelectTabCloseAction.Execute;
1904 if BrowserTab.Tabs.Count >= 1 then
1905 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1906 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1907 TreeView.Items.Clear;
1908
1909 //BBS鐃?鐃緒申
1910 try
1911 for i := Length( BBSs ) - 1 downto 0 do begin
1912 if BBSs[ i ] <> nil then
1913 BBSs[ i ].Free;
1914 BBSs[ i ] := nil;
1915 end;
1916 except
1917 end;
1918
1919 ActiveList := nil;
1920
1921 FTreeType := gttNone;
1922
1923 GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1924 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1925 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1926 try
1927 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1928 CabinetSelectPopupMenu.Items[ i ].Free;
1929 CabinetMenu.Items[ i ].Free;
1930 end;
1931 except
1932 end;
1933 end;
1934 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1935 for i := Length( BBSs ) - 1 downto 0 do begin
1936 try
1937 item := TBBSMenuItem.Create( PopupMenu );
1938 item.Caption := BBSs[ i ].Title;
1939 item.Data := BBSs[ i ];
1940 item.OnClick := BBSMenuItemOnClick;
1941 CabinetSelectPopupMenu.Items.Insert( 0, item );
1942 item := TBBSMenuItem.Create( PopupMenu );
1943 item.Caption := BBSs[ i ].Title;
1944 item.Data := BBSs[ i ];
1945 item.OnClick := BBSMenuItemOnClick;
1946 CabinetMenu.Insert( 0, item );
1947 except
1948 end;
1949 end;
1950 ShowBBSTree( BBSs[ 0 ] );
1951
1952 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1953 SaveHistory;
1954 ClearHistory;
1955 LoadHistory;
1956
1957 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1958 FavoriteDM.WriteFavorite;
1959 FavoriteDM.Clear;
1960 FavoriteDM.ReadFavorite;
1961 SetLinkBar;
1962
1963 end;
1964
1965 //鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1966 procedure TGikoForm.SetBoardTreeNode(
1967 inBBS : TBBS
1968 );
1969 var
1970 i, j, k: integer;
1971 Root: TTreeNode;
1972 CategoryNode: TTreeNode;
1973 BoardNode: TTreeNode;
1974 Category: TCategory;
1975 Board: TBoard;
1976 begin
1977 // 鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1978 FActiveBBS := inBBS;
1979 TreeView.Items.BeginUpdate;
1980 TreeView.Items.Clear;
1981 try
1982 if not inBBS.IsBoardFileRead then
1983 GikoSys.ReadBoardFile( inBBS );
1984 try
1985 if SplashWindow <> nil then
1986 SplashWindow.ProgressBar.Max := inBBS.Count;
1987 except
1988 end;
1989
1990 Root := TreeView.Items.Add( nil, inBBS.Title );
1991 Root.ImageIndex := ITEM_ICON_2CH1;
1992 Root.SelectedIndex := ITEM_ICON_2CH2;
1993 Root.Data := inBBS;
1994 for i := 0 to inBBS.Count - 1 do begin
1995 Category := TCategory(inBBS.Items[i]);
1996 CategoryNode := TreeView.Items.AddChild(Root, Category.Title);
1997 CategoryNode.Data := Category;
1998 CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
1999 CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
2000
2001 for j := 0 to Category.Count - 1 do begin
2002 Board := TBoard(Category.Items[j]);
2003 Board.BeginUpdate;
2004 BoardNode := TreeView.Items.AddChild(CategoryNode, Board.Title);
2005 BoardNode.Data := Board;
2006 //if (Board.LastGetTime = 0) or (Board.LastGetTime = ZERO_DATE) then begin
2007 if not Board.IsLogFile then begin
2008 BoardNode.ImageIndex := ITEM_ICON_BOARD_NOSUBJECT;
2009 BoardNode.SelectedIndex := ITEM_ICON_BOARD_NOSUBJECT;
2010 end else begin
2011 BoardNode.ImageIndex := ITEM_ICON_BOARD1;
2012 BoardNode.SelectedIndex := ITEM_ICON_BOARD2;
2013 for k := 0 to Board.Count - 1 do begin
2014 if Board.Items[ k ].IsLogFile then begin
2015 BoardNode.ImageIndex := ITEM_ICON_BOARD_LOG;
2016 BoardNode.SelectedIndex := ITEM_ICON_BOARD_LOG;
2017
2018 Break;
2019 end;
2020 end;
2021 end;
2022 Board.EndUpdate;
2023 end;
2024
2025 CategoryNode.Expanded := Category.NodeExpand;
2026
2027 if SplashWindow <> nil then begin
2028 SplashWindow.ProgressBar.StepIt;
2029 Application.ProcessMessages;
2030 end;
2031 end;
2032 finally
2033 TreeView.Items.EndUpdate;
2034 end;
2035 end;
2036
2037 function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS): Integer;
2038 const
2039 COLUMN: array[0..0] of string = ('鐃?鐃?鐃?鐃緒申鐃緒申');
2040 var
2041 ListColumn: TListColumn;
2042 i: Integer;
2043 begin
2044 ListView.Items.BeginUpdate;
2045 try
2046 Screen.Cursor := crHourGlass;
2047
2048 ListView.Columns.Clear;
2049 for i := 0 to Length(COLUMN) - 1 do begin
2050 ListColumn := ListView.Columns.Add;
2051 ListColumn.Caption := COLUMN[i];
2052 ListColumn.Width := GikoSys.Setting.BBSColumnWidth[i];
2053 end;
2054
2055 ListView.Items.Count := 0;
2056 ListView.Items.Clear;
2057 ListView.Items.Count := ABBS2ch.Count;
2058
2059 // UpFolderAction.Enabled := False;
2060 // AllItemAction.Enabled := False;
2061 // LogItemAction.Enabled := False;
2062 // NewItemAction.Enabled := False;
2063 // SelectItemAction.Enabled := False;
2064 // ListDownloadToolButton.Enabled := False;
2065 // BoardReservToolButton.Enabled := False;
2066 // ListThreadDownloadToolButton.Enabled := False;
2067
2068 ListNameLabel.Caption := ABBS2ch.Title;
2069 FolderImage.Picture := nil;
2070 ItemIcon16.GetBitmap(1, FolderImage.Picture.Bitmap);
2071
2072 FSortIndex := 0;
2073 FSortOrder := False;
2074 ListViewColumnClick(nil, ListView.Column[0]);
2075
2076 Result := ABBS2ch.Count;
2077 finally
2078 Screen.Cursor := crDefault;
2079 ListView.Items.EndUpdate;
2080 end;
2081 end;
2082
2083 function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
2084 const
2085 COLUMN: array[0..2] of string = ('鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
2086 var
2087 ListColumn: TListColumn;
2088 i: Integer;
2089 begin
2090 ListView.Items.BeginUpdate;
2091 try
2092 Screen.Cursor := crHourGlass;
2093
2094 ListView.Columns.Clear;
2095 for i := 0 to Length(COLUMN) - 1 do begin
2096 ListColumn := ListView.Columns.Add;
2097 ListColumn.Caption := COLUMN[i];
2098 ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[i];
2099 end;
2100
2101 ListView.Items.Count := 0;
2102 ListView.Items.Clear;
2103 ListView.Items.Count := Category.Count;
2104
2105 // UpFolderAction.Enabled := True;
2106 // AllItemAction.Enabled := False;
2107 // LogItemAction.Enabled := False;
2108 // NewItemAction.Enabled := False;
2109 // SelectItemAction.Enabled := False;
2110 // ListDownloadToolButton.Enabled := False;
2111 // BoardReservToolButton.Enabled := False;
2112 // ListThreadDownloadToolButton.Enabled := False;
2113
2114 ListNameLabel.Caption := Category.Title;
2115 FolderImage.Picture := nil;
2116 ItemIcon16.GetBitmap(3, FolderImage.Picture.Bitmap);
2117
2118 FSortIndex := 0;
2119 FSortOrder := False;
2120 ListViewColumnClick(nil, ListView.Column[0]);
2121
2122 Result := Category.Count;
2123 finally
2124 Screen.Cursor := crDefault;
2125 ListView.Items.EndUpdate;
2126 end;
2127 end;
2128
2129 function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
2130 const
2131 COLUMN: array[0..7] of string = ('鐃?鐃緒申鐃?鐃?鐃緒申', '鐃?鐃?鐃緒申鐃?', '鐃緒申鐃緒申', '鐃?鐃緒申',
2132 '鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申', '鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
2133 COLUMN_ALIGNMENT: array[0..7] of TAlignment = (taLeftJustify, taRightJustify,
2134 taRightJustify, taRightJustify,
2135 taRightJustify, taLeftJustify,
2136 taLeftJustify, taLeftJustify);
2137 //No, 鐃?鐃緒申鐃?鐃?鐃緒申, 鐃?鐃?鐃緒申鐃?, 鐃緒申鐃緒申鐃?鐃緒申, 鐃緒申鐃緒申鐃緒申鐃緒申
2138 var
2139 ListColumn: TListColumn;
2140 i: Integer;
2141 begin
2142 ListView.Items.BeginUpdate;
2143 try
2144 Screen.Cursor := crHourGlass;
2145
2146 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2147 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2148 if ListView.Columns.Count <> (High( COLUMN ) - Low( COLUMN ) + 1) then
2149 begin
2150 ListView.Columns.Clear;
2151 for i := 0 to Length(COLUMN) - 1 do begin
2152 ListColumn := ListView.Columns.Add;
2153 ListColumn.Caption := COLUMN[i];
2154 ListColumn.Width := GikoSys.Setting.BoardColumnWidth[i];
2155 ListColumn.Alignment := COLUMN_ALIGNMENT[i];
2156 end;
2157 end;
2158
2159 ListView.Items.Count := 0;
2160 ListView.Items.Clear;
2161
2162 case GikoForm.ViewType of
2163 gvtAll: ListView.Items.Count := Board.Count;
2164 gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
2165 gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
2166 gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
2167 end;
2168
2169 ListNameLabel.Caption := Board.Title;
2170 FolderImage.Picture := nil;
2171 ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
2172
2173 FSortIndex := 0;
2174 FSortOrder := False;
2175 ListViewColumnClick(nil, ListView.Column[0]);
2176
2177 Result := Board.Count;
2178 finally
2179 Screen.Cursor := crDefault;
2180 ListView.Items.EndUpdate;
2181 end;
2182 end;
2183
2184 procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
2185 var
2186 // FileName: string;
2187 // DateTime: TDateTime;
2188 BoardCnt: Integer;
2189 BBS: TBBS;
2190 Category: TCategory;
2191 Board: TBoard;
2192 ThreadItem: TThreadItem;
2193 RepStr: string;
2194 ActivListObj : TObject;
2195 begin
2196 ActivListObj := ActiveList;
2197 if ActivListObj is TBBS then begin
2198 BBS := TBBS(ActivListObj);
2199
2200 ListView.StateImages := nil;
2201
2202 if BBS = nil then Exit;
2203 if BBS.Count <= 0 then Exit;
2204 if Item = nil then Exit;
2205 if Item.Index > BBS.Count then Exit;
2206 if ListView.Items.Count = 0 then Exit;
2207
2208 if not (BBS.Items[Item.index] is TCategory) then Exit;
2209 Category := TCategory(BBS.Items[Item.index]);
2210
2211 if Category = nil then Exit;
2212
2213 if ListNumberVisibleAction.Checked then
2214 Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
2215 else
2216 Item.Caption := Category.Title;
2217
2218 Item.ImageIndex := ITEM_ICON_CATEGORY1;
2219 Item.Data := Category;
2220 end else if ActivListObj is TCategory then begin
2221 Category := TCategory(ActivListObj);
2222
2223 ListView.StateImages := nil;
2224
2225 if Category = nil then Exit;
2226 if Category.Count <= 0 then Exit;
2227 if Item = nil then Exit;
2228 if Item.Index >= Category.Count then Exit;
2229 if ListView.Items.Count = 0 then Exit;
2230
2231 if not (Category.Items[Item.Index] is TBoard) then Exit;
2232 Board := TBoard(Category.Items[Item.Index]);
2233
2234 if Board = nil then Exit;
2235
2236 if ListNumberVisibleAction.Checked then
2237 Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
2238 else
2239 Item.Caption := Board.Title;
2240
2241 if Item.SubItems.Count <> 2 then begin
2242 Item.SubItems.Clear;
2243 Item.SubItems.Add('');
2244 Item.SubItems.Add('');
2245 end;
2246
2247 Item.ImageIndex := ITEM_ICON_BOARD1;
2248
2249 if Board.Round then
2250 Item.SubItems[0] := Board.RoundName // '鐃?鐃緒申'
2251 else
2252 Item.SubItems[0] := '';
2253
2254 if Board.RoundDate = ZERO_DATE then begin
2255 Item.SubItems[1] := '';
2256 end else
2257 Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
2258 Item.Data := Board;
2259 end else if ActivListObj is TBoard then begin
2260 Board := TBoard(ActivListObj);
2261
2262 if GikoSys.Setting.ListIconVisible then
2263 ListView.StateImages := StateIconImageList
2264 else
2265 ListView.StateImages := nil;
2266
2267 case GikoForm.ViewType of
2268 gvtAll: BoardCnt := Board.Count;
2269 gvtLog: BoardCnt := Board.GetLogThreadCount;
2270 gvtNew: BoardCnt := Board.GetNewThreadCount;
2271 gvtUser: BoardCnt := Board.GetUserThreadCount;
2272 else
2273 BoardCnt := 0;
2274 end;
2275
2276 // if Board = nil then Exit;
2277 if BoardCnt <= 0 then Exit;
2278 if Item = nil then Exit;
2279 if Item.Index > BoardCnt then Exit;
2280 if ListView.Items.Count = 0 then Exit;
2281
2282 // if not (Board.Items[Item.Index] is TThreadItem) then Exit;
2283
2284 ThreadItem := nil;
2285 case GikoForm.ViewType of
2286 gvtAll: if Item.Index >= Board.Count then Exit else
2287 ThreadItem := TThreadItem(Board.Items[Item.Index]);
2288 gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
2289 gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
2290 gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
2291 end;
2292
2293 if ThreadItem = nil then Exit;
2294
2295 // if ListNumberVisibleAction.Checked then
2296 // RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title
2297 // else
2298 RepStr := ThreadItem.Title;
2299 RepStr := CustomStringReplace(RepStr, '&lt;', '<' );
2300 RepStr := CustomStringReplace(RepStr, '&gt;', '>' );
2301 RepStr := CustomStringReplace(RepStr, '&quot;', '"' );
2302 RepStr := CustomStringReplace(RepStr, '&amp;', '&' );
2303 //RepStr := StringReplace(RepStr, '鐃緒申鐃?', ',', [rfReplaceAll]);
2304
2305 if Item.SubItems.Count <> 7 then begin
2306 Item.SubItems.Clear;
2307 Item.SubItems.Add('');
2308 Item.SubItems.Add('');
2309 Item.SubItems.Add('');
2310 Item.SubItems.Add('');
2311 Item.SubItems.Add('');
2312 Item.SubItems.Add('');
2313 Item.SubItems.Add('');
2314 end;
2315
2316 if ListNumberVisibleAction.Checked then
2317 Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
2318 else
2319 Item.Caption := RepStr;
2320
2321 case ThreadItem.AgeSage of
2322 gasNone: Item.StateIndex := -1;
2323 gasNew: Item.StateIndex := 0;
2324 gasAge: Item.StateIndex := 1;
2325 gasSage: Item.StateIndex := 2;
2326 end;
2327
2328 if ThreadItem.IsLogFile then begin
2329 Item.ImageIndex := ITEM_ICON_THREADLOG1;
2330 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2331 Item.SubItems[1] := IntToStr(ThreadItem.Count);
2332 if ThreadItem.NewResCount = 0 then
2333 Item.SubItems[2] := ''
2334 else
2335 Item.SubItems[2] := IntToStr(ThreadItem.NewResCount);
2336 Item.SubItems[3] := '';
2337 if ThreadItem.Round then
2338 Item.SubItems[4] := ThreadItem.RoundName
2339 else
2340 Item.SubItems[4] := '';
2341 if ThreadItem.RoundDate = ZERO_DATE then begin
2342 Item.SubItems[5] := '';
2343 end else
2344 Item.SubItems[5] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
2345 if ThreadItem.NewArrival then
2346 Item.ImageIndex := ITEM_ICON_THREADNEW1;
2347 if ThreadItem.CreateDate = ZERO_DATE then begin
2348 Item.SubItems[6] := '';
2349 end else
2350 Item.SubItems[6] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
2351
2352 end else begin
2353 Item.ImageIndex := ITEM_ICON_THREAD1;
2354 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2355 Item.SubItems[1] := '';
2356 Item.SubItems[2] := '';
2357 Item.SubItems[3] := '';
2358 Item.SubItems[4] := '';
2359 Item.SubItems[5] := '';
2360 if not GikoSys.Setting.CreationTimeLogs then
2361 if ThreadItem.CreateDate = ZERO_DATE then
2362 Item.SubItems[6] := ''
2363 else
2364 Item.SubItems[6] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
2365
2366 end;
2367
2368 Item.Data := ThreadItem;
2369 end;
2370 end;
2371
2372 procedure TGikoForm.ListViewDataFind(Sender: TObject; Find: TItemFind;
2373 const FindString: String; const FindPosition: TPoint; FindData: Pointer;
2374 StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
2375 var Index: Integer);
2376 begin
2377
2378 //
2379 end;
2380
2381 procedure TGikoForm.ListViewDataHint(Sender: TObject; StartIndex,
2382 EndIndex: Integer);
2383 begin
2384 //
2385 end;
2386
2387 procedure TGikoForm.ListViewDataStateChange(Sender: TObject; StartIndex,
2388 EndIndex: Integer; OldState, NewState: TItemStates);
2389 begin
2390 //
2391 end;
2392
2393 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
2394 var
2395 p: TPoint;
2396 s: string;
2397 tmp2: string;
2398 URL: string;
2399 ATitle: Boolean;
2400
2401 threadItem : TThreadItem;
2402 board : TBoard;
2403 Protocol, Host, Path, Document, Port, Bookmark: string;
2404
2405 //wkInt: Integer;
2406 wkIntSt: Integer;
2407 wkIntTo: Integer;
2408 ActiveFileName: string;
2409 e: IHTMLElement;
2410 Ext: string;
2411 buf: string;
2412 PathRec: TPathRec;
2413 begin
2414 try
2415 try
2416 if (FActiveContent <> nil) and (Assigned(Browser.Document)) then begin
2417 if LowerCase(OleVariant(IHTMLDocument2(Browser.Document)).charset) <> 'shift_jis' then
2418 OleVariant(IHTMLDocument2(Browser.Document)).charset := 'shift_jis';
2419 end;
2420 except
2421 end;
2422 finally
2423 end;
2424 if PreviewTimer.Enabled then
2425 PreviewTimer.Enabled := False;
2426 Application.CancelHint;
2427 if GetActiveContent <> nil then
2428 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2429 else
2430 ActiveFileName := '';
2431
2432 StatusBar.Panels[1].Text := Text;
2433
2434 if FHint <> nil then begin
2435 FHint.ReleaseHandle;
2436 FHint.ClearAllRes;
2437 end;
2438 if FPreviewBrowser <> nil then
2439 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2440
2441 if not GikoSys.Setting.UnActivePopup then
2442 if not GikoForm.Active then
2443 Exit;
2444
2445 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2446 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2447
2448 s := '';
2449 Ext := AnsiLowerCase(ExtractFileExt(Text));
2450 if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
2451 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2452 if FPreviewBrowser = nil then begin
2453 FPreviewBrowser := TPreviewBrowser.Create(Self);
2454 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2455 TOleControl(FPreviewBrowser).Parent := nil;
2456 end;
2457 FPreviewBrowser.Navigate('about:blank');//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2458 FPreviewURL := Text;
2459 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2460 PreviewTimer.Enabled := True;
2461 end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
2462 if Pos('mailto:', Text) = 1 then begin
2463 s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
2464 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2465 GetCursorPos(p);
2466 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2467 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2468 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2469 if (Assigned(e)) then begin
2470 tmp2 := GikoSys.ZenToHan(e.Get_outerText);
2471 if (GikoSys.IsNumeric(tmp2)) then begin
2472 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2473 wkIntSt := StrToInt(tmp2);
2474 wkIntTo := StrToInt(tmp2);
2475 //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2476 FHint.PopupType := gptThread;
2477 SetResPopupText(GetActiveContent, wkIntSt, wkIntTo, False, False);
2478 end else begin
2479 FHint.PopupType := gptRaw;
2480 FHint.Caption := s;
2481 end;
2482 end;
2483 end else begin
2484 if Pos('about:blank..', Text) = 1 then begin
2485 threadItem := GetActiveContent;
2486 if AnsiPos('http://jbbs.shitaraba.com/', threadItem.URL) <> 0 then begin
2487 URL := Copy(threadItem.URL, 1, LastDelimiter('/',threadItem.URL));
2488 Gikosys.GetPopupResNumber(Text,PathRec.FSt,PathRec.FTo);
2489 if ( PathRec.FSt <> 0 ) and ( PathRec.FTo <> 0 ) then
2490 buf := IntToStr(PathRec.FSt) + '-' + IntToStr(PathRec.FTo)
2491 else if( PathRec.FSt <> 0 ) then
2492 buf := IntToStr(PathRec.FSt);
2493 end else if AnsiPos('machi.to/bbs/', threadItem.URL) <> 0 then begin
2494 URL := threaditem.URL;
2495 buf := Copy(Text,AnsiPos('&st=',Text),Length(Text)-AnsiPos('&st=',Text) + 1);
2496 end else begin
2497 URL := Copy(threadItem.URL, 1, LastDelimiter('/',threadItem.URL));
2498 buf := Copy(Text,LastDelimiter('/',Text)+1,Length(Text)-LastDelimiter('/',Text));
2499 end;
2500 URL := URL + buf;
2501 end else begin
2502 URL := Text;
2503 end;
2504 PathRec := Gikosys.Parse2chURL2(URL);
2505 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2506 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2507
2508 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
2509
2510 URL := GikoSys.GetBrowsableThreadURL( URL );
2511 wkIntSt := PathRec.FSt;
2512 wkIntTo := PathRec.FTo;
2513
2514 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2515 wkIntSt := 1;
2516 wkIntTo := 1;
2517 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2518 wkIntSt := wkIntTo;
2519 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2520 wkIntTo := wkIntSt;
2521 end else if wkIntSt > wkIntTo then begin
2522 //wkInt := wkIntTo;
2523 wkIntTo := wkIntSt;
2524 wkIntSt := wkIntTo;
2525 end;
2526 //if wkIntSt = 0 then
2527 // wkIntSt := 1;
2528 //if wkINtTo = 0 then
2529 // wkIntTo := 1;
2530 //if PathRec.FFirst then
2531 // wkIntSt := 1;
2532 if PathRec.FStBegin then
2533 wkIntSt := 1;
2534 if PathRec.FToEnd then
2535 wkIntTo := 9999;
2536
2537 //ATitle := ActiveFileName <> PathRec.FKey;
2538 if GetActiveContent.URL = URL then
2539 ATitle := false
2540 else
2541 ATitle := true;
2542
2543 threadItem := BBSsFindThreadFromURL( URL );
2544
2545 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2546 board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2547 if board <> nil then begin
2548 if not board.IsThreadDatRead then
2549 GikoSys.ReadSubjectFile( board );
2550 threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
2551 end;
2552 end;
2553
2554 if threadItem <> nil then begin
2555 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2556 FHint.PopupType := gptThread;
2557 SetResPopupText( threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2558 end;
2559 end;
2560 end;
2561
2562 //if s <> '' then
2563 // ShowTextPopup(s);
2564 if FHint.PopupType = gptRaw then begin
2565 if FHint.Caption <> '' then
2566 ShowTextPopup;
2567 end else begin
2568 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
2569 ShowTextPopup;
2570 end;
2571 end;
2572 end;
2573
2574 procedure TGikoForm.BrowserTitleChange(Sender: TObject;
2575 const Text: WideString);
2576 var
2577 Title: string;
2578 begin
2579 if (Text = BLANK_HTML) or (Text = GikoSys.GetHtmlTempFileName) then
2580 Title := CAPTION_NAME
2581 else
2582 Title := CAPTION_NAME + ' - [' + Text + ']';
2583 Caption := Title;
2584 //Application.Title := Title;
2585 end;
2586
2587 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2588 var
2589 SysMenu: HMenu;
2590 //SysMenuApp: HMenu;
2591 begin
2592 FEnabledCloseButton := Enabled;
2593 SysMenu := GetSystemMenu(Handle, False);
2594 //SysMenuApp := GetSystemMenu(Application.Handle, False);
2595
2596 if Enabled then begin
2597 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2598 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2599 end else begin
2600 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2601 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2602 end;
2603
2604 DrawMenuBar(Handle);
2605 //DrawMenuBar(Application.Handle);
2606 end;
2607
2608 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2609 var AllowChange: Boolean);
2610 begin
2611 if FTreeType = gtt2ch then
2612 FSortIndex := -1;
2613 end;
2614
2615 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2616 Shift: TShiftState);
2617 begin
2618 if GetActiveList is TBoard then begin
2619 if Key = VK_BACK then begin
2620 // UpFolderButtonClick(Sender);
2621 end else if Key = VK_SPACE then begin
2622 ListDoubleClick;
2623 end else if Key = VK_RETURN then begin
2624 ListClick;
2625 end;
2626 end else begin // TBBS, TCategory
2627 if Key = VK_BACK then begin
2628 // UpFolderButtonClick(Sender);
2629 end else if Key = VK_SPACE then begin
2630 ListClick;
2631 end else if Key = VK_RETURN then begin
2632 ListDoubleClick;
2633 end;
2634 end;
2635 end;
2636
2637 function TGikoForm.GetHttpState: Boolean;
2638 begin
2639 Result := FHttpState;
2640 end;
2641
2642 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2643 Column: TListColumn);
2644 var
2645 i: Integer;
2646 wkBBS: TBBS;
2647 wkCategory: TCategory;
2648 wkBoard: TBoard;
2649 begin
2650 if FSortIndex = Column.Index then
2651 FSortOrder := not FSortOrder
2652 else
2653 FSortOrder := False;
2654
2655 for i := 0 to ListView.Columns.Count - 1 do
2656 ListView.Column[i].ImageIndex := -1;
2657 if FSortOrder then
2658 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT1
2659 else
2660 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT2;
2661
2662 Sort.SortNoFlag := ListNumberVisibleAction.Checked;
2663
2664 //if TObject(TreeView.Selected.Data) is TBBS then begin
2665 if TObject( FActiveList ) is TBBS then begin
2666 //wkBBS := TBBS(TreeView.Selected.Data);
2667 wkBBS := TBBS( FActiveList );
2668 Sort.SortOrder := FSortOrder;
2669 Sort.SortIndex := Column.Index;
2670 wkBBS.Sort(CategorySortProc);
2671 ListView.Refresh;
2672 //end else if TObject(TreeView.Selected.Data) is TCategory then begin
2673 end else if TObject( FActiveList ) is TCategory then begin
2674 //wkCategory := TCategory(TreeView.Selected.Data);
2675 wkCategory := TCategory( FActiveList );
2676 Sort.SortOrder := FSortOrder;
2677 Sort.SortIndex := Column.Index;
2678 wkCategory.CustomSort(BoardSortProc);
2679 ListView.Refresh;
2680 //end else if TObject(TreeView.Selected.Data) is TBoard then begin
2681 end else if TObject( FActiveList ) is TBoard then begin
2682 //wkBoard := TBoard(TreeView.Selected.Data);
2683 wkBoard := TBoard( FActiveList );
2684 Sort.SortOrder := FSortOrder;
2685 Sort.SortIndex := Column.Index;
2686 wkBoard.CustomSort(ThreadItemSortProc);
2687 ListView.Refresh;
2688 end;
2689 FSortIndex := Column.Index;
2690 end;
2691
2692 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2693 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2694 var
2695 ARect: TRect;
2696 begin
2697 DefaultDraw := True;
2698 Exit;
2699 DefaultDraw := False;
2700 if (cdsSelected in State) or (cdsHot in State) then begin
2701 Sender.Canvas.Brush.Color := clHighlight;
2702 Sender.Canvas.Font.Color := clHighlightText;
2703 end else begin
2704 Sender.Canvas.Brush.Color := clBtnFace;
2705 Sender.Canvas.Font.Color := clBtnText;
2706 end;
2707 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2708 Sender.Canvas.FillRect(ARect);
2709 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2710 end;
2711
2712 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2713 var
2714 Nodes: TTreeNodes;
2715 i: integer;
2716 begin
2717 Nodes := TreeView.Items;
2718
2719 for i := 0 to Nodes.Count - 1 do begin
2720 if Nodes.Item[i].Data = Data then begin
2721 Result := Nodes.Item[i];
2722 Exit;
2723 end;
2724 end;
2725 Result := nil;
2726 end;
2727
2728 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2729 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2730 Headers: OleVariant; var Cancel: WordBool);
2731 var
2732 sNo: string;
2733 p: TPoint;
2734 const
2735 kMenuName: string = 'menu:';
2736 begin
2737
2738 if Pos(kMenuName, URL) <> 0 then begin
2739 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2740
2741 if not GikoSys.IsNumeric(sNo) then Exit;
2742
2743 Cancel := True;
2744 GetCursorpos(p);
2745 KokoPopupMenu.Tag := StrToInt(sNo);
2746 KokoPopupMenu.Popup(p.x, p.y);
2747 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2748 Cancel := not GikoSys.Setting.OpenMailer;
2749 end;
2750
2751 end;
2752
2753 procedure TGikoForm.ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
2754 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
2755 var DefaultDraw: Boolean);
2756 var
2757 ThreadItem: TThreadItem;
2758 begin
2759 //
2760 // TListView(Sender).Canvas.Font.Style := [];
2761 if TObject(Item.Data) is TThreadItem then begin
2762 ThreadItem := TThreadItem(Item.Data);
2763 if ( FUseOddResOddColor ) and ( ThreadItem.Count <> 0 ) and ( ThreadItem.AllResCount <> ThreadItem.Count) then begin
2764 ListView.Canvas.Brush.Color := FOddColor;
2765 end else begin
2766 ListView.Canvas.Brush.Color := FListViewBackGroundColor;
2767 end;
2768 // if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then
2769 if ThreadItem.UnRead then
2770 TListView(Sender).Canvas.Font.Style := [fsBold];
2771 end;
2772 end;
2773
2774 procedure TGikoForm.AppFormDeactivate(Sender: TObject);
2775 begin
2776 Application.ProcessMessages;
2777 if Application.Terminated then
2778 Exit;
2779 if PreviewTimer.Enabled then
2780 PreviewTimer.Enabled := False;
2781 //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2782 if FHint <> nil then begin
2783 FHint.ReleaseHandle;
2784 FHint.ClearAllRes;
2785 // FHint.Free;
2786 // FHint := nil;
2787 end;
2788 if FPreviewBrowser <> nil then
2789 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2790
2791 end;
2792
2793 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2794 const ARect: TRect; var DefaultDraw: Boolean);
2795 var
2796 NodeRect: TRect;
2797 i, j: Integer;
2798 IsBoardNode: Boolean;
2799 Cnt: Integer;
2800 CntText: string;
2801 TextWidth: Integer;
2802 TextRect: TRect;
2803 Board: TBoard;
2804 Category: TCategory;
2805 Bitmap: TBitmap;
2806 NodeWidth: Integer;
2807 begin
2808 DefaultDraw := True;
2809
2810 if FTreeType = gttHistory then Exit;
2811
2812 TreeView.Canvas.Font.Color := clBlue;
2813 IsBoardNode := False;
2814 for i := 0 to TreeView.Items.Count - 1 do begin
2815 Cnt := 0;
2816 if not TreeView.Items[i].IsVisible then
2817 continue;
2818
2819 if TObject(TreeView.Items[i].Data) is TCategory then begin
2820 if TreeView.Items[i].Expanded then
2821 continue;
2822
2823 IsBoardNode := False;
2824 Category := TCategory(TreeView.Items[i].Data);
2825 for j := 0 to Category.Count - 1 do begin
2826 Board := Category.Items[j];
2827 if Board <> nil then begin
2828 if Board.UnRead > 0 then begin
2829 Cnt := 1;
2830 Break;
2831 end;
2832 end;
2833 end;
2834 if Cnt <> 1 then
2835 continue;
2836 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2837 IsBoardNode := True;
2838 Board := TBoard(TreeView.Items[i].Data);
2839 Cnt := Board.UnRead;
2840 if Cnt <= 0 then
2841 continue;
2842 end else
2843 continue;
2844
2845 Bitmap := TBitmap.Create;
2846 try
2847 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2848 Bitmap.Canvas.Font.Style := [fsBold];
2849 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2850 finally
2851 Bitmap.Free;
2852 end;
2853
2854 NodeRect := TreeView.Items[i].DisplayRect(True);
2855
2856 if IsBoardNode then
2857 CntText := '(' + IntToStr(Cnt) + ')'
2858 else if Cnt = 1 then
2859 CntText := '(+)';
2860
2861
2862 TextWidth := TreeView.Canvas.TextWidth(CntText);
2863
2864 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2865 NodeRect.Top,
2866 NodeRect.Left + NodeWidth + TextWidth + 8,
2867 NodeRect.Bottom);
2868 DrawText(TreeView.Canvas.Handle,
2869 PChar(CntText),
2870 -1,
2871 TextRect,
2872 DT_SINGLELINE or DT_VCENTER);
2873 end;
2874 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2875 end;
2876
2877 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2878 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2879 var
2880 Board: TBoard;
2881 Category: TCategory;
2882 i: Integer;
2883 begin
2884 DefaultDraw := True;
2885
2886 if FTreeType = gttHistory then Exit;
2887
2888 TreeView.Canvas.Font.Style := [];
2889 if Node <> nil then begin
2890 if TObject(Node.Data) is TCategory then begin
2891 Category := TCategory(Node.Data);
2892 for i := 0 to Category.Count - 1 do begin
2893 Board := Category.Items[i];
2894 if Board <> nil then begin
2895 if Board.UnRead > 0 then begin
2896 TreeView.Canvas.Font.Style := [fsBold];
2897 Break;
2898 end;
2899 end;
2900 end;
2901 end else if TObject(Node.Data) is TBoard then begin
2902 Board := TBoard(Node.Data);
2903 if Board.UnRead > 0 then
2904 TreeView.Canvas.Font.Style := [fsBold];
2905 end;
2906 end;
2907 end;
2908