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.304 - (show annotations) (download) (as text)
Sat May 22 14:56:10 2004 UTC (19 years, 11 months ago) by h677
Branch: MAIN
Changes since 1.303: +79 -73 lines
File MIME type: text/x-pascal
タブを閉じる系アクションのバグ取り。SetContentメソッド内のバグの修正

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