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.12 - (show annotations) (download) (as text)
Wed Aug 13 19:35:01 2003 UTC (20 years, 8 months ago) by yoffy
Branch: MAIN
Changes since 1.11: +44 -1 lines
File MIME type: text/x-pascal
・レス絞込みのインターフェースを追加。
・NGワード再読み込みでスレッドが再描画されるようになった。

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