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.227 - (show annotations) (download) (as text)
Tue Mar 30 14:13:58 2004 UTC (20 years ago) by h677
Branch: MAIN
Changes since 1.226: +9 -9 lines
File MIME type: text/x-pascal
ClearHistoryメソッドを復活させてみた。

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