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.13 - (show annotations) (download) (as text)
Wed Aug 13 19:53:02 2003 UTC (20 years, 8 months ago) by yoffy
Branch: MAIN
Changes since 1.12: +10 -4 lines
File MIME type: text/x-pascal
・レス絞込みダイアログで [キャンセル] ボタンを押すとエラーが発生してしまうのを修正。

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