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.249 - (show annotations) (download) (as text)
Tue Apr 6 14:20:11 2004 UTC (20 years ago) by yoffy
Branch: MAIN
Changes since 1.248: +15 -1 lines
File MIME type: text/x-pascal
・ツールバーの順番を並び替えても正しく保存されないバグを修正。

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