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.247 - (show annotations) (download) (as text)
Tue Apr 6 12:20:13 2004 UTC (20 years ago) by yoffy
Branch: MAIN
Changes since 1.246: +3 -0 lines
File MIME type: text/x-pascal
・BBS を切り替えて掲示板キャビネットを操作するとエラーが発生するバグを修正。

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