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.35 - (show annotations) (download) (as text)
Tue Sep 2 13:27:07 2003 UTC (20 years, 7 months ago) by h677
Branch: MAIN
Changes since 1.34: +59 -6 lines
File MIME type: text/x-pascal
個別あぼーんを実装

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