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.358 - (show annotations) (download) (as text)
Mon Jul 12 05:41:39 2004 UTC (19 years, 9 months ago) by genyakun
Branch: MAIN
Changes since 1.357: +5 -4 lines
File MIME type: text/x-pascal
タブの開く順番が戻らない部分を修正

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