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.233 - (show annotations) (download) (as text)
Sat Apr 3 09:12:27 2004 UTC (20 years ago) by q9_
Branch: MAIN
Changes since 1.232: +3 -11 lines
File MIME type: text/x-pascal
巡回時のステータスバー表示の不具合の修正

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