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.252 - (show annotations) (download) (as text)
Wed Apr 7 02:09:02 2004 UTC (20 years ago) by yoffy
Branch: MAIN
Changes since 1.251: +116 -79 lines
File MIME type: text/x-pascal
・キャビネットのカテゴリや履歴のコンテキストメニューで「名前をコピー」が出来るようになった。

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