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.59 - (show annotations) (download) (as text)
Thu Sep 25 19:28:42 2003 UTC (20 years, 6 months ago) by yoffy
Branch: MAIN
Changes since 1.58: +5 -0 lines
File MIME type: text/x-pascal
・指摘のあった
 o スレッドの名前(<div class="title">...)が自動で出力されているので
 <a name="top"></a>だけを出力してください。
 o Bookmark.htmlがない場合には、<a name="koko"></a>を出力してください。
の修正。

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 procedure FormCreate(Sender: TObject);
491 procedure FormDestroy(Sender: TObject);
492 procedure CabinetPanelHide(Sender: TObject);
493 procedure FormClose(Sender: TObject; var Action: TCloseAction);
494 procedure TreeViewChange(Sender: TObject; Node: TTreeNode);
495 procedure ListViewData(Sender: TObject; Item: TListItem);
496 procedure ListViewDataFind(Sender: TObject; Find: TItemFind;
497 const FindString: String; const FindPosition: TPoint;
498 FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection;
499 Wrap: Boolean; var Index: Integer);
500 procedure ListViewDataHint(Sender: TObject; StartIndex,
501 EndIndex: Integer);
502 procedure ListViewDataStateChange(Sender: TObject; StartIndex,
503 EndIndex: Integer; OldState, NewState: TItemStates);
504 procedure BrowserStatusTextChange(Sender: TObject;
505 const Text: WideString);
506 procedure BrowserTitleChange(Sender: TObject; const Text: WideString);
507 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
508 procedure TreeViewChanging(Sender: TObject; Node: TTreeNode;
509 var AllowChange: Boolean);
510 procedure ListViewKeyDown(Sender: TObject; var Key: Word;
511 Shift: TShiftState);
512 procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
513 procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
514 Button: TToolButton; State: TCustomDrawState;
515 var DefaultDraw: Boolean);
516 procedure BrowserBeforeNavigate2(Sender: TObject;
517 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
518 Headers: OleVariant; var Cancel: WordBool);
519 procedure ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
520 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
521 var DefaultDraw: Boolean);
522 procedure TreeViewCustomDraw(Sender: TCustomTreeView;
523 const ARect: TRect; var DefaultDraw: Boolean);
524 procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
525 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
526 procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
527 procedure TreeViewDblClick(Sender: TObject);
528 procedure FavoriteTreeViewClick(Sender: TObject);
529 procedure ListViewCustomDraw(Sender: TCustomListView;
530 const ARect: TRect; var DefaultDraw: Boolean);
531 procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
532 Shift: TShiftState; X, Y: Integer);
533 procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
534 procedure MessageListViewResize(Sender: TObject);
535 procedure ExitActionExecute(Sender: TObject);
536 procedure AllSelectActionExecute(Sender: TObject);
537 procedure StdToolBarVisibleActionExecute(Sender: TObject);
538 procedure MsgBarVisibleActionExecute(Sender: TObject);
539 procedure StatusBarVisibleActionExecute(Sender: TObject);
540 procedure LargeIconActionExecute(Sender: TObject);
541 procedure SmallIconActionExecute(Sender: TObject);
542 procedure ListIconActionExecute(Sender: TObject);
543 procedure DetailIconActionExecute(Sender: TObject);
544 procedure SearchActionExecute(Sender: TObject);
545 procedure OptionActionExecute(Sender: TObject);
546 procedure GikoNaviWebPageActionExecute(Sender: TObject);
547 procedure AboutActionExecute(Sender: TObject);
548 procedure Cabinet2chActionExecute(Sender: TObject);
549 procedure CabinetHistoryActionExecute(Sender: TObject);
550 procedure CabinetVisibleActionExecute(Sender: TObject);
551 procedure AllItemActionExecute(Sender: TObject);
552 procedure LogItemActionExecute(Sender: TObject);
553 procedure NewItemActionExecute(Sender: TObject);
554 procedure SelectItemActionExecute(Sender: TObject);
555 procedure ListNumberVisibleActionExecute(Sender: TObject);
556 procedure UpFolderActionExecute(Sender: TObject);
557 procedure IconStyleExecute(Sender: TObject);
558 procedure RoundActionExecute(Sender: TObject);
559 procedure StopActionExecute(Sender: TObject);
560 procedure MsgBarCloseActionExecute(Sender: TObject);
561 procedure BrowserMaxActionExecute(Sender: TObject);
562 procedure ScrollTopActionExecute(Sender: TObject);
563 procedure ScrollLastActionExecute(Sender: TObject);
564 procedure ScrollNewActionExecute(Sender: TObject);
565 procedure ScrollKokoActionExecute(Sender: TObject);
566 procedure EditorActionExecute(Sender: TObject);
567 procedure IEActionExecute(Sender: TObject);
568 procedure ShowThreadActionExecute(Sender: TObject);
569 procedure ShowBoardActionExecute(Sender: TObject);
570 procedure URLCopyActionExecute(Sender: TObject);
571 procedure ItemReloadActionExecute(Sender: TObject);
572 procedure SelectListReloadActionExecute(Sender: TObject);
573 procedure SelectThreadReloadActionExecute(Sender: TObject);
574 procedure SelectListReloadActionUpdate(Sender: TObject);
575 procedure AllItemActionUpdate(Sender: TObject);
576 procedure LogItemActionUpdate(Sender: TObject);
577 procedure NewItemActionUpdate(Sender: TObject);
578 procedure SelectItemActionUpdate(Sender: TObject);
579 procedure UpFolderActionUpdate(Sender: TObject);
580 procedure FormResize(Sender: TObject);
581 procedure ScrollTopActionUpdate(Sender: TObject);
582 procedure ScrollLastActionUpdate(Sender: TObject);
583 procedure ScrollNewActionUpdate(Sender: TObject);
584 procedure ScrollKokoActionUpdate(Sender: TObject);
585 procedure EditorActionUpdate(Sender: TObject);
586 procedure IEActionUpdate(Sender: TObject);
587 procedure ShowThreadActionUpdate(Sender: TObject);
588 procedure ShowBoardActionUpdate(Sender: TObject);
589 procedure SelectThreadReloadActionUpdate(Sender: TObject);
590 procedure ListViewSelectItem(Sender: TObject; Item: TListItem;
591 Selected: Boolean);
592 procedure SelectTimerTimer(Sender: TObject);
593 procedure ItemReloadActionUpdate(Sender: TObject);
594 procedure ListViewDblClick(Sender: TObject);
595 procedure LogDeleteActionExecute(Sender: TObject);
596 procedure KokomadeActionExecute(Sender: TObject);
597 procedure ZenbuActionExecute(Sender: TObject);
598 procedure KokoResActionExecute(Sender: TObject);
599 procedure ListPopupMenuPopup(Sender: TObject);
600 procedure SelectItemURLCopyActionExecute(Sender: TObject);
601 procedure SelectItemURLCopyActionUpdate(Sender: TObject);
602 procedure AllSelectActionUpdate(Sender: TObject);
603 procedure LogDeleteActionUpdate(Sender: TObject);
604 procedure BrowserTabCloseActionExecute(Sender: TObject);
605 procedure NotSelectTabCloseActionExecute(Sender: TObject);
606 procedure TreeSelectBoradReloadExecute(Sender: TObject);
607 procedure TreeSelectThreadReloadExecute(Sender: TObject);
608 procedure TreeSelectURLCopyExecute(Sender: TObject);
609 procedure TreePopupMenuPopup(Sender: TObject);
610 procedure ListToolBarVisibleActionExecute(Sender: TObject);
611 procedure BrowserToolBarVisibleActionExecute(Sender: TObject);
612 procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
613 var Cancel: WordBool);
614 procedure ListSplitterCanResize(Sender: TObject; var NewSize: Integer;
615 var Accept: Boolean);
616 procedure ListSplitterMoved(Sender: TObject);
617 procedure BrowserTabChange(Sender: TObject);
618 procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
619 Shift: TShiftState; X, Y: Integer);
620 procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer;
621 State: TDragState; var Accept: Boolean);
622 procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer);
623 procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X,
624 Y: Integer);
625 procedure BrowserDocumentComplete(Sender: TObject;
626 const pDisp: IDispatch; var URL: OleVariant);
627 procedure SelectReservActionUpdate(Sender: TObject);
628 procedure RoundNamePopupMenuPopup(Sender: TObject);
629 procedure SelectNewRoundNameExecute(Sender: TObject);
630 procedure SelectDeleteRoundExecute(Sender: TObject);
631 procedure SelectReservActionExecute(Sender: TObject);
632 procedure NewBoardActionExecute(Sender: TObject);
633 procedure LoginActionExecute(Sender: TObject);
634 procedure KeySettingActionExecute(Sender: TObject);
635 procedure AllTabCloseActionExecute(Sender: TObject);
636 procedure ArrangeActionExecute(Sender: TObject);
637 procedure NameURLCopyActionExecute(Sender: TObject);
638 procedure SelectItemNameURLCopyActionExecute(Sender: TObject);
639 procedure URLCopyActionUpdate(Sender: TObject);
640 procedure NameURLCopyActionUpdate(Sender: TObject);
641 procedure BrowserTabCloseActionUpdate(Sender: TObject);
642 procedure NotSelectTabCloseActionUpdate(Sender: TObject);
643 procedure AllTabCloseActionUpdate(Sender: TObject);
644 procedure SelectItemNameURLCopyActionUpdate(Sender: TObject);
645 procedure ActiveLogDeleteActionExecute(Sender: TObject);
646 procedure ActiveLogDeleteActionUpdate(Sender: TObject);
647 procedure ListNameBarVisibleActionExecute(Sender: TObject);
648 procedure BrowserNameBarVisibleActionExecute(Sender: TObject);
649 procedure TreeSelectNameURLCopyExecute(Sender: TObject);
650 procedure PaneInitActionExecute(Sender: TObject);
651 procedure FormShow(Sender: TObject);
652 procedure BrowserTabToolBarResize(Sender: TObject);
653 procedure BrowserMinActionExecute(Sender: TObject);
654 procedure SelectTextClearActionExecute(Sender: TObject);
655 procedure NameTextClearActionExecute(Sender: TObject);
656 procedure MailTextClearActionExecute(Sender: TObject);
657 procedure LeftmostTabSelectActionExecute(Sender: TObject);
658 procedure LeftTabSelectActionExecute(Sender: TObject);
659 procedure RightTabSelectActionExecute(Sender: TObject);
660 procedure RightmostTabSelectActionExecute(Sender: TObject);
661 procedure LeftmostTabSelectActionUpdate(Sender: TObject);
662 procedure LeftTabSelectActionUpdate(Sender: TObject);
663 procedure RightTabSelectActionUpdate(Sender: TObject);
664 procedure RightmostTabSelectActionUpdate(Sender: TObject);
665 procedure FavoriteMenuClick(Sender: TObject);
666 procedure FavoriteAddActionExecute(Sender: TObject);
667 procedure FavoriteAddActionUpdate(Sender: TObject);
668 procedure BoardFavoriteAddActionExecute(Sender: TObject);
669 procedure BoardFavoriteAddActionUpdate(Sender: TObject);
670 procedure ThreadFavoriteAddActionExecute(Sender: TObject);
671 procedure ThreadFavoriteAddActionUpdate(Sender: TObject);
672 procedure TreeSelectFavoriteAddActionExecute(Sender: TObject);
673 procedure FavoriteArrangeActionExecute(Sender: TObject);
674 procedure MainCoolBarResize(Sender: TObject);
675 procedure MoveToActionExecute(Sender: TObject);
676 procedure AddressToolBarResize(Sender: TObject);
677 procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
678 Shift: TShiftState);
679 procedure AddressBarVisibleActionExecute(Sender: TObject);
680 procedure BrowserEnter(Sender: TObject);
681 procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
682 procedure BrowserTabVisibleActionExecute(Sender: TObject);
683 procedure BrowserTabTopActionExecute(Sender: TObject);
684 procedure BrowserTabBottomActionExecute(Sender: TObject);
685 procedure BrowserTabTabStyleActionExecute(Sender: TObject);
686 procedure BrowserTabButtonStyleActionExecute(Sender: TObject);
687 procedure BrowserTabFlatStyleActionExecute(Sender: TObject);
688 procedure PreviewTimerTimer(Sender: TObject);
689 procedure MessageHideButtonClick(Sender: TObject);
690 procedure MonazillaWebPageActionExecute(Sender: TObject);
691 procedure GikoHelpActionExecute(Sender: TObject);
692 procedure ToolButton18Click(Sender: TObject);
693 procedure KotehanActionExecute(Sender: TObject);
694 procedure LinkBarVisibleActionExecute(Sender: TObject);
695 procedure BBS2chWebPageActionExecute(Sender: TObject);
696 procedure GikoFolderOpenActionExecute(Sender: TObject);
697 procedure MainCoolBarBandInfo(Sender: TObject;
698 var BandInfo: PReBarBandInfoA);
699 procedure MainCoolBarChevronClick(Sender: TObject;
700 RebarChevron: PNMRebarChevron);
701 procedure ListCoolBarBandInfo(Sender: TObject;
702 var BandInfo: PReBarBandInfoA);
703 procedure ListCoolBarChevronClick(Sender: TObject;
704 RebarChevron: PNMRebarChevron);
705 procedure BrowserCoolBarBandInfo(Sender: TObject;
706 var BandInfo: PReBarBandInfoA);
707 procedure BrowserCoolBarChevronClick(Sender: TObject;
708 RebarChevron: PNMRebarChevron);
709 procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
710 procedure ThreadEditorActionExecute(Sender: TObject);
711 procedure ThreadEditorActionUpdate(Sender: TObject);
712 procedure ToolBarSettingActionExecute(Sender: TObject);
713 procedure NameCopyActionExecute(Sender: TObject);
714 procedure BoardIEActionExecute(Sender: TObject);
715 procedure SelectItemNameCopyActionExecute(Sender: TObject);
716 procedure SelectItemNameCopyActionUpdate(Sender: TObject);
717 procedure BoardIEActionUpdate(Sender: TObject);
718 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
719 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
720 procedure NameCopyActionUpdate(Sender: TObject);
721 procedure SelectComboBoxChange(Sender: TObject);
722 procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
723 Shift: TShiftState);
724 procedure SelectComboBoxExit(Sender: TObject);
725 procedure NG1Click(Sender: TObject);
726 procedure SelectResActionExecute(Sender: TObject);
727 procedure SelectResActionUpdate(Sender: TObject);
728 procedure FormKeyDown(Sender: TObject; var Key: Word;
729 Shift: TShiftState);
730 procedure FormKeyUp(Sender: TObject; var Key: Word;
731 Shift: TShiftState);
732 procedure AllResActionExecute(Sender: TObject);
733 procedure AllResActionUpdate(Sender: TObject);
734 procedure ReloadClick(Sender: TObject);
735 procedure GoBackClick(Sender: TObject);
736 procedure GoFowardClick(Sender: TObject);
737 procedure ListCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
738 var Handled: Boolean);
739 procedure BrowserCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
740 var Handled: Boolean);
741 procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
742 var Handled: Boolean);
743 procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
744 Shift: TShiftState; X, Y: Integer);
745 procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
746 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
747 procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
748 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
749 procedure StatusBarResize(Sender: TObject);
750 procedure IndividualAbon1Click(Sender: TObject);
751 procedure IndividualAbon2Click(Sender: TObject);
752 procedure N42Click(Sender: TObject);
753 procedure SelectComboBoxEnter(Sender: TObject);
754 procedure AntiIndividualAbonClick(Sender: TObject);
755 procedure N51Click(Sender: TObject);
756 procedure TreeSelectSearchBoardNameExecute(Sender: TObject);
757 procedure CabinetFavoriteActionExecute(Sender: TObject);
758 procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X,
759 Y: Integer; State: TDragState; var Accept: Boolean);
760 procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
761 Y: Integer);
762 procedure FavoriteTreeViewEdited(Sender: TObject; Node: TTreeNode;
763 var S: String);
764 procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
765 Shift: TShiftState);
766 procedure FavoriteTreePopupMenuPopup(Sender: TObject);
767 procedure FavoriteTreeViewDeleteActionExecute(Sender: TObject);
768 procedure FavoriteTreeViewRenameActionExecute(Sender: TObject);
769 procedure FavoriteTreeViewNewFolderActionExecute(Sender: TObject);
770 procedure ToolButton19Click(Sender: TObject);
771 private
772 { Private 鐃緒申鐃緒申 }
773
774 FSortIndex: Integer;
775 FSortOrder: Boolean;
776
777 FEnabledCloseButton: Boolean;
778 // ThreadCreate: TThreadCreate;
779
780 FClickNode: TTreeNode;
781 FHttpState: Boolean;
782 FHint: TResPopup;
783 FPreviewBrowser: TPreviewBrowser;
784 FPreviewURL: string;
785
786 FBrowserSizeHeight: Integer;
787 FBrowserSizeWidth: Integer;
788
789 // FFavorite: TFavorite;
790 FBrowserComplete: Boolean;
791 FTabHintIndex: Integer;
792 FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
793 FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?
794 FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?
795 FActiveList: TObject;
796 FActiveContent: TThreadItem; //
797 FHistoryList: TList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
798 FTreeType: TGikoTreeType;
799 FWorkCount: Integer;
800 FNameCookie: string;
801 FMailCookie: string;
802 // FLastRoundTime: TDateTime;
803 BrowserNullTab: TThreadItem;
804 // DoubleClickOccurred: array [TMouseButton] of Boolean;
805 FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
806 FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?
807 FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?
808
809 Fkeynum : Integer; //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
810
811 IsDraggingSelectComboBox : Boolean;
812 DraggingSelectComboBoxPosition : TPoint;
813
814 FSearchDialog: TSearchDialog;
815
816 procedure SetBoardTreeNode;
817 function SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
818 function SetBoardListItem(Category: TCategory): Integer;
819 function SetThreadListItem(Board: TBoard): Integer;
820 // function GetRoundName(index: integer): string;
821
822 procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
823 procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
824 procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer);
825 procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
826 procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
827
828 procedure SetActiveList(Obj: TObject);
829 procedure ListClick;
830 procedure ListDoubleClick;
831 procedure BrowserMovement(AName: string);
832 procedure SelectListItem(List: TList);
833 // procedure SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
834 procedure DeleteTab(ThreadItem: TThreadItem);
835 function Hook(var Message: TMessage): Boolean;
836 procedure AddRoundNameMenu(MenuItem: TMenuItem);
837 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string);
838 procedure SetSelectRoundName(Sender: TObject);
839 function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
840
841 procedure SetMenuFont;
842 // procedure CreateFavMenu(Folder: TFavoriteFolder);
843 procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
844 procedure FavoriteClick(Sender: TObject);
845 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
846 function OnDocumentContextMenu(Sender: TObject): WordBool;
847 // function GetThreadText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean): string;
848 procedure SetResPopupText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean);
849 procedure ShowTextPopup;
850 //procedure ShowTextPopup(HintData: THintData);
851 // procedure SetStdToolBar;
852 // function GetAction(ActionName: string): TContainedAction;
853 procedure SetLinkBar;
854 function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
855 procedure MenuBarChevronMenu;
856 procedure LinkBarChevronMenu;
857 procedure ToolBarChevronMenu(ToolBar: TToolBar);
858 procedure ModifySelectList;
859 protected
860 procedure CreateParams(var Params: TCreateParams); override;
861 procedure WndProc(var Message: TMessage); override;
862 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
863 procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
864 procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
865 public
866 { Public 鐃緒申鐃緒申 }
867 // FDownload: TDownload;
868 FControlThread: TThreadControl;
869 procedure MoveToURL(URL: string);
870 procedure InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);
871 procedure ReloadBBS;
872 function GetHttpState: Boolean;
873 procedure SetEnabledCloseButton(Enabled: Boolean);
874 function GetTreeNode(Data: TObject): TTreeNode;
875 procedure AppFormDeactivate(Sender: TObject);
876 // procedure CabinetPanelVisible(PanelVisible: Boolean);
877 procedure ListViewAllSelect;
878
879 property ListStyle: TViewStyle read FListStyle write FListStyle;
880 property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
881 property ViewType: TGikoViewType read FViewType write FViewType;
882
883 property NameCookie: string read FNameCookie write FNameCookie;
884 property MailCookie: string read FMailCookie write FMailCookie;
885
886 procedure SetContent(ThreadItem: TThreadItem);
887 function GetActiveContent: TThreadItem;
888 function GetActiveList: TObject;
889
890 property ActiveList: TObject read GetActiveList write SetActiveList;
891 // property LastRoundTime: TDateTime read FLastRoundTime write FLastRoundTime;
892
893 procedure SetListViewType(AViewType: TGikoViewType); overload;
894 procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
895 procedure DownloadContent(ThreadItem: TThreadItem);
896 procedure DownloadList(Board: TBoard);
897 procedure PlaySound(SoundEventName: string);
898
899 function AddHistory(ThreadItem: TThreadItem): Boolean;
900 procedure DeleteHistory(ThreadItem: TThreadItem);
901 procedure ClearHistory;
902 procedure Show2chTree;
903 procedure ShowHistoryTree;
904 procedure SetHistoryTreeNode;
905 // procedure SelectTreeNode(Item: TObject);
906 procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
907 procedure SetBrowserTabState;
908 // property Favorite: TFavorite read FFavorite write FFavorite;
909 procedure SetToolBarPopup;
910 published
911 property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
912 end;
913
914 TFavoriteMenuItem = class(TMenuItem)
915 private
916 FData : Pointer;
917 public
918 property Data: Pointer read FData write FData;
919 end;
920
921 TLinkToolButton = class(TToolButton)
922 private
923 FData : Pointer;
924 public
925 property Data: Pointer read FData write FData;
926 end;
927
928 var
929 GikoForm: TGikoForm;
930
931 implementation
932
933 uses
934 About, Option, Round, Splash, Sort, ListSelect,
935 NewBoard;
936
937 const
938 CAPTION_NAME: string = '鐃?鐃?鐃?鐃?';
939 BLANK_HTML: string = 'about:blank';
940 SELECTCOMBOBOX_NAME: string = ''; // '鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申';
941 SELECTCOMBOBOX_COLOR: TColor = clWindow;
942
943 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
944 ITEM_ICON_2CH1 = 0; //2ch鐃?鐃?鐃?鐃緒申
945 ITEM_ICON_2CH2 = 1; //2ch鐃?鐃?鐃?鐃緒申
946 ITEM_ICON_CATEGORY1 = 2; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
947 ITEM_ICON_CATEGORY2 = 3; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
948 ITEM_ICON_BOARD1 = 4; //鐃緒申鐃?鐃?鐃?鐃緒申
949 ITEM_ICON_BOARD2 = 5; //鐃緒申鐃?鐃?鐃?鐃緒申
950 ITEM_ICON_THREADLOG1 = 6; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
951 ITEM_ICON_THREADLOG2 = 7; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
952 ITEM_ICON_THREAD1 = 8; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
953 ITEM_ICON_THREAD2 = 9; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
954 ITEM_ICON_THREADNEW1 = 10; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
955 ITEM_ICON_THREADNEW2 = 11; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
956 ITEM_ICON_SORT1 = 12; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
957 ITEM_ICON_SORT2 = 13; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
958
959 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
960 TOOL_ICON_HEIGHT_MAX = 16; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
961 TOOL_ICON_HEIGHT_MIN = 17; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
962 TOOL_ICON_HEIGHT_NORMAL = 18; //鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
963 TOOL_ICON_WIDTH_MAX = 19; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
964 TOOL_ICON_WIDTH_MIN = 20; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
965 TOOL_ICON_WIDTH_NORMAL = 21; //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
966
967 TOOL_ICON_FAV_FOLDER = 30; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申
968 TOOL_ICON_FAV_BOARD = 31; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
969 TOOL_ICON_FAV_THREAD = 32; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
970
971 HTML_FILE_NAME = 'temp_preview.html';
972
973 {$R *.DFM}
974
975 procedure TGikoForm.CreateParams(var Params: TCreateParams);
976 begin
977 inherited;
978 if FormStyle in [fsNormal, fsStayOnTop] then begin
979 if BorderStyle in [bsSingle, bsSizeable] then begin
980 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
981 Params.WndParent := 0;
982 end;
983 end;
984 end;
985
986 procedure TGikoForm.FormCreate(Sender: TObject);
987 const
988 TVS_NOTOOLTIPS = $0080;
989 var
990 FileName: string;
991 Style: DWORD;
992 msg: string;
993 i: Integer;
994 wp: TWindowPlacement;
995 s: string;
996 begin
997 {$IFDEF DEBUG}
998 AllocConsole;
999 Writeln('============================================================');
1000 Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
1001 Writeln('');
1002 Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
1003 Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
1004 Writeln('============================================================');
1005 {$ENDIF}
1006 Application.OnDeactivate := AppFormDeactivate;
1007 Self.OnDeactivate := AppFormDeactivate;
1008 Application.HookMainWindow(Hook);
1009
1010 FTreeType := gttNone;
1011
1012 FSearchDialog := nil;
1013
1014 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
1015 Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
1016
1017 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1018 RoundList := TRoundList.Create;
1019 RoundList.LoadRoundFile;
1020
1021 //BBS鐃緒申鐃緒申
1022 BBS2ch := TBBS2ch.Create(GikoSys.Setting.LogFolder);
1023
1024 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1025 // FFavorite := TFavorite.Create(FavoriteTreeView);
1026 FavoriteDM.SetFavTreeView(FavoriteTreeView);
1027 FavoriteDM.ReadFavorite;
1028
1029 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1030 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1031
1032 EnabledCloseButton := True;
1033 BoardGroup.BBS2ch.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1034 // SetBoardTreeNode; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1035 Show2chTree;
1036
1037 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1038 ListView.ViewStyle := GikoSys.Setting.ListStyle;
1039
1040 //鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1041 // MainCoolBar.Top := 0;
1042 // MainCoolBar.Left := 0;
1043
1044 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
1045 AnimePanel.Top := 0;
1046 AnimePanel.Left := 0;
1047
1048 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1049
1050 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1051 CabinetVisibleAction.Checked := not GikoSys.Setting.CabinetVisible;
1052 CabinetVisibleAction.Execute;
1053 CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
1054
1055 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1056 MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
1057 MsgBarVisibleActionExecute(nil);
1058 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
1059
1060 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1061 StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
1062 StatusBarVisibleActionExecute(nil);
1063
1064 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1065 TreeView.Items.BeginUpdate;
1066 ListView.Items.BeginUpdate;
1067 try
1068 TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1069 TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1070 TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1071 TreeView.Color := GikoSys.Setting.CabinetBackColor;
1072
1073 ListView.Font.Name := GikoSys.Setting.ListFontName;
1074 ListView.Font.Size := GikoSys.Setting.ListFontSize;
1075 ListView.Font.Color := GikoSys.Setting.ListFontColor;
1076 ListView.Color := GikoSys.Setting.ListBackColor;
1077 finally
1078 TreeView.Items.EndUpdate;
1079 ListView.Items.EndUpdate;
1080 end;
1081 //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
1082 ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
1083
1084 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1085 BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1086 BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1087
1088
1089 // TreeView.TopItem.Expanded := True; //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1090 // TreeView.Selected := TreeView.Items[0]; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1091 SetContent(nil); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1092
1093 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1094 wp.length := sizeof(wp);
1095 wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1096 wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1097 wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1098 wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1099 wp.showCmd := SW_HIDE;
1100 SetWindowPlacement(Handle, @wp);
1101
1102 // SetBounds(GikoSys.Setting.WindowLeft, GikoSys.Setting.WindowTop,
1103 // GikoSys.Setting.WindowWidth, GikoSys.Setting.WindowHeight);
1104 if GikoSys.Setting.WindowMax then
1105 WindowState := wsMaximized;
1106
1107 //鐃?鐃?鐃?鐃?鐃緒申
1108 try
1109 FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1110 if FileExists(FileName) then
1111 Animate.FileName := FileName;
1112 except
1113 end;
1114 // AnimePanel.Height := 26;
1115 // AnimePanel.Width := 39;
1116 // AnimePanel.Top := 2;
1117 // AnimePanel.Left := Width - 48;
1118
1119 //鐃?鐃?鐃?鐃?
1120 FNameCookie := '';
1121 FMailCookie := '';
1122
1123 //鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1124 AllItemAction.Checked := True;
1125 AllResAction.Checked := True;
1126
1127 //TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申
1128 Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
1129 Style := Style or TVS_NOTOOLTIPS;
1130 SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
1131
1132 // 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1133 TreeView.Align := alClient;
1134 FavoriteTreeView.Align := alClient;
1135 FavoriteTreeView.Visible := False;
1136
1137 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1138 // FBrowserSizeFlag := False;
1139 // FBrowserSizeHeight := ViewPanel.Height;
1140
1141 FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1142 FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1143
1144 ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1145 ArrangeAction.Execute;
1146
1147 if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1148 case GikoSys.Setting.ListWidthState of
1149 glsMax: begin
1150 ViewPanel.Width := 1;
1151 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1152 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1153 end;
1154 glsMin: begin
1155 ViewPanel.Width := GikoSys.Setting.ListWidth;
1156 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1157 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1158 end;
1159 else begin
1160 ViewPanel.Width := GikoSys.Setting.ListWidth;
1161 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1162 BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1163 end;
1164 end;
1165 // if GikoSys.Setting.ListWidthMax then begin
1166 // ViewPanel.Width := 1;
1167 // BrowserSizeAction.ImageIndex := ICON_WIDTH_MIN;
1168 // end else begin
1169 // ViewPanel.Width := GikoSys.Setting.ListWidth;
1170 // BrowserSizeAction.ImageIndex := ICON_WIDTH_MAX;
1171 // end;
1172 end else begin
1173 case GikoSys.Setting.ListHeightState of
1174 glsMax: begin
1175 ViewPanel.Height := 1;
1176 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1177 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1178 end;
1179 glsMin: begin
1180 ViewPanel.Height := GikoSys.Setting.ListHeight;
1181 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1182 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1183 end;
1184 else begin
1185 ViewPanel.Height := GikoSys.Setting.ListHeight;
1186 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1187 BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1188 end;
1189 end;
1190 // if GikoSys.Setting.ListHeightState = glsMax then begin
1191 // end else begin
1192 // ViewPanel.Height := GikoSys.Setting.ListHeight;
1193 // BrowserSizeAction.ImageIndex := ICON_HEIGHT_MAX;
1194 // end;
1195 end;
1196
1197 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1198 // ProgressBar.Visible := False;
1199 ProgressBar.Parent := StatusBar;
1200 ProgressBar.Top := 2;
1201 ProgressBar.Left := 0;
1202 ProgressBar.Width := StatusBar.Panels[0].Width;
1203 ProgressBar.Height := StatusBar.Height - 2;
1204 ProgressBar.Position := 0;
1205
1206 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1207 //formshow()鐃緒申鐃緒申鐃緒申
1208
1209 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1210 // FDownload := TDownload.Create;
1211 // FDownload.OnDownloadEnd := OnDonloadEnd;
1212 // FDownload.OnWork := Work;
1213 // FDownload.OnWorkBegin := WorkBegin;
1214 // FDownload.OnWorkEnd := WorkEnd;
1215
1216 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1217 FControlThread := TThreadControl.Create(True);
1218 FControlThread.MaxThreadCount := 1;
1219 FControlThread.Resume;
1220 FControlThread.OnDownloadEnd := DownloadEnd;
1221 FControlThread.OnDownloadMsg := DownloadMsg;
1222 FControlThread.OnWork := Work;
1223 FControlThread.OnWorkBegin := WorkBegin;
1224 FControlThread.OnWorkEnd := WorkEnd;
1225 // ProgressPanel.Width := FControlThread.MaxThreadCount * 12;
1226
1227 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1228 FHistoryList := TList.Create;
1229
1230 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1231 SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1232
1233 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1234 SetBrowserTabState;
1235
1236 BrowserBoardNameLabel.Caption := '';
1237 BrowserNameLabel.Caption := '';
1238 FWorkCount := 0;
1239
1240 // DetailIconAction.Execute;
1241
1242 // FBrowserSizeHeight := ViewPanel.Height;
1243 FTabHintIndex := -1;
1244
1245 //鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1246 // if not GikoSys.DirectoryExistsEx(BBS2ch.GetLogFolder) then begin
1247 // GikoSys.ForceDirectoriesEx(BBS2ch.GetLogFolder);
1248 // end;
1249 // FormResize(Sender);
1250 // MainCoolBarResize(Sender);
1251 // Application.ProcessMessages;
1252
1253 //鐃緒申鐃緒申鐃?鐃?鐃?
1254 SetLinkBar;
1255
1256 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
1257 SetMenuFont;
1258
1259 //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1260 ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1261 BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1262
1263 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1264 ReadToolBarSetting(ActionList, StdToolBar);
1265 ReadToolBarSetting(ActionList, ListToolBar);
1266 try
1267 for i := ListToolBar.ControlCount - 1 downto 0 do
1268 begin
1269 if ListToolBar.Controls[ i ].Action = SelectItemAction then
1270 begin
1271 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1272 if (i + 1) < ListToolBar.ControlCount then
1273 if ListToolBar.Controls[ i + 1 ] is TToolButton then
1274 if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
1275 ListToolBar.Controls[ i + 1 ].Visible := False;
1276
1277 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申
1278 ListToolBar.Controls[ i ].Visible := False;
1279 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申
1280 SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
1281 SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
1282 SelectComboBox.Parent := ListToolBar;
1283 // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1284 SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
1285 SelectComboBoxSplitter.Parent := ListToolBar;
1286
1287 break;
1288 end;
1289 end;
1290 except
1291 end;
1292 ReadToolBarSetting(ActionList, BrowserToolBar);
1293 SetToolBarPopup;
1294
1295 //鐃?鐃?鐃緒申鐃?鐃?鐃?
1296 AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1297
1298 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1299
1300 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1301 if not FileExists(GikoSys.GetBoardFileName) then begin
1302 msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1303 + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1304 + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1305 MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1306 NewBoardAction.Execute;
1307 end;
1308
1309 //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1310 GikoSys.LoadKeySetting(ActionList);
1311
1312 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1313 // FLastRoundTime := 0;
1314
1315 //ResHint
1316 FHint := TResPopup.Create(Self);
1317
1318 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1319 if GikoSys.Setting.AutoLogin then
1320 LoginAction.Execute;
1321
1322 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1323 for i := 1 to ParamCount do begin
1324 MoveToURL(ParamStr(i));
1325 end;
1326 // SetStdToolBar;
1327 // SetLinkBar;
1328
1329 s := GikoSys.FAbon.NGwordname;
1330 StatusBar.Panels[2].Text := s;
1331 StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
1332 StatusBarResize(Sender);
1333 end;
1334
1335 //
1336 //
1337 //
1338 procedure TGikoForm.FormShow(Sender: TObject);
1339 var
1340 i: Integer;
1341 CoolSet: TCoolSet;
1342 begin
1343 ShowWindow(Application.Handle, SW_HIDE);
1344
1345 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1346 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1347 StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1348 StdToolBarVisibleActionExecute( nil );
1349 AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1350 AddressBarVisibleActionExecute( nil );
1351 LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1352 LinkBarVisibleActionExecute( nil );
1353 ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1354 ListToolBarVisibleActionExecute( nil );
1355 ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1356 ListNameBarVisibleActionExecute( nil );
1357 BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1358 BrowserToolBarVisibleActionExecute( nil );
1359 BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1360 BrowserNameBarVisibleActionExecute( nil );
1361
1362 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1363 BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1364 BrowserTabVisibleActionExecute(nil);
1365
1366 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1367 BrowserTabTopAction.Checked := True;
1368 BrowserTabTopActionExecute(nil);
1369 end else begin
1370 BrowserTabBottomAction.Checked := True;
1371 BrowserTabBottomActionExecute(nil);
1372 end;
1373
1374 if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1375 BrowserTabTabStyleAction.Checked := True;
1376 BrowserTabTabStyleActionExecute(nil);
1377 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1378 BrowserTabButtonStyleAction.Checked := True;
1379 BrowserTabButtonStyleActionExecute(nil);
1380 end else begin
1381 BrowserTabFlatStyleAction.Checked := True;
1382 BrowserTabFlatStyleActionExecute(nil);
1383 end;
1384
1385
1386 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1387 MainCoolBar.Bands.BeginUpdate;
1388 try
1389 for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1390 CoolSet := GikoSys.Setting.MainCoolSet[i];
1391 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1392 Continue;
1393 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1394 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1395 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1396 end;
1397 finally
1398 MainCoolBar.Bands.EndUpdate;
1399 end;
1400
1401 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1402 ListCoolBar.Bands.BeginUpdate;
1403 try
1404 for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1405 CoolSet := GikoSys.Setting.ListCoolSet[i];
1406 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1407 Continue;
1408 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1409 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1410 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1411 end;
1412 finally
1413 ListCoolBar.Bands.EndUpdate;
1414 end;
1415
1416 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1417 BrowserCoolBar.Bands.BeginUpdate;
1418 try
1419 for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1420 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1421 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1422 Continue;
1423 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1424 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1425 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1426 end;
1427 finally
1428 BrowserCoolBar.Bands.EndUpdate;
1429 end;
1430
1431 end;
1432 {
1433 procedure TGikoForm.SetStdToolBar;
1434 var
1435 i: Integer;
1436 FileName: string;
1437 ini: TMemIniFile;
1438 s: string;
1439 Action: TContainedAction;
1440 ToolButton: TToolButton;
1441 begin
1442 exit;
1443 for i := StdToolBar.ButtonCount - 1 downto 0 do begin
1444 StdToolBar.RemoveControl(StdToolBar.Buttons[i]);
1445 //StdToolBar.Buttons[i].Free;
1446 end;
1447 FileName := GikoSys.GetConfigDir + 'ToolBar.ini';
1448 ini := TMemIniFile.Create(FileName);
1449 i := 0;
1450 while true do begin
1451 s := ini.ReadString('StdToolBar', IntToStr(i), '');
1452 if s = '' then
1453 Break;
1454 if s = '-' then begin
1455 ToolButton := TToolButton.Create(StdToolBar);
1456 ToolButton.Style := tbsSeparator;
1457 ToolButton.Width := 8;
1458 ToolButton.Left := 10000;
1459 StdToolBar.InsertControl(ToolButton);
1460 end else begin
1461 Action := GetAction(s);
1462 if Action <> nil then begin
1463 ToolButton := TToolButton.Create(StdToolBar);
1464 ToolButton.Action := Action;
1465 ToolButton.Left := 10000;
1466 StdToolBar.InsertControl(ToolButton);
1467 end;
1468 end;
1469 Inc(i);
1470 end;
1471 end;
1472 }
1473 {function TGikoForm.GetAction(ActionName: string): TContainedAction;
1474 var
1475 i: Integer;
1476 begin
1477 for i := 0 to ActionList.ActionCount - 1 do begin
1478 if ActionList.Actions[i].Name = ActionName then begin
1479 Result := ActionList.Actions[i];
1480 Exit;
1481 end;
1482 end;
1483 Result := nil;
1484 end;}
1485
1486 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1487 var
1488 i: Integer;
1489 CoolSet: TCoolSet;
1490 wp: TWindowPlacement;
1491 begin
1492 // if not EnabledCloseButton then begin
1493 // CanClose := False;
1494 // Exit;
1495 // end;
1496
1497 CanClose := True;
1498 Application.OnDeactivate := nil;
1499 Self.OnDeactivate := nil;
1500
1501 //column鐃緒申
1502 if GetActiveList is TBBS2ch then begin
1503 for i := 0 to ListView.Columns.Count - 1 do
1504 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
1505 end else if GetActiveList is TCategory then begin
1506 for i := 0 to ListView.Columns.Count - 1 do
1507 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
1508 end else if GetActiveList is TBoard then begin
1509 for i := 0 to ListView.Columns.Count - 1 do
1510 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1511 end;
1512
1513 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1514 wp.length := sizeof(wp);
1515 GetWindowPlacement(Handle, @wp);
1516 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1517 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1518 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1519 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1520 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1521
1522 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1523 GikoSys.Setting.CabinetVisible := CabinetVisibleAction.Checked;
1524 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1525 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1526 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1527 if ArrangeAction.Checked then
1528 GikoSys.Setting.ListOrientation := gloVertical
1529 else
1530 GikoSys.Setting.ListOrientation := gloHorizontal;
1531 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1532
1533 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1534 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1535 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1536 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1537 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1538 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1539 end;
1540 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1541 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1542 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1543 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1544 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1545 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1546 end;
1547 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1548 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1549 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1550 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1551 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1552 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1553 end;
1554
1555 GikoSys.Setting.WriteWindowSettingFile;
1556 GikoSys.Setting.WriteNameMailSettingFile;
1557
1558 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1559 try
1560 FavoriteDM.WriteFavorite;
1561 except
1562 end;
1563 // Favorite.Free;
1564
1565 try
1566 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1567 NotSelectTabCloseAction.Execute;
1568 if BrowserTab.Tabs.Count >= 1 then begin
1569 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1570 end;
1571 except
1572 end;
1573
1574 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1575 try
1576 RoundList.SaveRoundFile;
1577 except
1578 end;
1579 try
1580 RoundList.Clear;
1581 except
1582 end;
1583 try
1584 RoundList.Free;
1585 except
1586 end;
1587
1588 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1589 try
1590 FHistoryList.Free;
1591 except
1592 end;
1593
1594 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1595 try
1596 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1597 except
1598 end;
1599
1600 try
1601 FControlThread.Terminate;
1602 except
1603 end;
1604
1605 // FDownload.Free;
1606 try
1607 SetActiveList(nil);
1608 except
1609 end;
1610 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1611 Sleep(10);
1612 try
1613 TreeView.Items.Clear;
1614 except
1615 end;
1616
1617 try
1618 if FavoriteDM <> nil then
1619 FavoriteDM.Free;
1620 FavoriteDM := nil;
1621 if AddressHistoryDM <> nil then
1622 AddressHistoryDM.Free;
1623 AddressHistoryDM := nil;
1624 except
1625 end;
1626 try
1627 if BBS2ch <> nil then
1628 BBS2ch.Free;
1629 BBS2ch := nil;
1630 except
1631 end;
1632
1633 try
1634 //Hint鐃?鐃緒申
1635 if FHint <> nil then begin
1636 FHint.ReleaseHandle;
1637 FHint.Free;
1638 FHint := nil;
1639 end;
1640 //Preview鐃?鐃緒申
1641 if TPreviewBrowser <> nil then begin
1642 FPreviewBrowser.Free;
1643 FPreviewBrowser := nil;
1644 end;
1645 except
1646 end;
1647 end;
1648
1649 procedure TGikoForm.FormDestroy(Sender: TObject);
1650 //var
1651 // wp: TWindowPlacement;
1652 begin
1653 { //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1654 FHistoryList.Free;
1655
1656 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1657 wp.length := sizeof(wp);
1658 GetWindowPlacement(Handle, @wp);
1659
1660 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1661 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1662 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1663 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1664 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1665
1666 GikoSys.Setting.CabinetVisible := CabinetPanel.Visible;
1667 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1668
1669 GikoSys.Setting.WriteWindowSettingFile;
1670 GikoSys.Setting.WriteNameMailSettingFile;
1671 FDownload.Free;
1672 BBS2ch.Free;}
1673 end;
1674
1675 //鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1676 procedure TGikoForm.FormClose(Sender: TObject; var Action: TCloseAction);
1677 begin
1678 Application.Terminate;
1679 Action := caFree;
1680 end;
1681
1682 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1683 procedure TGikoForm.CabinetPanelHide(Sender: TObject);
1684 begin
1685 CabinetVisibleAction.Execute;
1686 // CabinetPanelVisible(false);
1687 end;
1688
1689 procedure TGikoForm.ReloadBBS;
1690 begin
1691 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1692 NotSelectTabCloseAction.Execute;
1693 if BrowserTab.Tabs.Count >= 1 then
1694 DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1695 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1696 FHistoryList.Clear;
1697 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1698 TreeView.Items.Clear;
1699
1700 //BBS鐃?鐃緒申
1701 BBS2ch.Free;
1702
1703 SetActiveList(nil);
1704
1705 FTreeType := gttNone;
1706
1707 //BBS鐃緒申鐃緒申
1708 BBS2ch := TBBS2ch.Create(GikoSys.Setting.LogFolder);
1709
1710 BBS2ch.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1711 Show2chTree;
1712 end;
1713
1714 //鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1715 procedure TGikoForm.SetBoardTreeNode;
1716 var
1717 i, j: integer;
1718 Root: TTreeNode;
1719 CategoryNode: TTreeNode;
1720 BoardNode: TTreeNode;
1721 Category: TCategory;
1722 Board: TBoard;
1723 begin
1724 TreeView.Items.BeginUpdate;
1725 TreeView.Items.Clear;
1726 try
1727 Root := TreeView.Items.Add(nil, BBS2ch.Title);
1728 Root.ImageIndex := ITEM_ICON_2CH1;
1729 Root.SelectedIndex := ITEM_ICON_2CH2;
1730 Root.Data := BBS2ch;
1731 if SplashWindow <> nil then
1732 SplashWindow.ProgressBar.Max := BoardGroup.BBS2ch.Count;
1733
1734 for i := 0 to BoardGroup.BBS2ch.Count - 1 do begin
1735 Category := TCategory(BoardGroup.BBS2ch.Items[i]);
1736 CategoryNode := TreeView.Items.AddChild(Root, Category.Title);
1737 CategoryNode.Data := Category;
1738 CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
1739 CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
1740
1741 for j := 0 to Category.Count - 1 do begin
1742 Board := TBoard(Category.Items[j]);
1743 Board.BeginUpdate;
1744 BoardNode := TreeView.Items.AddChild(CategoryNode, Board.Title);
1745 BoardNode.Data := Board;
1746 BoardNode.ImageIndex := ITEM_ICON_BOARD1;
1747 BoardNode.SelectedIndex := ITEM_ICON_BOARD2;
1748 Board.LoadSettings;
1749 Board.EndUpdate;
1750 end;
1751
1752 CategoryNode.Expanded := Category.NodeExpand;
1753
1754 if SplashWindow <> nil then begin
1755 SplashWindow.ProgressBar.StepIt;
1756 Application.ProcessMessages;
1757 end;
1758
1759 end;
1760 finally
1761 TreeView.Items.EndUpdate;
1762 end;
1763 end;
1764
1765 function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
1766 const
1767 COLUMN: array[0..0] of string = ('鐃?鐃?鐃?鐃緒申鐃緒申');
1768 var
1769 ListColumn: TListColumn;
1770 i: Integer;
1771 begin
1772 ListView.Items.BeginUpdate;
1773 try
1774 Screen.Cursor := crHourGlass;
1775
1776 ListView.Columns.Clear;
1777 for i := 0 to Length(COLUMN) - 1 do begin
1778 ListColumn := ListView.Columns.Add;
1779 ListColumn.Caption := COLUMN[i];
1780 ListColumn.Width := GikoSys.Setting.BBSColumnWidth[i];
1781 end;
1782
1783 ListView.Items.Count := 0;
1784 ListView.Items.Clear;
1785 ListView.Items.Count := ABBS2ch.Count;
1786
1787 // UpFolderAction.Enabled := False;
1788 // AllItemAction.Enabled := False;
1789 // LogItemAction.Enabled := False;
1790 // NewItemAction.Enabled := False;
1791 // SelectItemAction.Enabled := False;
1792 // ListDownloadToolButton.Enabled := False;
1793 // BoardReservToolButton.Enabled := False;
1794 // ListThreadDownloadToolButton.Enabled := False;
1795
1796 ListNameLabel.Caption := ABBS2ch.Title;
1797 FolderImage.Picture := nil;
1798 ItemIcon16.GetBitmap(1, FolderImage.Picture.Bitmap);
1799
1800 FSortIndex := 0;
1801 FSortOrder := False;
1802 ListViewColumnClick(nil, ListView.Column[0]);
1803
1804 Result := ABBS2ch.Count;
1805 finally
1806 Screen.Cursor := crDefault;
1807 ListView.Items.EndUpdate;
1808 end;
1809 end;
1810
1811 function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
1812 const
1813 COLUMN: array[0..2] of string = ('鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1814 var
1815 ListColumn: TListColumn;
1816 i: Integer;
1817 begin
1818 ListView.Items.BeginUpdate;
1819 try
1820 Screen.Cursor := crHourGlass;
1821
1822 ListView.Columns.Clear;
1823 for i := 0 to Length(COLUMN) - 1 do begin
1824 ListColumn := ListView.Columns.Add;
1825 ListColumn.Caption := COLUMN[i];
1826 ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[i];
1827 end;
1828
1829 ListView.Items.Count := 0;
1830 ListView.Items.Clear;
1831 ListView.Items.Count := Category.Count;
1832
1833 // UpFolderAction.Enabled := True;
1834 // AllItemAction.Enabled := False;
1835 // LogItemAction.Enabled := False;
1836 // NewItemAction.Enabled := False;
1837 // SelectItemAction.Enabled := False;
1838 // ListDownloadToolButton.Enabled := False;
1839 // BoardReservToolButton.Enabled := False;
1840 // ListThreadDownloadToolButton.Enabled := False;
1841
1842 ListNameLabel.Caption := Category.Title;
1843 FolderImage.Picture := nil;
1844 ItemIcon16.GetBitmap(3, FolderImage.Picture.Bitmap);
1845
1846 FSortIndex := 0;
1847 FSortOrder := False;
1848 ListViewColumnClick(nil, ListView.Column[0]);
1849
1850 Result := Category.Count;
1851 finally
1852 Screen.Cursor := crDefault;
1853 ListView.Items.EndUpdate;
1854 end;
1855 end;
1856
1857 function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
1858 const
1859 COLUMN: array[0..6] of string = ('鐃?鐃緒申鐃?鐃?鐃緒申', '鐃?鐃?鐃緒申鐃?', '鐃緒申鐃緒申', '鐃?鐃緒申',
1860 '鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1861 COLUMN_ALIGNMENT: array[0..6] of TAlignment = (taLeftJustify, taRightJustify,
1862 taRightJustify, taRightJustify,
1863 taRightJustify, taLeftJustify,
1864 taLeftJustify);
1865 //No, 鐃?鐃緒申鐃?鐃?鐃緒申, 鐃?鐃?鐃緒申鐃?, 鐃緒申鐃緒申鐃?鐃緒申, 鐃緒申鐃緒申鐃緒申鐃緒申
1866 var
1867 ListColumn: TListColumn;
1868 i: Integer;
1869 begin
1870 ListView.Items.BeginUpdate;
1871 try
1872 Screen.Cursor := crHourGlass;
1873
1874 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1875 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1876 if ListView.Columns.Count <> (High( COLUMN ) - Low( COLUMN ) + 1) then
1877 begin
1878 ListView.Columns.Clear;
1879 for i := 0 to Length(COLUMN) - 1 do begin
1880 ListColumn := ListView.Columns.Add;
1881 ListColumn.Caption := COLUMN[i];
1882 ListColumn.Width := GikoSys.Setting.BoardColumnWidth[i];
1883 ListColumn.Alignment := COLUMN_ALIGNMENT[i];
1884 end;
1885 end;
1886
1887 ListView.Items.Count := 0;
1888 ListView.Items.Clear;
1889
1890 case GikoForm.ViewType of
1891 gvtAll: ListView.Items.Count := Board.Count;
1892 gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
1893 gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
1894 gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
1895 end;
1896
1897 ListNameLabel.Caption := Board.Title;
1898 FolderImage.Picture := nil;
1899 ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
1900
1901 FSortIndex := 0;
1902 FSortOrder := False;
1903 ListViewColumnClick(nil, ListView.Column[0]);
1904
1905 Result := Board.Count;
1906 finally
1907 Screen.Cursor := crDefault;
1908 ListView.Items.EndUpdate;
1909 end;
1910 end;
1911
1912 procedure TGikoForm.TreeViewChange(Sender: TObject; Node: TTreeNode);
1913 var
1914 i: Integer;
1915 begin
1916 if FTreeType = gttHistory then begin
1917 // SetContent(TThreadItem(Node.Data));
1918 InsertBrowserTab(TThreadItem(Node.Data));
1919 Exit;
1920 end;
1921
1922 ListView.Selected := nil;
1923 ListView.Items.Count := 0;
1924 ListView.Items.Clear;
1925 // ListView.Columns.Clear;
1926
1927 Caption := CAPTION_NAME;
1928 //Application.Title := CAPTION_NAME;
1929
1930
1931 if GetActiveList is TBBS2ch then begin
1932 for i := 0 to ListView.Columns.Count - 1 do
1933 GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
1934 end else if GetActiveList is TCategory then begin
1935 for i := 0 to ListView.Columns.Count - 1 do
1936 GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
1937 end else if GetActiveList is TBoard then begin
1938 for i := 0 to ListView.Columns.Count - 1 do
1939 GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1940 end;
1941
1942 if TObject(Node.Data) is TBBS2ch then begin
1943 SetActiveList(Node.data);
1944 end else if TObject(Node.Data) is TCategory then begin
1945 SetActiveList(Node.data);
1946 end else if TObject(Node.Data) is TBoard then begin
1947 if not TBoard(Node.Data).IsThreadDatRead then begin
1948 Screen.Cursor := crHourGlass;
1949 try
1950 GikoSys.ReadSubjectFile(TBoard(Node.Data));
1951 finally
1952 Screen.Cursor := crDefault;
1953 end;
1954 end;
1955 SetActiveList(Node.data);
1956 end;
1957 end;
1958
1959 procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
1960 var
1961 // FileName: string;
1962 // DateTime: TDateTime;
1963 BoardCnt: Integer;
1964 BBS: TBBS2ch;
1965 Category: TCategory;
1966 Board: TBoard;
1967 ThreadItem: TThreadItem;
1968 RepStr: string;
1969 begin
1970 if ActiveList is TBBS2ch then begin
1971 BBS := TBBS2ch(ActiveList);
1972
1973 ListView.StateImages := nil;
1974
1975 if BBS = nil then Exit;
1976 if BBS.Count <= 0 then Exit;
1977 if Item = nil then Exit;
1978 if Item.Index > BBS.Count then Exit;
1979 if ListView.Items.Count = 0 then Exit;
1980
1981 if not (BBS.Items[Item.Index] is TCategory) then Exit;
1982 Category := TCategory(BBS.Items[Item.Index]);
1983
1984 if Category = nil then Exit;
1985
1986 if ListNumberVisibleAction.Checked then
1987 Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
1988 else
1989 Item.Caption := Category.Title;
1990
1991 Item.ImageIndex := ITEM_ICON_CATEGORY1;
1992 Item.Data := Category;
1993 end else if ActiveList is TCategory then begin
1994 Category := TCategory(ActiveList);
1995
1996 ListView.StateImages := nil;
1997
1998 if Category = nil then Exit;
1999 if Category.Count <= 0 then Exit;
2000 if Item = nil then Exit;
2001 if Item.Index >= Category.Count then Exit;
2002 if ListView.Items.Count = 0 then Exit;
2003
2004 if not (Category.Items[Item.Index] is TBoard) then Exit;
2005 Board := TBoard(Category.Items[Item.Index]);
2006
2007 if Board = nil then Exit;
2008
2009 if ListNumberVisibleAction.Checked then
2010 Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
2011 else
2012 Item.Caption := Board.Title;
2013
2014 if Item.SubItems.Count <> 2 then begin
2015 Item.SubItems.Clear;
2016 Item.SubItems.Add('');
2017 Item.SubItems.Add('');
2018 end;
2019
2020 Item.ImageIndex := ITEM_ICON_BOARD1;
2021
2022 if Board.Round then
2023 Item.SubItems[0] := Board.RoundName // '鐃?鐃緒申'
2024 else
2025 Item.SubItems[0] := '';
2026
2027 if Board.RoundDate = ZERO_DATE then begin
2028 Item.SubItems[1] := '';
2029 end else
2030 Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
2031 Item.Data := Board;
2032 end else if ActiveList is TBoard then begin
2033 Board := TBoard(ActiveList);
2034
2035 if GikoSys.Setting.ListIconVisible then
2036 ListView.StateImages := StateIconImageList
2037 else
2038 ListView.StateImages := nil;
2039
2040 case GikoForm.ViewType of
2041 gvtAll: BoardCnt := Board.Count;
2042 gvtLog: BoardCnt := Board.GetLogThreadCount;
2043 gvtNew: BoardCnt := Board.GetNewThreadCount;
2044 gvtUser: BoardCnt := Board.GetUserThreadCount;
2045 else
2046 BoardCnt := 0;
2047 end;
2048
2049 // if Board = nil then Exit;
2050 if BoardCnt <= 0 then Exit;
2051 if Item = nil then Exit;
2052 if Item.Index > BoardCnt then Exit;
2053 if ListView.Items.Count = 0 then Exit;
2054
2055 // if not (Board.Items[Item.Index] is TThreadItem) then Exit;
2056
2057 ThreadItem := nil;
2058 case GikoForm.ViewType of
2059 gvtAll: ThreadItem := TThreadItem(Board.Items[Item.Index]);
2060 gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
2061 gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
2062 gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
2063 end;
2064
2065 if ThreadItem = nil then Exit;
2066
2067 // if ListNumberVisibleAction.Checked then
2068 // RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title
2069 // else
2070 RepStr := ThreadItem.Title;
2071 //RepStr := StringReplace(RepStr, '&amp;', '&', [rfReplaceAll]);
2072 RepStr := StringReplace(RepStr, '&lt;', '<', [rfReplaceAll]);
2073 RepStr := StringReplace(RepStr, '&gt;', '>', [rfReplaceAll]);
2074 RepStr := StringReplace(RepStr, '&quot;', '"', [rfReplaceAll]);
2075 RepStr := StringReplace(RepStr, '&amp', '&', [rfReplaceAll]);
2076 //RepStr := StringReplace(RepStr, '鐃緒申鐃?', ',', [rfReplaceAll]);
2077
2078 if Item.SubItems.Count <> 6 then begin
2079 Item.SubItems.Clear;
2080 Item.SubItems.Add('');
2081 Item.SubItems.Add('');
2082 Item.SubItems.Add('');
2083 Item.SubItems.Add('');
2084 Item.SubItems.Add('');
2085 Item.SubItems.Add('');
2086 end;
2087
2088 if ListNumberVisibleAction.Checked then
2089 Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
2090 else
2091 Item.Caption := RepStr;
2092
2093 case ThreadItem.AgeSage of
2094 gasNone: Item.StateIndex := -1;
2095 gasNew: Item.StateIndex := 0;
2096 gasAge: Item.StateIndex := 1;
2097 gasSage: Item.StateIndex := 2;
2098 end;
2099
2100 if ThreadItem.IsLogFile then begin
2101 Item.ImageIndex := ITEM_ICON_THREADLOG1;
2102 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2103 Item.SubItems[1] := IntToStr(ThreadItem.Count);
2104 if ThreadItem.NewResCount = 0 then
2105 Item.SubItems[2] := ''
2106 else
2107 Item.SubItems[2] := IntToStr(ThreadItem.NewResCount);
2108 Item.SubItems[3] := '';
2109 if ThreadItem.Round then
2110 Item.SubItems[4] := ThreadItem.RoundName
2111 else
2112 Item.SubItems[4] := '';
2113 if ThreadItem.RoundDate = ZERO_DATE then begin
2114 Item.SubItems[5] := '';
2115 end else
2116 Item.SubItems[5] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
2117 if ThreadItem.NewArrival then
2118 Item.ImageIndex := ITEM_ICON_THREADNEW1;
2119 end else begin
2120 Item.ImageIndex := ITEM_ICON_THREAD1;
2121 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2122 Item.SubItems[1] := '';
2123 Item.SubItems[2] := '';
2124 Item.SubItems[3] := '';
2125 Item.SubItems[4] := '';
2126 Item.SubItems[5] := '';
2127 end;
2128 Item.Data := ThreadItem;
2129 end;
2130 end;
2131
2132 procedure TGikoForm.ListViewDataFind(Sender: TObject; Find: TItemFind;
2133 const FindString: String; const FindPosition: TPoint; FindData: Pointer;
2134 StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
2135 var Index: Integer);
2136 begin
2137 //
2138 end;
2139
2140 procedure TGikoForm.ListViewDataHint(Sender: TObject; StartIndex,
2141 EndIndex: Integer);
2142 begin
2143 //
2144 end;
2145
2146 procedure TGikoForm.ListViewDataStateChange(Sender: TObject; StartIndex,
2147 EndIndex: Integer; OldState, NewState: TItemStates);
2148 begin
2149 //
2150 end;
2151
2152 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
2153 var
2154 p: TPoint;
2155 s: string;
2156 tmp2: string;
2157 URL: string;
2158 ATitle: Boolean;
2159
2160 wkBBS: string;
2161 wkKey: string;
2162
2163 //wkInt: Integer;
2164 wkIntSt: Integer;
2165 wkIntTo: Integer;
2166
2167 ActiveFileName: string;
2168 e: IHTMLElement;
2169 Ext: string;
2170 PathRec: TPathRec;
2171 begin
2172 try
2173 try
2174 if (FActiveContent <> nil) and (Assigned(Browser.Document)) then begin
2175 if LowerCase(OleVariant(IHTMLDocument2(Browser.Document)).charset) <> 'shift_jis' then
2176 OleVariant(IHTMLDocument2(Browser.Document)).charset := 'shift_jis';
2177 end;
2178 except
2179 end;
2180 finally
2181 end;
2182 if PreviewTimer.Enabled then
2183 PreviewTimer.Enabled := False;
2184 Application.CancelHint;
2185 if GetActiveContent <> nil then
2186 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2187 else
2188 ActiveFileName := '';
2189
2190 StatusBar.Panels[1].Text := Text;
2191
2192 if FHint <> nil then begin
2193 FHint.ReleaseHandle;
2194 FHint.ClearAllRes;
2195 end;
2196 if FPreviewBrowser <> nil then
2197 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2198
2199 if not GikoSys.Setting.UnActivePopup then
2200 if not GikoForm.Active then
2201 Exit;
2202
2203 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2204 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2205
2206 s := '';
2207 Ext := AnsiLowerCase(ExtractFileExt(Text));
2208 if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
2209 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2210 if FPreviewBrowser = nil then begin
2211 FPreviewBrowser := TPreviewBrowser.Create(Self);
2212 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2213 TOleControl(FPreviewBrowser).Parent := nil;
2214 end;
2215 FPreviewBrowser.Navigate('about:blank');//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2216 FPreviewURL := Text;
2217 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2218 PreviewTimer.Enabled := True;
2219 end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
2220 if Pos('mailto:', Text) = 1 then begin
2221 s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
2222 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2223 GetCursorPos(p);
2224 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2225 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2226 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2227 if (Assigned(e)) then begin
2228 tmp2 := GikoSys.ZenToHan(e.Get_outerText);
2229 if (GikoSys.IsNumeric(tmp2)) then begin
2230 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2231 wkBBS := GetActiveContent.ParentBoard.BBSID;
2232 wkKey := ChangeFileExt(GetActiveContent.FileName, '');
2233 wkIntSt := StrToInt(tmp2);
2234 wkIntTo := StrToInt(tmp2);
2235 //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2236 FHint.PopupType := gptThread;
2237 SetResPopupText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2238 end else begin
2239 FHint.PopupType := gptRaw;
2240 FHint.Caption := s;
2241 end;
2242 end;
2243 end else begin
2244 URL := Text;
2245
2246 // 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
2247 if GikoSys.Setting.UseCSS and
2248 FileExists( GikoSys.Setting.CSSFileName + 'Header.html' ) and
2249 (Pos( 'about:blank..', URL ) = 1) then
2250 Exit
2251 else if Pos('about:blank..', URL) = 1 then
2252 URL := StringReplace(URL, 'about:blank..', 'http://www.2ch.net', []);
2253
2254 PathRec := Gikosys.Parse2chURL2(URL);
2255
2256 if PathRec.FDone then begin
2257
2258 wkIntSt := PathRec.FSt;
2259 wkIntTo := PathRec.FTo;
2260
2261 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2262 wkIntSt := 1;
2263 wkIntTo := 1;
2264 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2265 wkIntSt := wkIntTo;
2266 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2267 wkIntTo := wkIntSt;
2268 end else if wkIntSt > wkIntTo then begin
2269 //wkInt := wkIntTo;
2270 wkIntTo := wkIntSt;
2271 wkIntSt := wkIntTo;
2272 end;
2273 //if wkIntSt = 0 then
2274 // wkIntSt := 1;
2275 //if wkINtTo = 0 then
2276 // wkIntTo := 1;
2277 //if PathRec.FFirst then
2278 // wkIntSt := 1;
2279 if PathRec.FStBegin then
2280 wkIntSt := 1;
2281 if PathRec.FToEnd then
2282 wkIntTo := 9999;
2283
2284 ATitle := ActiveFileName <> PathRec.FKey;
2285
2286 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2287 FHint.PopupType := gptThread;
2288 SetResPopupText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2289 end;
2290 end;
2291
2292 //if s <> '' then
2293 // ShowTextPopup(s);
2294 if FHint.PopupType = gptRaw then begin
2295 if FHint.Caption <> '' then
2296 ShowTextPopup;
2297 end else begin
2298 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
2299 ShowTextPopup;
2300 end;
2301 end;
2302 end;
2303
2304 procedure TGikoForm.BrowserTitleChange(Sender: TObject;
2305 const Text: WideString);
2306 var
2307 Title: string;
2308 begin
2309 if (Text = BLANK_HTML) or (Text = GikoSys.GetHtmlTempFileName) then
2310 Title := CAPTION_NAME
2311 else
2312 Title := CAPTION_NAME + ' - [' + Text + ']';
2313 Caption := Title;
2314 //Application.Title := Title;
2315 end;
2316
2317 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2318 var
2319 SysMenu: HMenu;
2320 //SysMenuApp: HMenu;
2321 begin
2322 FEnabledCloseButton := Enabled;
2323 SysMenu := GetSystemMenu(Handle, False);
2324 //SysMenuApp := GetSystemMenu(Application.Handle, False);
2325
2326 if Enabled then begin
2327 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2328 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2329 end else begin
2330 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2331 //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2332 end;
2333
2334 DrawMenuBar(Handle);
2335 //DrawMenuBar(Application.Handle);
2336 end;
2337
2338 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2339 var AllowChange: Boolean);
2340 begin
2341 if FTreeType = gtt2ch then
2342 FSortIndex := -1;
2343 end;
2344
2345 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2346 Shift: TShiftState);
2347 begin
2348 if Key = VK_BACK then begin
2349 // UpFolderButtonClick(Sender);
2350 end else if Key = VK_SPACE then begin
2351 // ListClick;
2352 end else if Key = VK_RETURN then begin
2353 ListDoubleClick;
2354 end;
2355 end;
2356
2357 function TGikoForm.GetHttpState: Boolean;
2358 begin
2359 Result := FHttpState;
2360 end;
2361
2362 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2363 Column: TListColumn);
2364 var
2365 i: Integer;
2366 wkBBS: TBBS2ch;
2367 wkCategory: TCategory;
2368 wkBoard: TBoard;
2369 begin
2370 if FSortIndex = Column.Index then
2371 FSortOrder := not FSortOrder
2372 else
2373 FSortOrder := False;
2374
2375 for i := 0 to ListView.Columns.Count - 1 do
2376 ListView.Column[i].ImageIndex := -1;
2377 if FSortOrder then
2378 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT1
2379 else
2380 ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT2;
2381
2382 Sort.SortNoFlag := ListNumberVisibleAction.Checked;
2383
2384 if TObject(TreeView.Selected.Data) is TBBS2ch then begin
2385 wkBBS := TBBS2ch(TreeView.Selected.Data);
2386 Sort.SortOrder := FSortOrder;
2387 Sort.SortIndex := Column.Index;
2388 wkBBS.Sort(CategorySortProc);
2389 ListView.Refresh;
2390 end else if TObject(TreeView.Selected.Data) is TCategory then begin
2391 wkCategory := TCategory(TreeView.Selected.Data);
2392 Sort.SortOrder := FSortOrder;
2393 Sort.SortIndex := Column.Index;
2394 wkCategory.Sort(BoardSortProc);
2395 ListView.Refresh;
2396 end else if TObject(TreeView.Selected.Data) is TBoard then begin
2397 wkBoard := TBoard(TreeView.Selected.Data);
2398 Sort.SortOrder := FSortOrder;
2399 Sort.SortIndex := Column.Index;
2400 wkBoard.Sort(ThreadItemSortProc);
2401 ListView.Refresh;
2402 end;
2403 FSortIndex := Column.Index;
2404 end;
2405
2406 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2407 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2408 var
2409 ARect: TRect;
2410 begin
2411 DefaultDraw := True;
2412 Exit;
2413 DefaultDraw := False;
2414 if (cdsSelected in State) or (cdsHot in State) then begin
2415 Sender.Canvas.Brush.Color := clHighlight;
2416 Sender.Canvas.Font.Color := clHighlightText;
2417 end else begin
2418 Sender.Canvas.Brush.Color := clBtnFace;
2419 Sender.Canvas.Font.Color := clBtnText;
2420 end;
2421 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2422 Sender.Canvas.FillRect(ARect);
2423 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2424 end;
2425
2426 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2427 var
2428 Nodes: TTreeNodes;
2429 i: integer;
2430 begin
2431 Nodes := TreeView.Items;
2432
2433 for i := 0 to Nodes.Count - 1 do begin
2434 if Nodes.Item[i].Data = Data then begin
2435 Result := Nodes.Item[i];
2436 Exit;
2437 end;
2438 end;
2439 Result := nil;
2440 end;
2441
2442 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2443 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2444 Headers: OleVariant; var Cancel: WordBool);
2445 var
2446 sNo: string;
2447 p: TPoint;
2448 const
2449 kMenuName: string = 'menu:';
2450 begin
2451
2452 if Pos(kMenuName, URL) <> 0 then begin
2453 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2454
2455 if not GikoSys.IsNumeric(sNo) then Exit;
2456
2457 Cancel := True;
2458 GetCursorpos(p);
2459 KokoPopupMenu.Tag := StrToInt(sNo);
2460 KokoPopupMenu.Popup(p.x, p.y);
2461 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2462 Cancel := not GikoSys.Setting.OpenMailer;
2463 end;
2464
2465 end;
2466
2467 procedure TGikoForm.ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
2468 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
2469 var DefaultDraw: Boolean);
2470 var
2471 ThreadItem: TThreadItem;
2472 begin
2473 DefaultDraw := True;
2474 // TListView(Sender).Canvas.Font.Style := [];
2475 if TObject(Item.Data) is TThreadItem then begin
2476 ThreadItem := TThreadItem(Item.Data);
2477 // if (ThreadItem.Kokomade <> ThreadItem.Count) and (ThreadItem.IsLogFile) then
2478 if ThreadItem.UnRead then
2479 TListView(Sender).Canvas.Font.Style := [fsBold];
2480 end;
2481 end;
2482
2483 procedure TGikoForm.AppFormDeactivate(Sender: TObject);
2484 begin
2485 if Application.Terminated then
2486 Exit;
2487 if PreviewTimer.Enabled then
2488 PreviewTimer.Enabled := False;
2489 //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2490 if FHint <> nil then begin
2491 FHint.ReleaseHandle;
2492 FHint.ClearAllRes;
2493 // FHint.Free;
2494 // FHint := nil;
2495 end;
2496 if FPreviewBrowser <> nil then
2497 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2498
2499 end;
2500
2501 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2502 const ARect: TRect; var DefaultDraw: Boolean);
2503 var
2504 NodeRect: TRect;
2505 i, j: Integer;
2506 IsBoardNode: Boolean;
2507 Cnt: Integer;
2508 CntText: string;
2509 TextWidth: Integer;
2510 TextRect: TRect;
2511 Board: TBoard;
2512 Category: TCategory;
2513 Bitmap: TBitmap;
2514 NodeWidth: Integer;
2515 begin
2516 DefaultDraw := True;
2517
2518 if FTreeType = gttHistory then Exit;
2519
2520 TreeView.Canvas.Font.Color := clBlue;
2521 IsBoardNode := False;
2522 Cnt := 0;
2523 for i := 0 to TreeView.Items.Count - 1 do begin
2524
2525 if not TreeView.Items[i].IsVisible then
2526 continue;
2527
2528 if TObject(TreeView.Items[i].Data) is TCategory then begin
2529 if TreeView.Items[i].Expanded then
2530 continue;
2531
2532 IsBoardNode := False;
2533 Category := TCategory(TreeView.Items[i].Data);
2534 for j := 0 to Category.Count - 1 do begin
2535 Board := Category.Items[j];
2536 if Board <> nil then begin
2537 if Board.UnRead > 0 then begin
2538 Cnt := 1;
2539 Break;
2540 end;
2541 end;
2542 end;
2543 if Cnt <> 1 then
2544 continue;
2545 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2546 IsBoardNode := True;
2547 Board := TBoard(TreeView.Items[i].Data);
2548 Cnt := Board.UnRead;
2549 if Cnt <= 0 then
2550 continue;
2551 end else
2552 continue;
2553
2554 Bitmap := TBitmap.Create;
2555 try
2556 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2557 Bitmap.Canvas.Font.Style := [fsBold];
2558 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2559 finally
2560 Bitmap.Free;
2561 end;
2562
2563 NodeRect := TreeView.Items[i].DisplayRect(True);
2564
2565 if IsBoardNode then
2566 CntText := '(' + IntToStr(Cnt) + ')'
2567 else
2568 CntText := '(+)';
2569
2570 TextWidth := TreeView.Canvas.TextWidth(CntText);
2571
2572 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2573 NodeRect.Top,
2574 NodeRect.Left + NodeWidth + TextWidth + 8,
2575 NodeRect.Bottom);
2576 DrawText(TreeView.Canvas.Handle,
2577 PChar(CntText),
2578 -1,
2579 TextRect,
2580 DT_SINGLELINE or DT_VCENTER);
2581 end;
2582 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2583 end;
2584
2585 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2586 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2587 var
2588 Board: TBoard;
2589 Category: TCategory;
2590 i: Integer;
2591 begin
2592 DefaultDraw := True;
2593
2594 if FTreeType = gttHistory then Exit;
2595
2596 TreeView.Canvas.Font.Style := [];
2597 if Node <> nil then begin
2598 if TObject(Node.Data) is TCategory then begin
2599 Category := TCategory(Node.Data);
2600 for i := 0 to Category.Count - 1 do begin
2601 Board := Category.Items[i];
2602 if Board <> nil then begin
2603 if Board.UnRead > 0 then begin
2604 TreeView.Canvas.Font.Style := [fsBold];
2605 Break;
2606 end;
2607 end;
2608 end;
2609 end else if TObject(Node.Data) is TBoard then begin
2610 Board := TBoard(Node.Data);
2611 if Board.UnRead > 0 then
2612 TreeView.Canvas.Font.Style := [fsBold];
2613 end;
2614 end;
2615 end;
2616
2617 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2618 begin
2619 TreeView.Invalidate;
2620
2621 if TObject(Node.Data) is TBBS2ch then begin
2622 TBBS2ch(Node.Data).NodeExpand := True;
2623 end else if TObject(Node.Data) is TCategory then begin
2624 TCategory(Node.Data).NodeExpand := True;
2625 end else if TObject(Node.Data) is TBoard then begin
2626 TBoard(Node.Data).NodeExpand := True;
2627 end;
2628 end;
2629
2630 {procedure TGikoForm.CabinetPanelVisible(PanelVisible: Boolean);
2631 begin
2632 TreeSplitter.Visible := PanelVisible;
2633 CabinetPanel.Visible := PanelVisible;
2634 CabinetToolButton.Down := PanelVisible;
2635 end;}
2636
2637 procedure TGikoForm.ListViewAllSelect;
2638 begin
2639 ListView.SetFocus;
2640 ListView.SelectAll;
2641 end;
2642
2643 procedure TGikoForm.TreeViewDblClick(Sender: TObject);
2644 var
2645 Board: TBoard;
2646 ThreadItem: TThreadItem;
2647 APoint: TPoint;
2648 HitTest: THitTests;
2649 begin
2650 GetCursorPos(APoint);
2651 APoint := TreeView.ScreenToClient(APoint);
2652 HitTest := TreeView.GetHitTestInfoAt(APoint.x, APoint.y);
2653 if not (htOnLabel in HitTest) then Exit;
2654 if TreeView.Selected = nil then Exit;
2655
2656 if FTreeType = gtt2ch then begin
2657 if not (TObject(TreeView.Selected.Data) is TBoard) then Exit;
2658 Board := TBoard(TreeView.Selected.Data);
2659 DownloadList(Board);
2660 end else if FTreeType = gttHistory then begin
2661 if not (TObject(TreeView.Selected.Data) is TThreadItem) then Exit;
2662 ThreadItem := TThreadItem(TreeView.Selected.Data);
2663 DownloadContent(ThreadItem);
2664 end;
2665 end;
2666
2667 procedure TGikoForm.FavoriteTreeViewClick(Sender: TObject);
2668 begin
2669
2670 FavoriteClick( TObject( FavoriteTreeView.Selected ) );
2671
2672 end;
2673
2674 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2675 begin
2676 AddMessageList(Msg, nil, Icon);
2677 end;
2678
2679 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2680 var
2681 ATitle: string;
2682 s: string;
2683 begin
2684 try
2685 if Item.DownType = gdtBoard then
2686 ATitle := Item.Board.Title
2687 else
2688 ATitle := Item.ThreadItem.Title;
2689 if ATitle = '' then
2690 ATitle := '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?';
2691
2692 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2693 //鐃緒申鐃緒申鐃?鐃緒申
2694 if Item.DownType = gdtBoard then begin
2695 //鐃緒申
2696 Item.SaveListFile;
2697 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2698 if GetActiveList = Item.Board then
2699 SetActiveList(Item.Board);
2700 Item.Board.Modified := True;
2701 Item.Board.IsThreadDatRead := True;
2702 PlaySound('New');
2703 end else if Item.DownType = gdtThread then begin
2704 //鐃?鐃緒申
2705 Item.SaveItemFile;
2706 Item.ThreadItem.NewArrival := True;
2707 if AddHistory(Item.ThreadItem) then begin
2708 if GetActiveContent = Item.ThreadItem then
2709 InsertBrowserTab(Item.ThreadItem)
2710 else
2711 InsertBrowserTab(Item.ThreadItem, False);
2712 end;
2713
2714 if Item.State = gdsComplete then begin
2715 PlaySound('New');
2716 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2717 end else begin
2718 PlaySound('NewDiff');
2719 AddMessageList(ATitle + ' [鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申]', nil, gmiOK);
2720 end;
2721
2722 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2723 if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
2724 Item.ThreadItem.Round := False;
2725 Item.ThreadItem.RoundName := '';
2726 AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
2727 end;
2728
2729 TreeView.Refresh;
2730 end;
2731 ListView.Refresh;
2732 end else if Item.State = gdsNotModify then begin
2733 //鐃緒申鐃?鐃?鐃?
2734 { if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
2735 //SetContent(Item.ThreadItem);
2736 InsertBrowserTab(Item.ThreadItem);
2737 end;}
2738 AddMessageList(ATitle + ' [鐃緒申鐃?鐃?]', nil, gmiSAD);
2739 PlaySound('NoChange');
2740 Screen.Cursor := crDefault;
2741 end else if Item.State = gdsAbort then begin
2742 //鐃緒申鐃?
2743 AddMessageList(ATitle + ' [鐃緒申鐃?]', nil, gmiSAD);
2744 end else if Item.State = gdsError then begin
2745 //鐃?鐃緒申鐃?
2746 s := Item.ErrText;
2747 if s <> '' then
2748 s := ':' + s;
2749 AddMessageList(ATitle + ' [鐃?鐃緒申鐃?(' + IntToStr(Item.ResponseCode) + s + ')]', nil, gmiNG);
2750 // if Item.ResponseCode = 302 then
2751 // AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG);
2752 PlaySound('Error');
2753 end;
2754 finally
2755 Item.Free;
2756 Dec(FWorkCount);
2757 if FWorkCount < 0 then FWorkCount := 0;
2758 if FWorkCount = 0 then begin
2759 try
2760 Animate.Active := False;
2761 except
2762 Screen.Cursor := crDefault;
2763 end;
2764 end;
2765
2766 end;
2767 end;
2768
2769 procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer);
2770 begin
2771 // SetProgressValue(Number, 0, AWorkCountMax);
2772 // ProgressBar.Visible := True;
2773 ProgressBar.Position := 0;
2774 ProgressBar.Max := AWorkCountMax;
2775 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申';
2776 FDownloadMax := AWorkCountMax;
2777 end;
2778
2779 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
2780 begin
2781 // ProgressBar.Visible := False;
2782 ProgressBar.Position := 0;
2783 // SetProgressValue(Number, 0);
2784 if FDownloadMax <> 0 then
2785 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
2786 end;
2787
2788 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
2789 begin
2790 ProgressBar.Position := AWorkCount;
2791 // SetProgressValue(Number, AWorkCount);
2792 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
2793 end;
2794
2795 {
2796 procedure TGikoForm.SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
2797 var
2798 Component: TComponent;
2799 begin
2800 Component := FindComponent('ProgressBar' + IntToStr(Number + 1));
2801 if Component <> nil then begin
2802 if not (Component is TProgressBar) then Exit;
2803 if Max <> -1 then
2804 TProgressBar(Component).Max := Max;
2805 TProgressBar(Component).Position := Value;
2806 end;
2807 end;
2808 }
2809
2810 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
2811 var
2812 ListItem: TListItem;
2813 begin
2814 MessageListView.Items.BeginUpdate;
2815 try
2816 ListItem := MessageListView.Items.Add;
2817 ListItem.Caption := ACaption;
2818 ListItem.Data := AObject;
2819 ListItem.MakeVisible(False);
2820 case Icon of
2821 gmiOK: ListItem.ImageIndex := 0;
2822 gmiSAD: ListItem.ImageIndex := 1;
2823 gmiNG: ListItem.ImageIndex := 2;
2824 gmiWhat: ListItem.ImageIndex := 3;
2825 end;
2826 finally
2827 MessageListView.Items.EndUpdate;
2828 end;
2829 end;
2830
2831 {procedure TGikoForm.BrowserTabChange(Sender: TObject);
2832 var
2833 index: Integer;
2834 ThreadItem: TThreadItem;
2835 begin
2836 ThreadItem := GetActiveContent;
2837 if ThreadItem <> nil then begin
2838 SetContent(ThreadItem);
2839 end;
2840 end;}
2841
2842 procedure TGikoForm.InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);
2843 var
2844 i: Integer;
2845 // OldIndex: Integer;
2846 begin
2847 if ThreadItem.IsLogFile then begin
2848 for i := 0 to BrowserTab.Tabs.Count - 1 do begin
2849 if TObject(BrowserTab.Tabs.Objects[i]) is TThreadItem then begin
2850 if TThreadItem(BrowserTab.Tabs.Objects[i]) = ThreadItem then begin
2851 if ActiveTab then begin
2852 //OldIndex := BrowserTab.TabIndex;
2853 BrowserTab.TabIndex := i;
2854 // if OldIndex <> i then
2855 BrowserTab.OnChange(nil);
2856 BrowserTab.Repaint;
2857 end;
2858 Exit;
2859 end;
2860 end;
2861 end;
2862 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
2863 BrowserTab.Tabs.Insert(0, GikoSys.GetShortName(ThreadItem.Title, 20));
2864 BrowserTab.Tabs.Objects[0] := ThreadItem;
2865 if ActiveTab then
2866 BrowserTab.TabIndex := 0;
2867 end else begin
2868 i := BrowserTab.Tabs.Add(GikoSys.GetShortName(ThreadItem.Title, 20));
2869 BrowserTab.Tabs.Objects[i] := ThreadItem;
2870 if ActiveTab then
2871 BrowserTab.TabIndex := i;
2872 end;
2873 if ActiveTab then begin
2874 BrowserTab.OnChange(nil);
2875 BrowserNullTab := nil;
2876 end;
2877 end else begin
2878 //OldIndex := BrowserTab.TabIndex;
2879 BrowserNullTab := ThreadItem;
2880 BrowserTab.TabIndex := -1;
2881 // if OldIndex = -1 then
2882 BrowserTab.OnChange(nil);
2883 end;
2884 BrowserTab.Repaint;
2885 if GikoSys.Setting.URLDisplay then
2886 AddressComboBox.Text := GikoSys.GetURL(ThreadItem.ParentBoard.BBSID, ThreadItem.FileName);
2887 end;
2888
2889 procedure TGikoForm.SetContent(ThreadItem: TThreadItem);
2890 var
2891 BBSID: string;
2892 FileName: string;
2893 sTitle: string;
2894 // HtmlName: string;
2895 doc: Variant;
2896 s: string;
2897 OldCursor: TCursor;
2898 //i: Integer;
2899 begin
2900 while (Browser.ReadyState <> READYSTATE_COMPLETE) and
2901 (Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
2902 Application.ProcessMessages;
2903 end;
2904
2905 if (FActiveContent <> nil) and (Assigned(Browser.Document)) then begin
2906 try
2907 try
2908 Sleep(1);
2909 Application.ProcessMessages;
2910 FActiveContent.ScrollTop := OleVariant(IHTMLDocument2(Browser.Document)).Body.ScrollTop;
2911 except
2912 on E: Exception do
2913 MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0);
2914 end;
2915 finally
2916 end;
2917 end;
2918
2919 FActiveContent := ThreadItem;
2920
2921 if ThreadItem = nil then begin
2922 Browser.Navigate(BLANK_HTML);
2923 BrowserBoardNameLabel.Caption := '';
2924 ItemBoardImage.Picture := nil;
2925 BrowserNameLabel.Caption := '';
2926 ItemImage.Picture := nil;
2927 FActiveContent := nil;
2928 Exit;
2929 end;
2930
2931 BBSID := ThreadItem.ParentBoard.BBSID;
2932 FileName := ThreadItem.FileName;
2933
2934 if GetCapture = ListView.Handle then
2935 ReleaseCapture;
2936
2937 //OldCursor := Screen.Cursor;
2938 Screen.Cursor := crHourGlass;
2939 try
2940 if ThreadItem.UnRead then begin
2941 ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1;
2942 if ThreadItem.ParentBoard.UnRead < 0 then ThreadItem.ParentBoard.UnRead := 0;
2943 TreeView.Refresh;
2944 end;
2945
2946 if not ThreadItem.IsLogFile then begin
2947
2948 if (not Assigned(Browser.Document)) then begin
2949 Browser.Navigate('about:blank');
2950 while (not Assigned(Browser.Document)) do begin
2951 Application.ProcessMessages;
2952 end;
2953 end;
2954 try
2955 s := '<HTML><BODY><CENTER>鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申</CENTER></BODY></HTML>';
2956 doc := Browser.Document;
2957 doc.open;
2958 doc.charset := 'Shift_JIS';
2959 doc.Write(s);
2960 doc.Close;
2961 finally
2962 end;
2963 end else begin
2964 GikoSys.CreateHTML2(Browser.Document, ThreadItem, sTitle);
2965 while (Browser.ReadyState <> READYSTATE_COMPLETE) and
2966 (Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
2967 Application.ProcessMessages;
2968 end;
2969 Sleep(1);
2970 Application.ProcessMessages;
2971 try
2972 if ThreadItem.UnRead then
2973 BrowserMovement('new');
2974 except
2975 end;
2976 if (ThreadItem.ScrollTop <> 0) and (not ThreadItem.UnRead) then begin
2977 //i := 0;
2978 try
2979 try
2980 doc := Browser.Document;
2981 doc.Body.ScrollTop := ThreadItem.ScrollTop;
2982 except
2983 on E: Exception do
2984 MsgBox(Handle, E.Message, 'SetContent[ScrollTop<-]', 0);
2985 end;
2986 finally
2987 end;
2988 end;
2989 ThreadItem.UnRead := False;
2990 ListView.Refresh;
2991 end;
2992
2993 BrowserBoardNameLabel.Caption := ThreadItem