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.264 - (show annotations) (download) (as text)
Fri Apr 9 00:23:53 2004 UTC (20 years ago) by yoffy
Branch: MAIN
Changes since 1.263: +1 -2 lines
File MIME type: text/x-pascal
・r1.263 で消し忘れのゴミが残っていたので削除。

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