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.261 - (show annotations) (download) (as text)
Thu Apr 8 15:17:13 2004 UTC (20 years ago) by h677
Branch: MAIN
Changes since 1.260: +2 -2 lines
File MIME type: text/x-pascal
隠蔽されていたCoolBarの保存を復帰させた。

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