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.44 - (show annotations) (download) (as text)
Fri Sep 12 15:47:01 2003 UTC (20 years, 7 months ago) by h677
Branch: MAIN
Changes since 1.43: +1 -0 lines
File MIME type: text/x-pascal
未更新の時、カーソルが砂時計のままになるのを元に戻すようにした。

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