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.259 - (show annotations) (download) (as text)
Wed Apr 7 16:28:24 2004 UTC (20 years ago) by yoffy
Branch: MAIN
Changes since 1.258: +18 -1 lines
File MIME type: text/x-pascal
・r1.254 に引き続きブラウザが最小化されている時に
 ブラウザタブをクリックしただけで最大化出来るようになった。

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