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.17 - (show annotations) (download) (as text)
Fri Aug 15 07:18:50 2003 UTC (20 years, 8 months ago) by yoffy
Branch: MAIN
Changes since 1.16: +10 -0 lines
File MIME type: text/x-pascal
・スレッド絞込みが使えなくなる問題の応急処置その2。

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