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.48 - (show annotations) (download) (as text)
Sat Sep 20 15:41:19 2003 UTC (20 years, 7 months ago) by yoffy
Branch: MAIN
Changes since 1.47: +14 -14 lines
File MIME type: text/x-pascal
・MoveToURL および InsertBrowserTab を private から public に。
・現在の res\Toolbar にあるアイコンとアイコン番号が一致していないので修正。

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