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.63 - (show annotations) (download) (as text)
Fri Sep 26 10:50:30 2003 UTC (20 years, 6 months ago) by yoffy
Branch: MAIN
Changes since 1.62: +1 -1 lines
File MIME type: text/x-pascal
・オプションダイアログの [CSS とスキン] にプレビューを追加。

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