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