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.69 - (show annotations) (download) (as text)
Sun Sep 28 13:05:35 2003 UTC (20 years, 6 months ago) by yoffy
Branch: MAIN
Changes since 1.68: +21 -0 lines
File MIME type: text/x-pascal
・TabControl のドラッグ&ドロップが激しく挙動不審なので対策を講じてみた。

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