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.687 - (show annotations) (download) (as text)
Sat Mar 21 13:15:02 2009 UTC (15 years, 1 month ago) by h677
Branch: MAIN
CVS Tags: v1_60_0_786, v1_60_0_787
Changes since 1.686: +10 -0 lines
File MIME type: text/x-pascal
ブラウザレスポップアップで、レスポップアップ中のスレッドがアクティブスレッドと
誤認する問題の対応

1 unit Giko;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils,
8 {$IF Defined(DELPRO) }
9 SHDocVw,
10 MSHTML,
11 {$ELSE}
12 SHDocVw_TLB,
13 MSHTML_TLB,
14 {$IFEND}
15 IdHTTP, ActiveX, ActnList, ImgList,
16 ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils,
17 CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload,
18 Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent,
19 {HintWindow,} GikoCoolBar, GikoListView, Search, ExternalBoardManager,
20 ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,
21 IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem,
22 ShellAPI,Preview, HistoryList, ResPopupBrowser, ExtPreviewDatamodule;
23
24 const
25 NGWORDNAME_PANEL = 3;
26 THREADSIZE_PANEL = 2;
27 USER_RESPOPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser
28
29 type
30
31 TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
32 TMinimizeType = (mtNone, mtMinimizing, mtMinimized);
33 TResizeType = (rtNone, rtResizing);
34
35 // TBrowserRecord = class;
36
37 TGikoForm = class(TForm)
38 StatusBar: TStatusBar;
39 MainPanel: TPanel;
40 ClientPanel: TPanel;
41 TreeSplitter: TSplitter;
42 CabinetPanel: TPanel;
43 TreeView: TTreeView;
44 ThreadMainPanel: TPanel;
45 ListSplitter: TSplitter;
46 ViewPanel: TPanel;
47 ListView: TGikoListView;
48 ThreadPanel: TPanel;
49 MessagePanel: TPanel;
50 MessageBar: TPanel;
51 MessageHideButton: TSpeedButton;
52 MessageListView: TListView;
53 MessageSplitter: TSplitter;
54 Panel3: TPanel;
55 CabinetCloseSpeedButton: TSpeedButton;
56 ToolBar1: TToolBar;
57 CabinetSelectToolButton: TToolButton;
58 HistoryToolBar: TToolBar;
59 HistoryShowToolButton: TToolButton;
60 HistoryAllClearToolButton: TToolButton;
61 ItemIcon16: TImageList;
62 ItemIcon32: TImageList;
63 HotToobarImageList: TImageList;
64 ItemImageList: TImageList;
65 MainMenu: TMainMenu;
66 FileMenu: TMenuItem;
67 DeleteMenu: TMenuItem;
68 ExitMenu: TMenuItem;
69 KidokuMenu: TMenuItem;
70 MidokuMenu: TMenuItem;
71 AllSelectMenu: TMenuItem;
72 ViewMenu: TMenuItem;
73 StdToolBarMenu: TMenuItem;
74 CabinetMenu: TMenuItem;
75 H1: TMenuItem;
76 N4: TMenuItem;
77 CabinetVisibleMenu: TMenuItem;
78 MessageMenu: TMenuItem;
79 StatusBarMenu: TMenuItem;
80 MMSep03: TMenuItem;
81 LargeIconMenu: TMenuItem;
82 SmallIconMenu: TMenuItem;
83 ListMenu: TMenuItem;
84 DetailMenu: TMenuItem;
85 ToolMenu: TMenuItem;
86 Find1: TMenuItem;
87 RoundMenu: TMenuItem;
88 MMSep04: TMenuItem;
89 OptionMenu: TMenuItem;
90 HelpMenu: TMenuItem;
91 G1: TMenuItem;
92 N1: TMenuItem;
93 AboutMenu: TMenuItem;
94 BrowserPopupMenu: TPopupMenu;
95 ShowThreadMenu: TMenuItem;
96 ShowBoardMenu: TMenuItem;
97 ListIconPopupMenu: TPopupMenu;
98 LargeIconPMenu: TMenuItem;
99 SmallIconPMenu: TMenuItem;
100 ListPMenu: TMenuItem;
101 DetailPMenu: TMenuItem;
102 ClosePopupMenu: TPopupMenu;
103 CloseMenu: TMenuItem;
104 U1: TMenuItem;
105 N3: TMenuItem;
106 B1: TMenuItem;
107 S1: TMenuItem;
108 N2: TMenuItem;
109 A1: TMenuItem;
110 L1: TMenuItem;
111 N5: TMenuItem;
112 S2: TMenuItem;
113 ListPopupMenu: TPopupMenu;
114 ListRoundPMenu: TMenuItem;
115 ListReservPMenu: TMenuItem;
116 LPMSep01: TMenuItem;
117 ItemRoundPMenu: TMenuItem;
118 LPMSep02: TMenuItem;
119 KidokuPMenu: TMenuItem;
120 MidokuPMenu: TMenuItem;
121 AllSelectPMenu: TMenuItem;
122 UrlCopyPMenu: TMenuItem;
123 LPMSep05: TMenuItem;
124 DeletePMenu: TMenuItem;
125 LPMSep06: TMenuItem;
126 ViewPMenu: TMenuItem;
127 LargeIconLPMenu: TMenuItem;
128 SmallIconLPMenu: TMenuItem;
129 ListLPMenu: TMenuItem;
130 DetailLPMenu: TMenuItem;
131 T1: TMenuItem;
132 B2: TMenuItem;
133 N8: TMenuItem;
134 URLC1: TMenuItem;
135 N9: TMenuItem;
136 N10: TMenuItem;
137 G2: TMenuItem;
138 N11: TMenuItem;
139 T3: TMenuItem;
140 L2: TMenuItem;
141 N12: TMenuItem;
142 K1: TMenuItem;
143 N13: TMenuItem;
144 N14: TMenuItem;
145 R1: TMenuItem;
146 A2: TMenuItem;
147 N15: TMenuItem;
148 KokoPopupMenu: TPopupMenu;
149 KokomadePMenu: TMenuItem;
150 AllPMenu: TMenuItem;
151 MenuItem1: TMenuItem;
152 MenuItem2: TMenuItem;
153 BrowserTabPopupMenu: TPopupMenu;
154 Close1: TMenuItem;
155 A3: TMenuItem;
156 N16: TMenuItem;
157 A4: TMenuItem;
158 TreePopupMenu: TPopupMenu;
159 TreeSelectThreadPupupMenu: TMenuItem;
160 TreeSelectBoardPupupMenu: TMenuItem;
161 TPMSep01: TMenuItem;
162 TreeSelectURLPupupMenu: TMenuItem;
163 T2: TMenuItem;
164 L3: TMenuItem;
165 B3: TMenuItem;
166 BrowserBottomPanel: TGikoPanel;
167 CabinetSelectPopupMenu: TPopupMenu;
168 H2: TMenuItem;
169 ItemReservPMenu: TMenuItem;
170 RoundNamePopupMenu: TPopupMenu;
171 N7: TMenuItem;
172 B4: TMenuItem;
173 L4: TMenuItem;
174 K2: TMenuItem;
175 A5: TMenuItem;
176 A6: TMenuItem;
177 C1: TMenuItem;
178 V1: TMenuItem;
179 N19: TMenuItem;
180 D1: TMenuItem;
181 D2: TMenuItem;
182 MessageImageList: TImageList;
183 ProgressBar: TProgressBar;
184 URL1: TMenuItem;
185 NameUrlCopyPMenu: TMenuItem;
186 URLC2: TMenuItem;
187 URLN1: TMenuItem;
188 N21: TMenuItem;
189 URLC3: TMenuItem;
190 URLN2: TMenuItem;
191 N23: TMenuItem;
192 ListCoolBar: TGikoCoolBar;
193 ListToolBar: TToolBar;
194 BrowserCoolBar: TGikoCoolBar;
195 BrowserToolBar: TToolBar;
196 ListNameToolBar: TToolBar;
197 ListNameLabel: TLabel;
198 FolderImage: TImage;
199 BrowserNameToolBar: TToolBar;
200 ItemBoardImage: TImage;
201 BrowserBoardNameLabel: TLabel;
202 ItemImage: TImage;
203 BrowserNameLabel: TLabel;
204 D3: TMenuItem;
205 N25: TMenuItem;
206 N26: TMenuItem;
207 D4: TMenuItem;
208 S3: TMenuItem;
209 R2: TMenuItem;
210 TreeSelectNameURLPupupMenu: TMenuItem;
211 N27: TMenuItem;
212 H3: TMenuItem;
213 I1: TMenuItem;
214 BrowserTabToolBar: TToolBar;
215 BrowserTab: TTabControl;
216 About1: TMenuItem;
217 N28: TMenuItem;
218 S4: TMenuItem;
219 N29: TMenuItem;
220 N30: TMenuItem;
221 N31: TMenuItem;
222 L5: TMenuItem;
223 L6: TMenuItem;
224 A7: TMenuItem;
225 R3: TMenuItem;
226 FavoriteMenu: TMenuItem;
227 N32: TMenuItem;
228 BoardFavoriteAddMenu: TMenuItem;
229 ThreadFavoriteAddMenu: TMenuItem;
230 N33: TMenuItem;
231 TreeSelectFavoriteAddPupupMenu: TMenuItem;
232 FavoriteTreeView: TTreeView;
233 StateIconImageList: TImageList;
234 TopPanel: TPanel;
235 TopRightPanel: TPanel;
236 AnimePanel: TPanel;
237 Animate: TAnimate;
238 TopCoolPanel: TPanel;
239 MainCoolBar: TGikoCoolBar;
240 MenuToolBar: TToolBar;
241 StdToolBar: TToolBar;
242 AddressToolBar: TToolBar;
243 AddressComboBox: TComboBox;
244 MoveToToolButton: TToolButton;
245 AddressImageList: TImageList;
246 AddressToolBarMenu: TMenuItem;
247 T4: TMenuItem;
248 Show1: TMenuItem;
249 N34: TMenuItem;
250 T5: TMenuItem;
251 B5: TMenuItem;
252 N35: TMenuItem;
253 A8: TMenuItem;
254 U2: TMenuItem;
255 F1: TMenuItem;
256 PreviewTimer: TTimer;
257 MonazillaWebPageAction1: TMenuItem;
258 N36: TMenuItem;
259 H4: TMenuItem;
260 K3: TMenuItem;
261 L7: TMenuItem;
262 N37: TMenuItem;
263 A9: TMenuItem;
264 ChevronPopupMenu: TPopupMenu;
265 N2N1: TMenuItem;
266 N38: TMenuItem;
267 F2: TMenuItem;
268 LinkToolBar: TToolBar;
269 a10: TMenuItem;
270 N39: TMenuItem;
271 T6: TMenuItem;
272 N40: TMenuItem;
273 LinkBarPopupMenu: TPopupMenu;
274 T7: TMenuItem;
275 ThreadPopupMenu: TPopupMenu;
276 MenuItem4: TMenuItem;
277 MenuItem5: TMenuItem;
278 MenuItem6: TMenuItem;
279 T8: TMenuItem;
280 URLN3: TMenuItem;
281 SelectItemNameCopyAction1: TMenuItem;
282 B6: TMenuItem;
283 T9: TMenuItem;
284 NameCopyPMenu: TMenuItem;
285 SelectComboBox: TComboBox;
286 MainCoolBarPopupMenu: TPopupMenu;
287 StdToolBarVisiblePMenu: TMenuItem;
288 AddressToolBarVisiblePMenu: TMenuItem;
289 LinkToolBarVisiblePMenu: TMenuItem;
290 NG1: TMenuItem;
291 NG2: TMenuItem;
292 N43: TMenuItem;
293 N44: TMenuItem;
294 L9: TMenuItem;
295 I3: TMenuItem;
296 N45: TMenuItem;
297 B9: TMenuItem;
298 R5: TMenuItem;
299 T12: TMenuItem;
300 Show3: TMenuItem;
301 N46: TMenuItem;
302 T13: TMenuItem;
303 B10: TMenuItem;
304 N47: TMenuItem;
305 A12: TMenuItem;
306 U4: TMenuItem;
307 F4: TMenuItem;
308 N48: TMenuItem;
309 T14: TMenuItem;
310 N50: TMenuItem;
311 A11: TMenuItem;
312 S5: TMenuItem;
313 Reload: TMenuItem;
314 GoBack: TMenuItem;
315 GoFoward: TMenuItem;
316 IndividualAbon1: TMenuItem;
317 N41: TMenuItem;
318 IndividualAbon2: TMenuItem;
319 AntiIndivAbonMenuItem: TMenuItem;
320 AntiIndividualAbon: TMenuItem;
321 N49: TMenuItem;
322 N51: TMenuItem;
323 N52: TMenuItem;
324 SearchBoardName: TMenuItem;
325 TreeSelectLogDeleteSeparator: TMenuItem;
326 N54: TMenuItem;
327 A13: TMenuItem;
328 FavoriteTreePopupMenu: TPopupMenu;
329 FavoriteTreeRenamePopupMenu: TMenuItem;
330 FavoriteTreeNewFolderPopupMenu: TMenuItem;
331 N56: TMenuItem;
332 FavoriteTreeDeletePopupMenu: TMenuItem;
333 FavoriteToolBar: TToolBar;
334 FavoriteAddToolButton: TToolButton;
335 FavoriteArrangeToolButton: TToolButton;
336 FavoriteTreeBrowseFolderPopupMenu: TMenuItem;
337 N57: TMenuItem;
338 FavoriteTreeReloadPopupMenu: TMenuItem;
339 N58: TMenuItem;
340 FavoriteTreeURLCopyPopupMenu: TMenuItem;
341 FavoriteTreeNameCopyPopupMenu: TMenuItem;
342 FavoriteTreeLogDeletePopupMenu: TMenuItem;
343 N59: TMenuItem;
344 FavoriteTreeNameURLCopyPopupMenu: TMenuItem;
345 N60: TMenuItem;
346 ExportFavoriteFileAction1: TMenuItem;
347 N6: TMenuItem;
348 N17: TMenuItem;
349 N18: TMenuItem;
350 N20: TMenuItem;
351 N24: TMenuItem;
352 N62: TMenuItem;
353 N61: TMenuItem;
354 N63: TMenuItem;
355 N64: TMenuItem;
356 dummy1: TMenuItem;
357 TreeSelectLogDeletePopupMenu: TMenuItem;
358 N65: TMenuItem;
359 BBSSelectPopupMenu: TPopupMenu;
360 PlugInMenu: TMenuItem;
361 TreeSelectNamePupupMenu: TMenuItem;
362 BrowserPanel: TPanel;
363 SelectTimer: TTimer;
364 SelectThreadSave: TMenuItem;
365 N55: TMenuItem;
366 N66: TMenuItem;
367 dat1: TMenuItem;
368 OpenLogFolder: TMenuItem;
369 Browser: TWebBrowser;
370 TabSave: TMenuItem;
371 TabOpen: TMenuItem;
372 ResRangePopupMenu: TPopupMenu;
373 ResRangeHundPMenuItem: TMenuItem;
374 ResRangeKokoPMenuItem: TMenuItem;
375 ResRangeNewPMenuItem: TMenuItem;
376 ResRangeAllPMenuItem: TMenuItem;
377 BrowsBoradHeadAction1: TMenuItem;
378 ThreadRangePopupMenu: TPopupMenu;
379 A15: TMenuItem;
380 L8: TMenuItem;
381 N67: TMenuItem;
382 N68: TMenuItem;
383 S6: TMenuItem;
384 N69: TMenuItem;
385 ResRangeSelectPMenuItem: TMenuItem;
386 ListColumnPopupMenu: TPopupMenu;
387 N70: TMenuItem;
388 ID1: TMenuItem;
389 ID2: TMenuItem;
390 N53: TMenuItem;
391 ID3: TMenuItem;
392 N71: TMenuItem;
393 N72: TMenuItem;
394 N73: TMenuItem;
395 SelectComboBoxPanel: TPanel;
396 SelectComboBoxSplitter: TImage;
397 N74: TMenuItem;
398 WikiFAQ: TMenuItem;
399 GikoApplicationEvents: TApplicationEvents;
400 N22: TMenuItem;
401 N42: TMenuItem;
402 DAT2: TMenuItem;
403 N75: TMenuItem;
404 DAT3: TMenuItem;
405 N76: TMenuItem;
406 FavoriteTreeItemNameCopyPopupMenu: TMenuItem;
407 N77: TMenuItem;
408 N78: TMenuItem;
409 SaveThreadFile: TMenuItem;
410 N79: TMenuItem;
411 HTML1: TMenuItem;
412 DAT4: TMenuItem;
413 N80: TMenuItem;
414 SameBoardThreadItem: TMenuItem;
415 N81: TMenuItem;
416 N82: TMenuItem;
417 IDNG1: TMenuItem;
418 IDNG2: TMenuItem;
419 ResPopupClearTimer: TTimer;
420 TaskTrayPopupMenu: TPopupMenu;
421 Exit1: TMenuItem;
422 N83: TMenuItem;
423 UpdateGikonaviAction1: TMenuItem;
424 N84: TMenuItem;
425 procedure FormCreate(Sender: TObject);
426 procedure FormDestroy(Sender: TObject);
427 procedure SaveSettingAll();
428 procedure BrowserStatusTextChange(Sender: TObject;
429 const Text: WideString);
430 procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
431 procedure TreeViewChanging(Sender: TObject; Node: TTreeNode;
432 var AllowChange: Boolean);
433 procedure ListViewKeyDown(Sender: TObject; var Key: Word;
434 Shift: TShiftState);
435 procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
436 procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
437 Button: TToolButton; State: TCustomDrawState;
438 var DefaultDraw: Boolean);
439 procedure BrowserBeforeNavigate2(Sender: TObject;
440 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
441 Headers: OleVariant; var Cancel: WordBool);
442 procedure TreeViewCustomDraw(Sender: TCustomTreeView;
443 const ARect: TRect; var DefaultDraw: Boolean);
444 procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
445 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
446 procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
447 procedure ListViewCustomDraw(Sender: TCustomListView;
448 const ARect: TRect; var DefaultDraw: Boolean);
449 procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
450 Shift: TShiftState; X, Y: Integer);
451 procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
452 procedure MessageListViewResize(Sender: TObject);
453 procedure CabinetVisible( isVisible : Boolean );
454 procedure FormResize(Sender: TObject);
455 procedure ListPopupMenuPopup(Sender: TObject);
456 procedure TreePopupMenuPopup(Sender: TObject);
457 procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
458 var Cancel: WordBool);
459 procedure ListSplitterMoved(Sender: TObject);
460 procedure BrowserTabChange(Sender: TObject);
461 procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
462 Shift: TShiftState; X, Y: Integer);
463 procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer;
464 State: TDragState; var Accept: Boolean);
465 procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer);
466 procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X,
467 Y: Integer);
468 procedure BrowserDocumentComplete(Sender: TObject;
469 const pDisp: IDispatch; var URL: OleVariant);
470 procedure RoundNamePopupMenuPopup(Sender: TObject);
471 procedure FormShow(Sender: TObject);
472 procedure BrowserTabToolBarResize(Sender: TObject);
473 procedure FavoriteMenuClick(Sender: TObject);
474 procedure MainCoolBarResize(Sender: TObject);
475 procedure AddressToolBarResize(Sender: TObject);
476 procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
477 Shift: TShiftState);
478 procedure BrowserEnter(Sender: TObject);
479 procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
480 procedure PreviewTimerTimer(Sender: TObject);
481 procedure MessageHideButtonClick(Sender: TObject);
482 procedure HistoryAllClearToolButtonClick(Sender: TObject);
483 procedure MainCoolBarBandInfo(Sender: TObject;
484 var BandInfo: PReBarBandInfoA);
485 procedure MainCoolBarChevronClick(Sender: TObject;
486 RebarChevron: PNMRebarChevron);
487 procedure ListCoolBarBandInfo(Sender: TObject;
488 var BandInfo: PReBarBandInfoA);
489 procedure ListCoolBarChevronClick(Sender: TObject;
490 RebarChevron: PNMRebarChevron);
491 procedure BrowserCoolBarBandInfo(Sender: TObject;
492 var BandInfo: PReBarBandInfoA);
493 procedure BrowserCoolBarChevronClick(Sender: TObject;
494 RebarChevron: PNMRebarChevron);
495 procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
496 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
497 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
498 procedure SelectComboBoxChange(Sender: TObject);
499 procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
500 Shift: TShiftState);
501 procedure SelectComboBoxExit(Sender: TObject);
502 procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
503 Shift: TShiftState; X, Y: Integer);
504 procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
505 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
506 procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
507 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
508 procedure StatusBarResize(Sender: TObject);
509 procedure SelectComboBoxEnter(Sender: TObject);
510 procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
511 Y: Integer);
512 procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
513 procedure FavoriteTreeViewEdited(Sender: TObject; Node: TTreeNode;
514 var S: String);
515 procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
516 Shift: TShiftState);
517 procedure FavoriteTreePopupMenuPopup(Sender: TObject);
518 procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer);
519 procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton;
520 Shift: TShiftState; X, Y: Integer);
521 procedure LinkToolBarDragOver(Sender, Source: TObject; X, Y: Integer;
522 State: TDragState; var Accept: Boolean);
523 procedure FavoriteTreeViewEndDrag(Sender, Target: TObject; X,
524 Y: Integer);
525 procedure FavoriteTreeBrowseBoardPopupMenuClick(Sender: TObject);
526 procedure BrowserTabContextPopup(Sender: TObject; MousePos: TPoint;
527 var Handled: Boolean);
528 procedure BrowserTabPopupMenuPopup(Sender: TObject);
529 procedure BrowserTabResize(Sender: TObject);
530 procedure TreeViewKeyDown(Sender: TObject; var Key: Word;
531 Shift: TShiftState);
532 procedure FavoriteTreeViewMouseDown(Sender: TObject;
533 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
534 procedure MessagePanelResize(Sender: TObject);
535 procedure OnResized;
536 procedure SelectTimerTimer(Sender: TObject);
537 procedure ListViewColumnRightClick(Sender: TObject;
538 Column: TListColumn; Point: TPoint);
539 procedure ListViewCustomDrawItem(Sender: TCustomListView;
540 Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
541 procedure FormActivate(Sender: TObject);
542 procedure BrowserPanelResize(Sender: TObject);
543 procedure MenuToolBarResize(Sender: TObject);
544 procedure ListToolBarResize(Sender: TObject);
545 procedure BrowserToolBarResize(Sender: TObject);
546 procedure KokoPopupMenuPopup(Sender: TObject);
547 procedure ListViewKeyUp(Sender: TObject; var Key: Word;
548 Shift: TShiftState);
549 procedure FavoriteTreeViewEditing(Sender: TObject; Node: TTreeNode;
550 var AllowEdit: Boolean);
551 procedure CabinetCloseSpeedButtonClick(Sender: TObject);
552 procedure FavoriteArrangeToolButtonClick(Sender: TObject);
553 procedure GikoApplicationEventsMessage(var Msg: tagMSG;
554 var Handled: Boolean);
555 procedure GikoApplicationEventsDeactivate(Sender: TObject);
556 procedure GikoApplicationEventsException(Sender: TObject; E: Exception);
557 procedure TreeViewMouseDown(Sender: TObject; Button: TMouseButton;
558 Shift: TShiftState; X, Y: Integer);
559 procedure GetResURLMenuClick(Sender: TObject);
560 procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
561 var Handled: Boolean);
562 procedure ResPopupClearTimerTimer(Sender: TObject);
563 private
564 { Private 鐃緒申鐃緒申 }
565 FEnabledCloseButton: Boolean;
566 FClickNode: TTreeNode;
567 FHttpState: Boolean;
568 FPreviewBrowser: TPreviewBrowser;
569 FPreviewURL: string;
570 FBrowserSizeHeight: Integer;
571 FBrowserSizeWidth: Integer;
572 FTabHintIndex: Integer;
573 FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
574 FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?
575 FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?
576 FActiveList: TObject;
577 FActiveContent: TBrowserRecord; //
578 FActiveBBS : TBBS;
579 FHistoryList: THistoryList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
580 FTreeType: TGikoTreeType;
581 FWorkCount: Integer;
582 FNameCookie: string;
583 FMailCookie: string;
584 FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
585 FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?
586 FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?
587 IsDraggingSelectComboBox : Boolean;
588 DraggingSelectComboBoxPosition : TPoint;
589 FSearchDialog: TSearchDialog;
590 FDropSpaceNode: TTreeNode;
591 FDragTime : Cardinal; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?
592 FDragButton : TToolButton; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?鐃緒申Drag鐃緒申鐃緒申鐃緒申Button鐃緒申鐃緒申
593 FDragWFirst : Boolean; ///< WebTab鐃緒申D&D鐃?
594 FListViewBackGroundColor : TColor; ///< ListView鐃緒申BackGroundColor
595 FUseOddResOddColor : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申
596 FOddColor : TColor; ///< 鐃緒申鐃緒申鐃?
597 FSelectResWord : string; ///< 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
598 FIsIgnoreResize : TResizeType; ///< 鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
599 FIsMinimize : TMinimizeType; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
600 FOldFormWidth : Integer; ///< 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
601 FToolBarSettingSender : TToolBarSettingSenderType; ///< 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
602 FMouseDownPos : TPoint; ///< 鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
603 FBrowsers: TList;
604 FResRangeMenuSelect : Longint; ///< ResRangeButton 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 (鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申 ResRange 鐃緒申鐃緒申)
605 FStartUp : Boolean;
606 FIsHandledWheel : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 WM_MOUSEWHEEL 鐃緒申鐃緒申鐃緒申鐃緒申
607 DiffComp: Boolean; //Add by Genyakun 鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申True鐃緒申鐃緒申鐃緒申
608 FOrigenCaption: String; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
609 FPreviewBrowserRect: TRect; ///< 鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
610 FActionListGroupIndexes: array of Integer; ///<GikoDM鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
611 FResPopupBrowser: TResPopupBrowser;
612 FUpdateExePath: string; ///鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?
613 FUpdateExeArgs: string; ///鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
614 procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
615 procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
616 procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
617 procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
618 procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
619 procedure ListClick;
620 procedure ListDoubleClick(Shift: TShiftState);
621 function Hook(var Message: TMessage): Boolean;
622 procedure AddRoundNameMenu(MenuItem: TMenuItem);
623 procedure SetMenuFont;
624 procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
625 procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;
626 procedure FavoriteClick(Sender: TObject); overload;
627 procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
628 function OnDocumentContextMenu(Sender: TObject): WordBool;
629 function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
630 procedure MenuBarChevronMenu;
631 procedure LinkBarChevronMenu;
632 procedure ToolBarChevronMenu(ToolBar: TToolBar);
633 procedure LinkToolButtonDragDrop(Sender, Source: TObject; X, Y: Integer);
634 procedure LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
635 procedure LinkToolButtonOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
636 procedure LinkToolButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
637 procedure LinkToolButtonStartDrag(Sender: TObject; var DragObject: TDragObject);
638 function TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode;
639 procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );
640 procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject );
641 procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject );
642 //
643 procedure SetListViewBackGroundColor(value: TColor);
644 procedure BBSMenuItemOnClick( Sender : TObject );
645 /// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
646 procedure SaveCoolBarSettings;
647 procedure SaveMainCoolBarSettings;
648 procedure SaveBoardCoolBarSettings;
649 procedure SaveBrowserCoolBarSettings;
650 /// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
651 procedure LoadCoolBarSettings;
652 /// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
653 procedure OnMinimize;
654 /// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
655 procedure OnMinimized;
656 /// TreeView 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
657 procedure TreeClick( Node : TTreeNode );
658 /// TreeView 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
659 procedure TreeDoubleClick( Node : TTreeNode );
660 /// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
661 procedure SetBBSMenu;
662 /// ListColumnPopupMenu 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
663 procedure ListColumnPopupMenuOnClick( Sender : TObject );
664 //! 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
665 procedure SetSelectWord( const text : string );
666 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
667 function GetScreenCursor(): TCursor;
668 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
669 procedure SetScreenCursor(Cursor : TCursor);
670 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
671 procedure CreateControlThread();
672 //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
673 procedure CreateBrowsers(count: Integer);
674 //! ActionList鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申
675 procedure GetGroupIndex(ActionList: TActionList);
676 //! ActionList鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申
677 procedure SetGroupIndex(ActionList: TActionList);
678 //! 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申(鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 or 鐃?鐃緒申JUMP鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申DL鐃緒申鐃緒申)
679 procedure OpenThreadItem(Thread: TThreadItem; URL: String);
680 //! ListView鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
681 procedure RefreshListView(Thread: TThreadItem);
682 //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
683 procedure ClearThreadRengeAction;
684 //! 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申
685 procedure UnStoredTaskTray;
686 //! 鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申
687 procedure ShowEditors(nCmdShow: Integer);
688 //! 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Browser鐃緒申鐃?鐃緒申
689 procedure ReleaseOldestBrowser;
690 //! 鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
691 procedure AddMenuSameBoardThread;
692 //! 鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
693 procedure SameBoardThreadSubItemOnClick(Sender: TObject);
694 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
695 procedure CreateResPopupBrowser;
696 //! 鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?
697 function isValidFile(FileName: String) : boolean;
698 //! ListView鐃緒申D&D鐃緒申鐃緒申鐃緒申鐃緒申
699 procedure AcceptDropFiles(var Msg: TMsg);
700 //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
701 procedure UpdateListView();
702 //! 鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
703 procedure LoadIcon();
704 protected
705 procedure CreateParams(var Params: TCreateParams); override;
706 procedure WndProc(var Message: TMessage); override;
707 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
708 procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
709 procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
710 public
711 { Public 鐃緒申鐃緒申 }
712 LastRoundTime: TDateTime;
713 BrowserNullTab: TBrowserRecord;
714 FControlThread: TThreadControl;
715 FIconData : TNotifyIconData;
716 procedure MoveToURL(const inURL: string);
717 function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
718 procedure ReloadBBS;
719 function GetHttpState: Boolean;
720 procedure SetEnabledCloseButton(Enabled: Boolean);
721 function GetTreeNode(Data: TObject): TTreeNode;
722 procedure ListViewAllSelect;
723 property ListStyle: TViewStyle read FListStyle write FListStyle;
724 property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
725 property ViewType: TGikoViewType read FViewType write FViewType;
726 property NameCookie: string read FNameCookie write FNameCookie;
727 property MailCookie: string read FMailCookie write FMailCookie;
728 property ClickNode: TTreeNode read FClickNode write FClickNode;
729 property TreeType: TGikoTreeType read FTreeType write FTreeType;
730 property ActiveContent: TBrowserRecord read FActiveContent write FActiveContent;
731 property ResRangeMenuSelect: Longint read FResRangeMenuSelect write FResRangeMenuSelect;
732 property SelectResWord : string read FSelectResWord write FSelectResWord;
733 property BrowserSizeWidth: Integer read FBrowserSizeWidth write FBrowserSizeWidth;
734 property BrowserSizeHeight: Integer read FBrowserSizeHeight write FBrowserSizeHeight;
735 property SearchDialog: TSearchDialog read FSearchDialog write FSearchDialog;
736 property ToolBarSettingSender : TToolBarSettingSenderType
737 read FToolBarSettingSender write FToolBarSettingSender;
738 property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
739 property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
740 property WorkCount: Integer read FWorkCount write FWorkCount;
741 property UpdateExePath: string read FUpdateExePath write FUpdateExePath;
742 property UpdateExeArgs: string read FUpdateExeArgs write FUpdateExeArgs;
743
744 procedure SetContent(inThread: TBrowserRecord);
745 function GetActiveContent(popup :Boolean = false): TThreadItem;
746 function GetActiveList: TObject;
747
748 procedure SetListViewType(AViewType: TGikoViewType); overload;
749 procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
750 procedure PlaySound(SoundEventName: string);
751 procedure ShowBBSTree( inBBS : TBBS );
752 procedure ShowBBSTreeOld( inBBS : TBBS );
753 procedure ShowHistoryTree;
754 procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
755 procedure SetBrowserTabState;
756 procedure SetToolBarPopup;
757 procedure ShowFavoriteAddDialog( Item : TObject );
758 procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
759 procedure RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);
760 property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
761 property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
762 property OddColor : TColor read FOddColor write FOddColor;
763 function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
764 procedure OnPlugInMenuItem( Sender : TObject );
765 procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
766 /// ListView 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申 KuroutSetting鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
767 procedure ActiveListColumnSave;
768 procedure SetActiveList(Obj: TObject);
769 property ActiveList: TObject read GetActiveList write SetActiveList;
770 /// CoolBar 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
771 procedure CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
772 //鐃緒申鐃緒申ID鐃緒申鐃緒申鐃緒申鐃?鐃緒申
773 procedure IndividualAbonID(Atype : Integer);
774 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申
775 procedure IndividualAbon(Atag, Atype : Integer);
776 //鐃緒申鐃緒申ID鐃緒申NG鐃緒申鐃?鐃?鐃緒申鐃?鐃?
777 procedure AddIDtoNGWord(invisible : boolean);
778 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申 true:鐃?鐃緒申鐃緒申鐃?鐃? false:鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
779 procedure RepaintAllTabsBrowser();
780 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
781 procedure SetLinkBar;
782 procedure FavoriteBrowseFolder( node: TTreeNode );
783 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
784 procedure DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False);
785 //鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
786 procedure DownloadList(Board: TBoard; ForceDownload: Boolean = False);
787 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
788 procedure DeleteHistory( threadItem: TThreadItem );
789 //鐃?鐃?鐃緒申鐃緒申鐃緒申 鐃?鐃緒申鐃?鐃?鐃?鐃緒申
790 procedure DeleteTab(ThreadItem: TThreadItem); overload;
791 //鐃?鐃?鐃緒申鐃緒申鐃緒申 鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
792 procedure DeleteTab(BrowserRecord: TBrowserRecord); overload;
793 // 鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
794 procedure DeleteTab(index, selectIndex: Integer); overload;
795 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
796 procedure BrowserMovement(const AName: string); overload;
797 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
798 procedure BrowserMovement(scroll: Integer); overload;
799 //Application鐃緒申MainForm鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
800 function GetMainForm(): TComponent;
801 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
802 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?
803 procedure OnGestureStart(Sender: TObject);
804 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申
805 procedure OnGestureMove(Sender: TObject);
806 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
807 procedure OnGestureEnd(Sender: TObject);
808 /// 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
809 procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
810 //ListView鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
811 procedure SelectListItem(List: TList);
812 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
813 procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
814 //
815 procedure ModifySelectList;
816 //
817 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;
818 //
819 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
820 //
821 procedure SetSelectRoundName(Sender: TObject);
822 //
823 function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
824 //
825 function WebBrowserClick(Sender: TObject): WordBool;
826 //! 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
827 procedure SetSelectComboBox();
828
829 //! 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
830 procedure TaskTrayIconMessage(var Msg : TMsg); message WM_USER + 2010;
831 //! 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申
832 procedure StoredTaskTray;
833 //! 鐃緒申ID鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
834 procedure ShowSameIDAncher(const AID: String);
835 published
836 property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
837 end;
838
839 TFavoriteMenuItem = class(TMenuItem)
840 private
841 FData : Pointer;
842 public
843 property Data: Pointer read FData write FData;
844 end;
845
846 TBBSMenuItem = class(TMenuItem)
847 private
848 FData : Pointer;
849 public
850 property Data: Pointer read FData write FData;
851 end;
852
853 TLinkToolButton = class(TToolButton)
854 private
855 FData : Pointer;
856 public
857 property Data: Pointer read FData write FData;
858 end;
859
860 var
861 GikoForm: TGikoForm;
862
863 implementation
864
865 uses
866 GikoUtil, IndividualAbon, Math, Kotehan, KeySetting,
867 YofUtils, ToolBarUtil, ToolBarSetting,
868 GikoXMLDoc, RoundName, IniFiles, FavoriteAdd,
869 FavoriteArrange, AddressHistory, Gesture,
870 About, Option, Round, Splash, Sort, ListSelect, Imm,
871 NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter,
872 HTMLCreate, ListViewUtils, GikoDataModule, GikoMessage,
873 InputAssistDataModule, Types, ReplaceDataModule;
874
875 const
876 BLANK_HTML: string = 'about:blank';
877 BROWSER_COUNT = 5; //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
878 //D&D鐃緒申鐃?
879 DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel)
880 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
881 HTML_FILE_NAME = 'temp_preview.html';
882 //鐃緒申鐃?鐃?鐃?鐃?ID
883 USER_TREECLICK = WM_USER + 2000;
884 USER_RESIZED = WM_USER + 2001;
885 USER_MINIMIZED = WM_USER + 2002;
886 USER_SETLINKBAR = WM_USER + 2003;
887 USER_DOCUMENTCOMPLETE = WM_USER + 2004; ///< wParam : TWebBrowser
888 USER_TASKTRAY = WM_USER + 2010;
889 {$R *.DFM}
890
891 procedure TGikoForm.CreateParams(var Params: TCreateParams);
892 begin
893 inherited;
894 if FormStyle in [fsNormal, fsStayOnTop] then begin
895 if BorderStyle in [bsSingle, bsSizeable] then begin
896 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
897 Params.WndParent := 0;
898 end;
899 end;
900 end;
901
902 procedure TGikoForm.FormCreate(Sender: TObject);
903 const
904 TVS_NOTOOLTIPS = $0080;
905 var
906 FileName: string;
907 Style: DWORD;
908 msg: string;
909 i: Integer;
910 wp: TWindowPlacement;
911 begin
912 {$IFDEF DEBUG}
913 AllocConsole;
914 Writeln('============================================================');
915 Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
916 Writeln('');
917 Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
918 Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
919 Writeln('============================================================');
920 {$ENDIF}
921 //try
922 Sort.SetSortDate(Now());
923
924 FTreeType := gttNone;
925 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
926 FStartUp := true;
927 Application.HookMainWindow(Hook);
928 FIsIgnoreResize := rtResizing;
929 //ActionList鐃緒申GuoupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?0鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
930 //(鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申Down鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申)
931 //鐃緒申鐃緒申鐃緒申鐃緒申Set鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?Action鐃緒申Checked鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
932 GetGroupIndex(GikoDM.GikoFormActionList);
933 FSearchDialog := nil;
934 FResPopupBrowser := nil;
935 CreateBrowsers(BROWSER_COUNT);
936 FIconData.uID := 0;
937 FUpdateExePath := '';
938 FUpdateExeArgs := '';
939
940 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
941 SetMenuFont;
942
943 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
944 Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
945
946 // 鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
947 LoadIcon;
948
949 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
950 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
951
952 EnabledCloseButton := True;
953
954 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
955 ListView.ViewStyle := GikoSys.Setting.ListStyle;
956
957 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
958 AnimePanel.Top := 0;
959 AnimePanel.Left := 0;
960
961 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
962
963 //鐃?鐃緒申鐃?鐃?鐃?鐃?
964 CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
965
966 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
967 GikoDM.MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
968 GikoDM.MsgBarVisibleActionExecute(nil);
969 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
970
971 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
972 GikoDM.StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
973 GikoDM.StatusBarVisibleActionExecute(nil);
974
975 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
976 TreeView.Items.BeginUpdate;
977 FavoriteTreeView.Items.BeginUpdate;
978 ListView.Items.BeginUpdate;
979 try
980 TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
981 TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
982 TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
983 TreeView.Color := GikoSys.Setting.CabinetBackColor;
984 FavoriteTreeView.Font.Assign(TreeView.Font);
985 FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
986
987 ListView.Font.Name := GikoSys.Setting.ListFontName;
988 ListView.Font.Size := GikoSys.Setting.ListFontSize;
989 ListView.Font.Color := GikoSys.Setting.ListFontColor;
990 ListView.Font.Style := [];
991 if GikoSys.Setting.ListFontBold then
992 ListView.Font.Style := [fsbold];
993 if GikoSys.Setting.ListFontItalic then
994 ListView.Font.Style := ListView.Font.Style + [fsitalic];
995
996 ListViewBackGroundColor := clWhite; // 鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
997 ListViewBackGroundColor := GikoSys.Setting.ListBackColor; // 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
998 FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
999 FOddColor := GikoSys.Setting.OddColor;
1000
1001 finally
1002 TreeView.Items.EndUpdate;
1003 FavoriteTreeView.Items.EndUpdate;
1004 ListView.Items.EndUpdate;
1005 end;
1006 //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
1007 GikoDM.ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
1008
1009 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1010 GikoDM.MuteAction.Checked := GikoSys.Setting.Mute;
1011
1012 // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1013 FResRangeMenuSelect := GikoSys.ResRange;
1014 case GikoSys.ResRange of
1015 Ord( grrAll ):
1016 begin
1017 GikoDM.AllResAction.Execute;
1018 end;
1019 Ord( grrSelect ):
1020 begin
1021 SelectComboBox.Text := SelectComboBox.Items[ 1 ];
1022 GikoDM.SelectResAction.Checked := True;
1023 end;
1024 else
1025 case FResRangeMenuSelect of
1026 Ord( grrKoko ): GikoDM.OnlyKokoResAction.Checked := True;
1027 Ord( grrNew ): GikoDM.OnlyNewResAction.Checked := True;
1028 10..65535:
1029 begin
1030 GikoDM.OnlyAHundredResAction.Checked := True;
1031 GikoSys.ResRange := GikoSys.Setting.ResRangeExCount;
1032 end;
1033 end;
1034 end;
1035
1036 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1037 case GikoSys.Setting.ThreadRange of
1038 gtrAll:
1039 begin
1040 GikoDM.AllItemAction.Checked := True;
1041 ViewType := gvtAll;
1042 end;
1043 gtrLog:
1044 begin
1045 GikoDM.LogItemAction.Checked := True;
1046 ViewType := gvtLog;
1047 end;
1048 gtrNew:
1049 begin
1050 GikoDM.NewItemAction.Checked := True;
1051 ViewType := gvtNew;
1052 end;
1053 gtrLive:
1054 begin
1055 GikoDM.LiveItemAction.Checked := True;
1056 ViewType := gvtLive;
1057 end;
1058 gtrArch:
1059 begin
1060 GikoDM.ArchiveItemAction.Checked := True;
1061 ViewType := gvtArch;
1062 end;
1063 end;
1064
1065
1066 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1067 BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1068 BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1069 BrowserTab.Font.Style := [];
1070 if GikoSys.Setting.BrowserTabFontBold then
1071 BrowserTab.Font.Style := [fsBold];
1072 if GikoSys.Setting.BrowserTabFontItalic then
1073 BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic];
1074
1075 BrowserTab.DoubleBuffered := True;
1076 FDragWFirst := false;
1077 SetContent(BrowserNullTab); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1078
1079 //鐃?鐃緒申鐃?鐃?鐃?鐃?
1080 GikoDM.BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1081
1082 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1083 GikoDM.BrowserTabTopAction.Checked := True;
1084 end else begin
1085 GikoDM.BrowserTabBottomAction.Checked := True;
1086 end;
1087
1088 if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1089 GikoDM.BrowserTabTabStyleAction.Checked := True;
1090 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1091 GikoDM.BrowserTabButtonStyleAction.Checked := True;
1092 end else begin
1093 GikoDM.BrowserTabFlatStyleAction.Checked := True;
1094 end;
1095
1096 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1097 ProgressBar.Parent := StatusBar;
1098 ProgressBar.Top := 2;
1099 ProgressBar.Left := 0;
1100 ProgressBar.Width := StatusBar.Panels[0].Width;
1101 ProgressBar.Height := StatusBar.Height - 2;
1102 ProgressBar.Position := 0;
1103
1104 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1105 InitializeBoardPlugIns;
1106
1107 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申(ReadFavorite 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1108 GikoSys.ListBoardFile;
1109 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申
1110 try
1111 // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1112 if (SplashWindow <> nil) then begin
1113 SplashWindow.ProgressBar.Max := Length(BBSs) * 20;
1114 end;
1115 except
1116 end;
1117 // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1118 for i := Length(BBSs) - 1 downto 0 do begin
1119 if not BBSs[i].IsBoardFileRead then
1120 GikoSys.ReadBoardFile(BBSs[i]);
1121
1122 if SplashWindow <> nil then begin
1123 SplashWindow.ProgressBar.StepBy(20);
1124 SplashWindow.Update;
1125 end;
1126 end;
1127
1128 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1129 RoundList := TRoundList.Create;
1130 RoundList.LoadRoundBoardFile;
1131 RoundList.LoadRoundThreadFile;
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 SetBBSMenu;
1145
1146 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1147 wp.length := sizeof(wp);
1148 wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1149 wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1150 wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1151 wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1152 wp.showCmd := SW_HIDE;
1153 SetWindowPlacement(Handle, @wp);
1154 //Self.Update;
1155
1156 if GikoSys.Setting.WindowMax then
1157 WindowState := wsMaximized;
1158
1159 //鐃?鐃?鐃?鐃?鐃緒申
1160 try
1161 FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1162 if FileExists(FileName) then
1163 Animate.FileName := FileName;
1164 except
1165 end;
1166
1167 //鐃?鐃?鐃?鐃?
1168 FNameCookie := '';
1169 FMailCookie := '';
1170
1171 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1172 FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1173 FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1174
1175
1176 // 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?(LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1177 FHistoryList := THistoryList.Create;
1178
1179 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1180 FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml',
1181 TreeView, FTreeType);
1182
1183 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1184 FavoriteDM.SetFavTreeView(FavoriteTreeView);
1185 FavoriteDM.ReadFavorite;
1186
1187 GikoDM.ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1188 GikoDM.ArrangeAction.Execute;
1189
1190 if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1191 case GikoSys.Setting.ListWidthState of
1192 glsMax: begin
1193 ViewPanel.Width := 1;
1194 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1195 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1196 end;
1197 glsMin: begin
1198 ViewPanel.Width := GikoSys.Setting.ListWidth;
1199 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1200 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1201 end;
1202 else begin
1203 ViewPanel.Width := GikoSys.Setting.ListWidth;
1204 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1205 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1206 end;
1207 end;
1208 end else begin
1209 case GikoSys.Setting.ListHeightState of
1210 glsMax: begin
1211 ViewPanel.Height := 1;
1212 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1213 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1214 end;
1215 glsMin: begin
1216 ViewPanel.Height := GikoSys.Setting.ListHeight;
1217 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1218 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1219 end;
1220 else begin
1221 ViewPanel.Height := GikoSys.Setting.ListHeight;
1222 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1223 GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1224 end;
1225 end;
1226 end;
1227
1228 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1229 CreateControlThread();
1230
1231 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1232 SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1233
1234 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1235 SetBrowserTabState;
1236
1237 BrowserBoardNameLabel.Caption := '';
1238 BrowserNameLabel.Caption := '';
1239 FWorkCount := 0;
1240
1241 FTabHintIndex := -1;
1242
1243 //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1244 ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1245 BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1246
1247 MakeDefaultINIFile();
1248 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1249 ReadToolBarSetting(GikoDM.GikoFormActionList, StdToolBar);
1250 ReadToolBarSetting(GikoDM.GikoFormActionList, ListToolBar);
1251 ReadToolBarSetting(GikoDM.GikoFormActionList, BrowserToolBar);
1252 SetToolBarPopup;
1253
1254 //ListToolBar鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申ComboBox鐃緒申鐃?鐃?
1255 SetSelectComboBox();
1256
1257 //鐃?鐃?鐃緒申鐃?鐃?鐃?
1258 AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1259
1260 //鐃緒申鐃緒申鐃?鐃?鐃?
1261 SetLinkBar;
1262 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1263
1264 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1265 if not FileExists(GikoSys.GetBoardFileName) then begin
1266 msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1267 + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1268 + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1269 MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1270 GikoDM.NewBoardAction.Execute;
1271 end;
1272
1273 //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1274 GikoSys.LoadKeySetting(GikoDM.GikoFormActionList, GikoSys.GetMainKeyFileName);
1275
1276 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1277 // FLastRoundTime := 0;
1278
1279 ListView.OnData := TListViewUtils.ListViewData;
1280
1281 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1282 CabinetVisible( False );
1283 if GikoSys.Setting.CabinetVisible then begin
1284 i := CabinetSelectPopupMenu.Items.Count - 1;
1285 if GikoSys.Setting.CabinetIndex = i - 1 then
1286 GikoDM.CabinetHistoryAction.Execute
1287 else if GikoSys.Setting.CabinetIndex = i then
1288 GikoDM.CabinetFavoriteAction.Execute
1289 else begin
1290 if GikoSys.Setting.CabinetIndex < Length( BBSs ) then
1291 ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] );
1292 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 2
1293 FIsIgnoreResize := rtResizing;
1294 GikoDM.CabinetBBSAction.Execute;
1295 end;
1296 end else begin
1297 ShowBBSTreeOld( BBSs[ 0 ] );
1298 PostMessage( Handle, USER_TREECLICK, 0, 0 );
1299 end;
1300
1301 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1302 for i := 1 to ParamCount do begin
1303 MoveToURL(ParamStr(i));
1304 end;
1305
1306 GikoDM.RepaintStatusBar;
1307 StatusBarResize(Sender);
1308
1309 dummy1.Caption := ItemReservPMenu.Caption;
1310 dummy1.Hint := ItemReservPMenu.Hint;
1311
1312 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1313 MouseGesture := TMouseGesture.Create;
1314
1315 {$IFDEF SPAM_FILTER_ENABLED}
1316 // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1317 GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
1318 {$ENDIF}
1319
1320 //2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1321 GikoSys.SetGikoMessage;
1322
1323 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1324 if GikoSys.Setting.AutoLogin then
1325 GikoDM.LoginAction.Execute;
1326
1327 GikoSys.Setting.BeLogin := GikoSys.Setting.BeAutoLogin;
1328
1329 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1330 FavoriteAddToolButton.Caption := '鐃緒申鐃緒申...';
1331 AntiIndivAbonMenuItem.Caption := '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申';
1332
1333 //鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1334 InputAssistDM.Init(GikoSys.GetInputAssistFileName);
1335
1336 //鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1337 ReplaceDM.LoadFromFile(GikoSys.GetReplaceFileName);
1338
1339 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?
1340 ResPopupClearTimer.Interval := GikoSys.Setting.RespopupWait;
1341
1342 // D&D鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1343 DragAcceptFiles(ListView.Handle, True);
1344
1345 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?
1346 if (FavoriteDM.AbEnd) then begin
1347 GikoUtil.MsgBox(Self.Handle, '鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?',
1348 '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
1349 Self.Close;
1350 end;
1351
1352 end;
1353
1354 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1355 procedure TGikoForm.SaveCoolBarSettings;
1356 begin
1357
1358 if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then
1359 Exit;
1360 SaveMainCoolBarSettings;
1361 SaveBoardCoolBarSettings;
1362 SaveBrowserCoolBarSettings;
1363
1364 end;
1365 procedure TGikoForm.SaveMainCoolBarSettings;
1366 var
1367 i : Integer;
1368 CoolSet : TCoolSet;
1369 begin
1370 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1371 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1372 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1373 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1374 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1375 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1376 end;
1377 end;
1378 procedure TGikoForm.SaveBoardCoolBarSettings;
1379 var
1380 i : Integer;
1381 CoolSet : TCoolSet;
1382 begin
1383 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1384 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1385 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1386 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1387 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1388 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1389 end;
1390 end;
1391 procedure TGikoForm.SaveBrowserCoolBarSettings;
1392 var
1393 i : Integer;
1394 CoolSet : TCoolSet;
1395 begin
1396 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1397 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1398 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1399 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1400 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1401 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1402 end;
1403 end;
1404 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1405 procedure TGikoForm.LoadCoolBarSettings;
1406 var
1407 i : Integer;
1408 CoolSet : TCoolSet;
1409 begin
1410
1411 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1412 MainCoolBar.Bands.BeginUpdate;
1413 try
1414 // for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1415 for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin
1416 CoolSet := GikoSys.Setting.MainCoolSet[i];
1417 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1418 FIsIgnoreResize := rtNone;
1419 SaveCoolBarSettings;
1420 Exit;
1421 end;
1422 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1423 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1424 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1425 end;
1426 finally
1427 MainCoolBar.Bands.EndUpdate;
1428 end;
1429
1430 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1431 ListCoolBar.Bands.BeginUpdate;
1432 try
1433 // for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1434 for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin
1435 CoolSet := GikoSys.Setting.ListCoolSet[i];
1436 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1437 FIsIgnoreResize := rtNone;
1438 SaveCoolBarSettings;
1439 Exit;
1440 end;
1441 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1442 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1443 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1444 end;
1445 finally
1446 ListCoolBar.Bands.EndUpdate;
1447 end;
1448
1449 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1450 BrowserCoolBar.Bands.BeginUpdate;
1451 try
1452 // for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1453 for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
1454 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1455 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1456 FIsIgnoreResize := rtNone;
1457 SaveCoolBarSettings;
1458 Exit;
1459 end;
1460 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1461 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1462 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1463 end;
1464 finally
1465 BrowserCoolBar.Bands.EndUpdate;
1466 end;
1467
1468 end;
1469 //
1470 procedure TGikoForm.FormShow(Sender: TObject);
1471 var
1472 item : TThreadItem;
1473 begin
1474 if FStartUp then begin
1475 ShowWindow(Application.Handle, SW_HIDE);
1476
1477 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1478 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1479 GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1480 GikoDM.StdToolBarVisibleActionExecute( nil );
1481 GikoDM.AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1482 GikoDM.AddressBarVisibleActionExecute( nil );
1483 GikoDM.LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1484 GikoDM.LinkBarVisibleActionExecute( nil );
1485 GikoDM.ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1486 GikoDM.ListToolBarVisibleActionExecute( nil );
1487 GikoDM.ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1488 GikoDM.ListNameBarVisibleActionExecute( nil );
1489 GikoDM.BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1490 GikoDM.BrowserToolBarVisibleActionExecute( nil );
1491 GikoDM.BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1492 GikoDM.BrowserNameBarVisibleActionExecute( nil );
1493
1494 // CoolBar 鐃緒申鐃緒申
1495 LoadCoolBarSettings;
1496
1497 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1498 // ResetBandInfo( ListCoolBar, ListToolBar );
1499 FIsIgnoreResize := rtNone;
1500
1501 //FormCrete鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1502 if GikoSys.Setting.TabAutoLoadSave then begin
1503 GikoDM.TabsOpenAction.Tag := 1;
1504 GikoDM.TabsOpenAction.Execute;
1505 GikoDM.TabsOpenAction.Tag := 0;
1506 if (GikoSys.Setting.LastCloseTabURL <> '') then begin
1507 if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
1508 PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 );
1509 end;
1510 if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
1511 while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and
1512 (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
1513 Application.ProcessMessages;
1514 end;
1515 end;
1516 item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL );
1517 if (item <> nil) and (item.IsLogFile) then begin
1518 OpenThreadItem(item, item.URL);
1519 end;
1520 GikoSys.Setting.LastCloseTabURL := '';
1521 end;
1522 end;
1523
1524 //ActionList鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1525 SetGroupIndex(GikoDM.GikoFormActionList);
1526
1527 FStartUp := false;
1528 end;
1529 end;
1530
1531 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1532 begin
1533 // if GikoForm.WindowState <> wsMinimized then
1534 // SaveCoolBarSettings;
1535 CanClose := True;
1536 if ( GikoSys.Setting.ShowDialogForEnd ) and
1537 (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1538 CanClose := false;
1539 Exit;
1540 end;
1541
1542 GikoSys.Setting.LastCloseTabURL := '';
1543 if GikoSys.Setting.TabAutoLoadSave then begin
1544 GikoDM.TabsSaveAction.Execute;
1545 if (GetActiveContent <> nil) and
1546 (GetActiveContent.IsLogFile) then begin
1547 GikoSys.Setting.LastCloseTabURL := GetActiveContent.URL;
1548 end;
1549 end;
1550
1551 if (SearchDialog <> nil) then begin
1552 if (SearchDialog.Visible) then begin
1553 SearchDialog.Close;
1554 end;
1555 try
1556 SearchDialog.Release;
1557 except
1558 end;
1559 SearchDialog := nil;
1560 end;
1561
1562 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?EditorForm鐃緒申鐃緒申鐃緒申鐃緒申
1563 GikoDM.CloseAllEditorAction.Execute;
1564
1565 Application.UnhookMainWindow(Hook);
1566 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1567 FControlThread.DownloadAbort;
1568 FControlThread.Terminate;
1569
1570 //OnDestory鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申OnCloseQuery鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1571 SaveSettingAll();
1572
1573 Application.Terminate;
1574 end;
1575
1576 procedure TGikoForm.SaveSettingAll();
1577 var
1578 wp : TWindowPlacement;
1579 WindowPlacement: TWindowPlacement;
1580 begin
1581 try
1582 ActiveListColumnSave;
1583 except
1584 end;
1585
1586 try
1587 WindowPlacement.length := SizeOf(TWindowPlacement);
1588 GetWindowPlacement(Self.Handle, @WindowPlacement);
1589
1590 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1591 wp.length := sizeof(wp);
1592 GetWindowPlacement(Handle, @wp);
1593 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1594 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1595 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1596 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1597 GikoSys.Setting.WindowMax := (WindowState = wsMaximized) or
1598 (WindowPlacement.flags = WPF_RESTORETOMAXIMIZED);
1599 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1600 GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked;
1601 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1602 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1603 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1604 if GikoDM.ArrangeAction.Checked then
1605 GikoSys.Setting.ListOrientation := gloVertical
1606 else
1607 GikoSys.Setting.ListOrientation := gloHorizontal;
1608 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1609 except
1610 end;
1611
1612 try
1613 // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1614 if not GikoSys.Setting.ResRangeHold then
1615 GikoSys.Setting.ResRange := FResRangeMenuSelect;
1616 except
1617 end;
1618 //鐃緒申鐃緒申winodw鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申CoolBar鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1619 SaveCoolBarSettings;
1620 GikoSys.Setting.WriteWindowSettingFile;
1621 // 鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1622 GikoSys.Setting.WriteNameMailSettingFile;
1623
1624 //鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1625 InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName);
1626
1627 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1628 try
1629 //FavoriteDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1630 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1631 if not (FavoriteDM.AbEnd) then begin
1632 FavoriteDM.WriteFavorite;
1633 end;
1634 except
1635 end;
1636
1637 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1638 try
1639 //AddressHistoryDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1640 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
1641 except
1642 end;
1643
1644 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1645 try
1646 FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
1647 except
1648 end;
1649
1650 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1651 try
1652 RoundList.SaveRoundFile;
1653 except
1654 end;
1655
1656 // 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1657 if (FIconData.uID <> 0) then begin
1658 Shell_NotifyIcon(NIM_DELETE, @FIconData);
1659 end;
1660
1661 end;
1662
1663 procedure TGikoForm.FormDestroy(Sender: TObject);
1664 var
1665 i : Integer;
1666 tmpBool : Boolean;
1667 begin
1668 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申CoolBar鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1669 //鐃緒申鐃緒申鐃緒申鐃?OnDestroy鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1670 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1671 if WindowState <> wsNormal then begin
1672 WindowState := wsNormal;
1673 try
1674 SaveCoolBarSettings;
1675 GikoSys.Setting.WriteWindowSettingFile;
1676 except
1677 end;
1678 end;
1679
1680 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1681 try
1682 if GikoSys.Setting.GestureEnabled then begin
1683 MouseGesture.OnGestureStart := nil;
1684 MouseGesture.OnGestureMove := nil;
1685 MouseGesture.OnGestureEnd := nil;
1686 end;
1687 MouseGesture.Clear;
1688 MouseGesture.UnHook;
1689 MouseGesture.Free;
1690 except
1691 end;
1692
1693 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1694 try
1695 FavoriteDM.Clear;
1696 except
1697 end;
1698
1699 try
1700 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1701 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1702 GikoSys.Setting.ShowDialogForAllTabClose := false;
1703 GikoDM.AllTabCloseAction.Execute;
1704 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1705 except
1706 end;
1707
1708 try
1709 for i := FBrowsers.Count - 1 downto 0 do begin
1710 GikoSys.ShowRefCount('browser' + IntToStr(i), TWebBrowser(FBrowsers[i]).ControlInterface);
1711 GikoSys.ShowRefCount('document' + IntToStr(i), TWebBrowser(FBrowsers[i]).ControlInterface.Document);
1712 end;
1713
1714 for i := FBrowsers.Count - 1 downto 0 do begin
1715 TWebBrowser(FBrowsers[i]).Free;
1716 end;
1717 FBrowsers.Clear;
1718 FBrowsers.Capacity := 0;
1719 finally
1720 FBrowsers.Free;
1721 end;
1722
1723 try
1724 if BrowserNullTab <> nil then begin
1725 BrowserNullTab.Browser := nil; {*BrowserNullTab鐃緒申Browser鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
1726 *鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Free鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1727 *}
1728 BrowserNullTab.Free;
1729 end;
1730 except
1731 end;
1732
1733 try
1734 TreeView.Items.BeginUpdate;
1735 TreeView.Items.GetFirstNode.Free;
1736 TreeView.Items.Clear;
1737 TreeView.Items.EndUpdate;
1738 except
1739 end;
1740
1741 try
1742 try
1743 FHistoryList.Clear;
1744 except
1745 end;
1746 finally
1747 FHistoryList.Free;
1748 end;
1749
1750
1751 try
1752 try
1753 RoundList.Clear;
1754 except
1755 end;
1756 finally
1757 RoundList.Free;
1758 end;
1759
1760 try
1761 try
1762 //FControlThread.DownloadAbort;
1763 FControlThread.Terminate;
1764 FControlThread.WaitFor;
1765 except
1766 end;
1767 finally
1768 FControlThread.Free;
1769 end;
1770 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1771 for i := GikoForm.PlugInMenu.Count - 1 downto 0 do begin
1772 GikoForm.PlugInMenu.items[i].Free;
1773 end;
1774 GikoForm.PlugInMenu.Clear;
1775
1776
1777 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1778 // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1779 // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1780 for i := Length(BoardGroups) - 1 downto 0 do begin
1781 //BoardGroups[i].Clear;
1782 BoardGroups[i].Free;
1783 end;
1784
1785 try
1786 for i := Length( BBSs ) - 1 downto 0 do begin
1787 if BBSs[ i ] <> nil then
1788 BBSs[ i ].Free;
1789 BBSs[ i ] := nil;
1790 end;
1791 DestorySpecialBBS(BoardGroup.SpecialBBS);
1792 except
1793 end;
1794
1795 try
1796 if FEvent <> nil then
1797 FEvent.Free;
1798
1799 try
1800 if FResPopupBrowser <> nil then begin
1801 TOleControl(FResPopupBrowser).Parent := nil;
1802 FResPopupBrowser.Free;
1803 end;
1804
1805 except
1806 end;
1807 //Preview鐃?鐃緒申
1808 if FPreviewBrowser <> nil then begin
1809 FPreviewBrowser.Free;
1810 FPreviewBrowser := nil;
1811 end;
1812 except
1813 end;
1814
1815 // Update鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申
1816 if FileExists(FUpdateExePath) then begin
1817 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1818 GikoSys.CreateProcess(FUpdateExePath, FUpdateExeArgs);
1819 end;
1820 end;
1821
1822 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1823 procedure TGikoForm.SetBBSMenu;
1824 var
1825 i : Integer;
1826 item : TBBSMenuItem;
1827 begin
1828
1829 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1830 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1831 try
1832 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1833 CabinetSelectPopupMenu.Items[ i ].Free;
1834 CabinetMenu.Items[ i ].Free;
1835 BBSSelectPopupMenu.Items[ i ].Free;
1836 end;
1837 except
1838 end;
1839 end;
1840
1841 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1842 for i := Length( BBSs ) - 1 downto 0 do begin
1843 try
1844 item := TBBSMenuItem.Create( PopupMenu );
1845 item.Caption := BBSs[ i ].Title;
1846 item.Data := BBSs[ i ];
1847 item.OnClick := BBSMenuItemOnClick;
1848 CabinetSelectPopupMenu.Items.Insert( 0, item );
1849 item := TBBSMenuItem.Create( PopupMenu );
1850 item.Caption := BBSs[ i ].Title;
1851 item.Data := BBSs[ i ];
1852 item.OnClick := BBSMenuItemOnClick;
1853 CabinetMenu.Insert( 0, item );
1854 item := TBBSMenuItem.Create( PopupMenu );
1855 item.Caption := BBSs[ i ].Title;
1856 item.Data := BBSs[ i ];
1857 item.OnClick := BBSMenuItemOnClick;
1858 BBSSelectPopupMenu.Items.Insert( 0, Item );
1859 except
1860 end;
1861 end;
1862
1863 end;
1864
1865 procedure TGikoForm.ReloadBBS;
1866 var
1867 i : Integer;
1868 tmpBool: Boolean;
1869 begin
1870 LockWindowUpdate(Self.Handle);
1871
1872 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1873 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1874 GikoSys.Setting.ShowDialogForAllTabClose := false;
1875 GikoDM.AllTabCloseAction.Execute;
1876 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1877 SetContent(BrowserNullTab);
1878 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1879 TreeView.Items.Clear;
1880
1881 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1882 try
1883 RoundList.SaveRoundFile;
1884 except
1885 end;
1886 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1887 try
1888 RoundList.Clear;
1889 except
1890 end;
1891
1892 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1893 try
1894 FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
1895 FHistoryList.Clear;
1896 except
1897 end;
1898
1899 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1900 try
1901 FavoriteDM.WriteFavorite;
1902 FavoriteDM.Clear;
1903 except
1904 end;
1905
1906 //鐃緒申鐃?鐃?鐃緒申鐃?PLUGIN鐃緒申鐃?鐃緒申
1907 for i := Length(BoardGroups) - 1 downto 0 do begin
1908 try
1909 BoardGroups[i].Free;
1910 except
1911 end;
1912 end;
1913 //BBS鐃?鐃緒申
1914 try
1915 for i := Length( BBSs ) - 1 downto 0 do begin
1916 if BBSs[ i ] <> nil then
1917 BBSs[ i ].Free;
1918 BBSs[ i ] := nil;
1919 end;
1920 except
1921 end;
1922
1923 ActiveList := nil;
1924
1925 FTreeType := gttNone;
1926
1927 //============鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申================================//
1928
1929 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1930 InitializeBoardPlugIns;
1931
1932 GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1933
1934 // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1935 for i := Length(BBSs) - 1 downto 0 do begin
1936 if not BBSs[i].IsBoardFileRead then
1937 GikoSys.ReadBoardFile(BBSs[i]);
1938 end;
1939
1940 // BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1941 SetBBSMenu;
1942
1943 ShowBBSTree( BBSs[ 0 ] );
1944
1945 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1946 FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml',
1947 TreeView, FTreeType);
1948
1949 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1950 FavoriteDM.ReadFavorite;
1951
1952 SetLinkBar;
1953
1954 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1955 RoundList.LoadRoundBoardFile;
1956 RoundList.LoadRoundThreadFile;
1957
1958 LockWindowUpdate(0);
1959 end;
1960
1961 {!
1962 \todo 鐃緒申鐃緒申 IE 7 鐃緒申鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1963 (IE 7 鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申)
1964 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1965 }
1966 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
1967 var
1968 p: TPoint;
1969 s: string;
1970 tmp2: string;
1971 URL: string;
1972 ATitle: Boolean;
1973
1974 threadItem : TThreadItem;
1975 board : TBoard;
1976 Protocol, Host, Path, Document, Port, Bookmark: string;
1977
1978 wkInt: Integer;
1979 wkIntSt: Integer;
1980 wkIntTo: Integer;
1981 ActiveFileName: string;
1982 e: IHTMLElement;
1983 Ext: string;
1984 PathRec: TPathRec;
1985 Text2: string;
1986 cResPopup: TResPopupBrowser;
1987 senderBrowser :TWebBrowser;
1988 doc: IHTMLDocument2;
1989 begin
1990 // 鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申 about:blank.. 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1991 // IE 7 鐃緒申鐃緒申 about:blank.. 鐃緒申鐃緒申鐃緒申鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申鐃緒申鐃緒申)
1992 if Pos('about:..', Text) = 1 then
1993 Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) )
1994 else
1995 Text2 := Text;
1996
1997 if not( TObject(Sender) is TWebBrowser )then
1998 Exit;
1999
2000 senderBrowser := TWebBrowser(Sender);
2001 doc := senderBrowser.ControlInterface.Document as IHTMLDocument2;
2002
2003 try
2004 try
2005 if ((not senderBrowser.Busy) and Assigned(doc)) then begin
2006 if LowerCase(doc.charset) <> 'shift_jis' then begin
2007 doc.charset := 'shift_jis';
2008 end;
2009 end;
2010 except
2011 end;
2012 finally
2013 end;
2014
2015 if PreviewTimer.Enabled then
2016 PreviewTimer.Enabled := False;
2017
2018 Application.CancelHint;
2019
2020 try
2021 if GetActiveContent <> nil then
2022 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2023 else
2024 ActiveFileName := '';
2025 except
2026 FActiveContent := nil;
2027 Exit;
2028 end;
2029
2030 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
2031 if (StatusBar.Panels[1].Text = Text2) then begin
2032 if Text2 = '' then begin
2033 if FResPopupBrowser <> nil then begin
2034 if not(Sender is TResPopupBrowser) then
2035 FResPopupBrowser.Clear
2036 else begin
2037 TResPopupBrowser(Sender).ChildClear;
2038 end;
2039 end;
2040 end;
2041 Exit;
2042 end;
2043 StatusBar.Panels[1].Text := Text2;
2044
2045
2046 if FPreviewBrowser <> nil then
2047 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2048
2049 if FResPopupBrowser <> nil then begin
2050 if not(Sender is TResPopupBrowser) then begin
2051 if (FResPopupBrowser.Visible) then begin
2052 if ResPopupClearTimer.Interval > 0 then begin
2053 ResPopupClearTimer.Enabled := True;
2054 ResPopupClearTimer.Tag := 0;
2055 end else begin
2056 FResPopupBrowser.Clear;
2057 end;
2058 end;
2059 end else begin
2060 if ResPopupClearTimer.Interval > 0 then begin
2061 ResPopupClearTimer.Enabled := True;
2062 ResPopupClearTimer.Tag := 1;
2063 end else begin
2064 TResPopupBrowser(Sender).ChildClear;
2065 end;
2066 end;
2067 end;
2068 cResPopup := nil;
2069
2070 if not(Sender is TResPopupBrowser) then
2071 if not GikoSys.Setting.UnActivePopup then
2072 if not GikoForm.Active then
2073 Exit;
2074
2075
2076
2077 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2078 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2079 // 鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申URL鐃緒申鐃?鐃?
2080 if (ExtPreviewDM.PreviewURL(Text2)) then begin
2081 Exit;
2082 end;
2083 s := '';
2084 Ext := AnsiLowerCase(ExtractFileExt(Text2));
2085 if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
2086 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) or
2087 (Pos('http://www.nicovideo.jp/watch/', Text2) = 1) then begin
2088 if FPreviewBrowser = nil then begin
2089 FPreviewBrowser := TPreviewBrowser.Create(Self);
2090 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2091 TOleControl(FPreviewBrowser).Parent := nil;
2092 end;
2093 FPreviewBrowser.Navigate(BLANK_HTML);//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2094 FPreviewURL := Text2;
2095 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2096 PreviewTimer.Enabled := True;
2097 end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin
2098 if (Pos('mailto:', Text2) = 1) and (GikoSys.Setting.RespopupMailTo) then begin
2099 s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]);
2100 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2101 GetCursorPos(p);
2102 p.x := p.x - senderBrowser.ClientOrigin.x;
2103 p.y := p.y - senderBrowser.ClientOrigin.y;
2104 e := doc.elementFromPoint(p.x, p.y);
2105 if (Assigned(e)) then begin
2106 CreateResPopupBrowser;
2107
2108 if not(Sender is TResPopupBrowser) then begin
2109 if (FResPopupBrowser.Visible) then begin
2110 FResPopupBrowser.Clear;
2111 end;
2112 end else begin
2113 TResPopupBrowser(Sender).ChildClear;
2114 end;
2115
2116 cResPopup := FResPopupBrowser.CreateNewBrowser;
2117 tmp2 := Trim(ZenToHan(e.Get_outerText));
2118 if (GikoSys.IsNumeric(tmp2)) then begin
2119 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2120 wkIntSt := StrToInt64(tmp2);
2121 wkIntTo := StrToInt64(tmp2);
2122 cResPopup.PopupType := gptThread;
2123 HTMLCreater.SetResPopupText(cResPopup, GetActiveContent(true), wkIntSt, wkIntTo, False, False);
2124 end else begin
2125 cResPopup.PopupType := gptRaw;
2126 cResPopup.Title := s;
2127 end;
2128 end;
2129 end else begin
2130 CreateResPopupBrowser;
2131
2132 if not(Sender is TResPopupBrowser) then begin
2133 if (FResPopupBrowser.Visible) then begin
2134 FResPopupBrowser.Clear;
2135 end;
2136 end else begin
2137 TResPopupBrowser(Sender).ChildClear;
2138 end;
2139
2140 threadItem := GetActiveContent(true);
2141 URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL);
2142 PathRec := Gikosys.Parse2chURL2(URL);
2143 if (PathRec.FNoParam) then begin
2144 PathRec.FSt := 1;
2145 PathRec.FTo := 1;
2146 end else begin
2147 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2148 end;
2149 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2150
2151 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
2152
2153 URL := GikoSys.GetBrowsableThreadURL( URL );
2154 wkIntSt := PathRec.FSt;
2155 wkIntTo := PathRec.FTo;
2156
2157 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2158 wkIntSt := 1;
2159 wkIntTo := 1;
2160 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2161 wkIntSt := wkIntTo;
2162 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2163 wkIntTo := wkIntSt;
2164 end else if wkIntSt > wkIntTo then begin
2165 wkInt := wkIntTo;
2166 wkIntTo := wkIntSt;
2167 wkIntSt := wkInt;
2168 end;
2169 if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
2170 ATitle := false
2171 else
2172 ATitle := true;
2173
2174 threadItem := BBSsFindThreadFromURL( URL );
2175
2176 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2177 board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2178 if board <> nil then begin
2179 if not board.IsThreadDatRead then
2180 GikoSys.ReadSubjectFile( board );
2181 threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
2182 end;
2183 end;
2184
2185 if threadItem <> nil then begin
2186 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2187 //URL鐃緒申鐃緒申鐃緒申鐃緒申/鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2188 if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin
2189 wkIntSt := 1;
2190 wkIntTo := 1;
2191 end;
2192 cResPopup := FResPopupBrowser.CreateNewBrowser;
2193 cResPopup.PopupType := gptThread;
2194 HTMLCreater.SetResPopupText(cResPopup, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2195 end;
2196 end;
2197 end;
2198 if (cResPopup <> nil) then begin
2199 ResPopupClearTimer.Enabled := False;
2200
2201 if cResPopup.PopupType = gptRaw then begin
2202 if cResPopup.Title <> '' then begin
2203 cResPopup.TitlePopup;
2204 end;
2205 end else begin
2206 if cResPopup.RawDocument <> '' then begin
2207 cResPopup.Popup;
2208 end else if cResPopup.Title <> '' then begin
2209 cResPopup.TitlePopup;
2210 end;
2211 end;
2212 end;
2213 end;
2214 end;
2215
2216 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2217 var
2218 SysMenu: HMenu;
2219 begin
2220 FEnabledCloseButton := Enabled;
2221 SysMenu := GetSystemMenu(Handle, False);
2222
2223 if Enabled then begin
2224 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2225 end else begin
2226 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2227 end;
2228
2229 DrawMenuBar(Handle);
2230 end;
2231
2232 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2233 var AllowChange: Boolean);
2234 begin
2235 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2236 // if FTreeType = gtt2ch then
2237 // FSortIndex := -1;
2238 end;
2239
2240 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2241 Shift: TShiftState);
2242 var
2243 pos : TPoint;
2244 begin
2245 if GetActiveList is TBoard then begin
2246 case Key of
2247 VK_BACK:; // UpFolderButtonClick(Sender);
2248 VK_SPACE: ListDoubleClick(Shift);
2249 VK_RETURN: ListClick;
2250 VK_APPS:
2251 begin
2252 if ListView.Selected <> nil then begin
2253 pos.X := ListView.Column[ 0 ].Width;
2254 pos.Y := ListView.Selected.Top;
2255 end else begin
2256 pos.X := ListView.Left;
2257 pos.Y := ListView.Top;
2258 end;
2259 Windows.ClientToScreen( ListView.Handle, pos );
2260 ListPopupMenu.Popup( pos.X, pos.Y );
2261 end;
2262 end;
2263 end else begin // TBBS, TCategory
2264 case Key of
2265 VK_BACK:; // UpFolderButtonClick(Sender);
2266 VK_SPACE: ListClick;
2267 VK_RETURN: ListDoubleClick(Shift);
2268 VK_APPS:
2269 begin
2270 if ListView.Selected <> nil then begin
2271 pos.X := ListView.Column[ 0 ].Width;
2272 pos.Y := ListView.Selected.Top;
2273 end else begin
2274 pos.X := ListView.Left;
2275 pos.Y := ListView.Top;
2276 end;
2277 Windows.ClientToScreen( ListView.Handle, pos );
2278 ListPopupMenu.Popup( pos.X, pos.Y );
2279 end;
2280 end;
2281 end;
2282 end;
2283
2284 function TGikoForm.GetHttpState: Boolean;
2285 begin
2286 Result := FHttpState;
2287 end;
2288
2289 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2290 Column: TListColumn);
2291 var
2292 id, idx : Integer;
2293 orderList : TList;
2294 vSortIndex : Integer;
2295 vSortOrder : Boolean;
2296 begin
2297 idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
2298 if TObject( FActiveList ) is TBBS then begin
2299 orderList := GikoSys.Setting.BBSColumnOrder;
2300 vSortIndex := GikoSys.Setting.BBSSortIndex;
2301 vSortOrder := GikoSys.Setting.BBSSortOrder;
2302 end else if TObject( FActiveList ) is TCategory then begin
2303 orderList := GikoSys.Setting.CategoryColumnOrder;
2304 vSortIndex := GikoSys.Setting.CategorySortIndex;
2305 vSortOrder := GikoSys.Setting.CategorySortOrder;
2306 end else if TObject( FActiveList ) is TBoard then begin
2307 orderList := GikoSys.Setting.BoardColumnOrder;
2308 vSortIndex := GikoSys.Setting.BoardSortIndex;
2309 vSortOrder := GikoSys.Setting.BoardSortOrder;
2310 end else
2311 Exit;
2312
2313 id := Integer( orderList[ idx ] );
2314
2315
2316 if vSortIndex = id then
2317 vSortOrder := not vSortOrder
2318 else begin
2319 vSortOrder := id = 0;
2320 end;
2321
2322 TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, vSortOrder);
2323 end;
2324
2325 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2326 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2327 var
2328 ARect: TRect;
2329 begin
2330 DefaultDraw := True;
2331 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Exit鐃緒申鐃緒申鐃緒申鐃緒申
2332 Exit;
2333 DefaultDraw := False;
2334 if (cdsSelected in State) or (cdsHot in State) then begin
2335 Sender.Canvas.Brush.Color := clHighlight;
2336 Sender.Canvas.Font.Color := clHighlightText;
2337 end else begin
2338 Sender.Canvas.Brush.Color := clBtnFace;
2339 Sender.Canvas.Font.Color := clBtnText;
2340 end;
2341 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2342 Sender.Canvas.FillRect(ARect);
2343 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2344 end;
2345
2346 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2347 var
2348 Nodes: TTreeNodes;
2349 i: integer;
2350 begin
2351 Nodes := TreeView.Items;
2352
2353 for i := 0 to Nodes.Count - 1 do begin
2354 if Nodes.Item[i].Data = Data then begin
2355 Result := Nodes.Item[i];
2356 Exit;
2357 end;
2358 end;
2359 Result := nil;
2360 end;
2361
2362 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2363 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2364 Headers: OleVariant; var Cancel: WordBool);
2365 var
2366 sNo: string;
2367 p: TPoint;
2368 const
2369 kMenuName: string = 'menu:';
2370 begin
2371 {$IFDEF DEBUG}
2372 Writeln(URL);
2373 {$ENDIF}
2374 if Pos(kMenuName, URL) <> 0 then begin
2375 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2376
2377 if not GikoSys.IsNumeric(sNo) then Exit;
2378
2379 Cancel := True;
2380 GetCursorpos(p);
2381 KokoPopupMenu.PopupComponent := nil;
2382 if (Sender is TComponent) then
2383 KokoPopupMenu.PopupComponent := TComponent(Sender);
2384 // 鐃緒申鐃緒申鐃緒申鐃緒申 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2385 if not (Sender is TResPopupBrowser) then begin
2386 if (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then begin
2387 FResPopupBrowser.Clear;
2388 end;
2389 end else begin
2390 if (Sender <> FResPopupBrowser.CurrentBrowser) then begin
2391 TResPopupBrowser(Sender).ChildClear;
2392 end;
2393 end;
2394 KokoPopupMenu.Tag := StrToInt(sNo);
2395 KokoPopupMenu.Popup(p.x, p.y);
2396 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2397 Cancel := not GikoSys.Setting.OpenMailer;
2398
2399 //@鐃緒申.鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申URL鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2400 //鐃緒申鐃緒申age鐃?sage鐃緒申鐃緒申
2401 if (Pos('@', URL) = 0) or (Pos('.', URL) = 0) then begin
2402 Cancel := True;
2403 end;
2404 end;
2405
2406 end;
2407
2408 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2409 const ARect: TRect; var DefaultDraw: Boolean);
2410 var
2411 NodeRect: TRect;
2412 i, j: Integer;
2413 IsBoardNode: Boolean;
2414 Cnt: Integer;
2415 CntText: string;
2416 TextWidth: Integer;
2417 TextRect: TRect;
2418 Board: TBoard;
2419 Category: TCategory;
2420 Bitmap: TBitmap;
2421 NodeWidth: Integer;
2422 begin
2423 DefaultDraw := True;
2424
2425 if FTreeType = gttHistory then Exit;
2426
2427 TreeView.Canvas.Font.Color := clBlue;
2428 IsBoardNode := False;
2429 for i := 0 to TreeView.Items.Count - 1 do begin
2430 Cnt := 0;
2431 if not TreeView.Items[i].IsVisible then
2432 continue;
2433
2434 if TObject(TreeView.Items[i].Data) is TCategory then begin
2435 if TreeView.Items[i].Expanded then
2436 continue;
2437
2438 IsBoardNode := False;
2439 Category := TCategory(TreeView.Items[i].Data);
2440 for j := 0 to Category.Count - 1 do begin
2441 Board := Category.Items[j];
2442 if Board <> nil then begin
2443 if Board.UnRead > 0 then begin
2444 Cnt := 1;
2445 Break;
2446 end;
2447 end;
2448 end;
2449 if Cnt <> 1 then
2450 continue;
2451 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2452 IsBoardNode := True;
2453 Board := TBoard(TreeView.Items[i].Data);
2454
2455 Cnt := Board.UnRead;
2456 if Cnt <= 0 then
2457 continue;
2458 end else
2459 continue;
2460
2461 Bitmap := TBitmap.Create;
2462 try
2463 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2464 Bitmap.Canvas.Font.Style := [fsBold];
2465 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2466 finally
2467 Bitmap.Free;
2468 end;
2469
2470 NodeRect := TreeView.Items[i].DisplayRect(True);
2471
2472 if IsBoardNode then
2473 CntText := '(' + IntToStr(Cnt) + ')'
2474 else if Cnt = 1 then
2475 CntText := '(+)';
2476
2477
2478 TextWidth := TreeView.Canvas.TextWidth(CntText);
2479
2480 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2481 NodeRect.Top,
2482 NodeRect.Left + NodeWidth + TextWidth + 8,
2483 NodeRect.Bottom);
2484 DrawText(TreeView.Canvas.Handle,
2485 PChar(CntText),
2486 -1,
2487 TextRect,
2488 DT_SINGLELINE or DT_VCENTER);
2489 end;
2490 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2491 end;
2492
2493 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2494 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2495 var
2496 Board: TBoard;
2497 Category: TCategory;
2498 i: Integer;
2499 begin
2500 DefaultDraw := True;
2501
2502 if FTreeType = gttHistory then Exit;
2503
2504 TreeView.Canvas.Font.Style := [];
2505 if Node <> nil then begin
2506 if TObject(Node.Data) is TCategory then begin
2507 Category := TCategory(Node.Data);
2508 for i := 0 to Category.Count - 1 do begin
2509 Board := Category.Items[i];
2510 if Board <> nil then begin
2511 if Board.UnRead > 0 then begin
2512 TreeView.Canvas.Font.Style := [fsBold];
2513 Break;
2514 end;
2515 end;
2516 end;
2517 end else if TObject(Node.Data) is TBoard then begin
2518 Board := TBoard(Node.Data);
2519 if Board.UnRead > 0 then
2520 TreeView.Canvas.Font.Style := [fsBold];
2521 end;
2522 end;
2523 end;
2524
2525 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2526 begin
2527 TreeView.Invalidate;
2528
2529 if TObject(Node.Data) is TBBS then begin
2530 TBBS(Node.Data).NodeExpand := True;
2531 end else if TObject(Node.Data) is TCategory then begin
2532 TCategory(Node.Data).NodeExpand := True;
2533 end else if TObject(Node.Data) is TBoard then begin
2534 TBoard(Node.Data).NodeExpand := True;
2535 end;
2536 end;
2537
2538 procedure TGikoForm.ListViewAllSelect;
2539 begin
2540 ListView.SetFocus;
2541 ListView.SelectAll;
2542 end;
2543 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2544 begin
2545 if csDestroying in Self.ComponentState then
2546 Exit;
2547 AddMessageList(Msg, nil, Icon);
2548 end;
2549 // *************************************************************************
2550 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?
2551 // *************************************************************************
2552 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2553 var
2554 ATitle: string;
2555 s: string;
2556 boardPlugIn : TBoardPlugIn;
2557 i: Integer;
2558 Res : TResRec;
2559 begin
2560 try
2561 if csDestroying in Self.ComponentState then
2562 Exit;
2563 if Item.DownType = gdtBoard then
2564 ATitle := Item.Board.Title
2565 else
2566 ATitle := Item.ThreadItem.Title;
2567 if ATitle = '' then
2568 ATitle := GikoSys.GetGikoMessage(gmUnKnown);
2569
2570 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2571 //鐃緒申鐃緒申鐃?鐃緒申
2572 if Item.DownType = gdtBoard then begin
2573 //鐃緒申
2574 Item.SaveListFile;
2575 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureItiran), nil, gmiOK);
2576 if GetActiveList = Item.Board then begin
2577 FActiveList := nil;
2578 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申
2579 if (GikoSys.Setting.AutoSortThreadList) then begin
2580 GikoSys.Setting.BoardSortIndex := 0;
2581 GikoSys.Setting.BoardSortOrder := True;
2582 end;
2583 Sort.SetSortDate(Now());
2584 SetActiveList(Item.Board);
2585 end;
2586 Item.Board.Modified := True;
2587 Item.Board.IsThreadDatRead := True;
2588 PlaySound('New');
2589 ListView.Refresh;
2590 end else if Item.DownType = gdtThread then begin
2591 //鐃?鐃緒申
2592 Item.SaveItemFile;
2593 Item.ThreadItem.NewArrival := True;
2594 //if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2595 if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2596 //boardPlugIn := Item.ThreadItem.BoardPlugIn;
2597 boardPlugIn := Item.ThreadItem.ParentBoard.BoardPlugIn;
2598 THTMLCreate.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 ), @Res);
2599 Item.ThreadItem.Title := Res.FTitle;
2600 ATitle := Item.ThreadItem.Title;
2601 end else if ATitle = '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?' then begin
2602 THTMLCreate.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1), @Res);
2603 ATitle := Res.FTitle;
2604 end;
2605 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2606 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin
2607 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2608 break;
2609 end;
2610 end;
2611 if GikoSys.Setting.BrowserTabVisible then begin
2612 if GetActiveContent = Item.ThreadItem then
2613 InsertBrowserTab(Item.ThreadItem)
2614 else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then
2615 InsertBrowserTab(Item.ThreadItem, True)
2616 else
2617 InsertBrowserTab(Item.ThreadItem, False);
2618
2619 end else begin
2620 if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then
2621 InsertBrowserTab(Item.ThreadItem);
2622 end;
2623
2624 Application.ProcessMessages;
2625
2626 if Item.State = gdsComplete then begin
2627 PlaySound('New');
2628 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureSyutoku), nil, gmiOK);
2629 //Add by Genyakun
2630 DiffComp := True;
2631 end else begin
2632 PlaySound('NewDiff');
2633 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureDiff), nil, gmiOK);
2634 //Add by Genyakun
2635 DiffComp := True;
2636 end;
2637
2638 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2639 if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
2640 // 2ch鐃緒申鐃?鐃緒申鐃?1000鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2641 if (Item.ThreadItem.ParentBoard.Is2ch) then begin
2642 Item.ThreadItem.Round := False;
2643 AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
2644 end;
2645 end;
2646 TreeView.Refresh;
2647 //ListView鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
2648 UpdateListView();
2649 RefreshListView(Item.ThreadItem);
2650 end;
2651
2652 end else if Item.State = gdsNotModify then begin
2653 //鐃緒申鐃?鐃?鐃?
2654 { if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
2655 //SetContent(Item.ThreadItem);
2656 InsertBrowserTab(Item.ThreadItem);
2657 end;}
2658 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmNotMod), nil, gmiSAD);
2659 PlaySound('NoChange');
2660 Screen.Cursor := crDefault;
2661 end else if Item.State = gdsAbort then begin
2662 //鐃緒申鐃?
2663 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
2664 end else if Item.State = gdsError then begin
2665 //鐃?鐃緒申鐃?
2666 s := Item.ErrText;
2667 if s <> '' then
2668 s := ':' + s;
2669 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmError) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG);
2670 // if Item.ResponseCode = 302 then
2671 // AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG);
2672 PlaySound('Error');
2673 end;
2674 finally
2675 Item.Free;
2676 Dec(FWorkCount);
2677 if FWorkCount < 0 then FWorkCount := 0;
2678 if FWorkCount = 0 then begin
2679 try
2680 Animate.Active := False;
2681 finally
2682 Screen.Cursor := crDefault;
2683 end;
2684 end;
2685
2686 end;
2687 end;
2688
2689 procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
2690 begin
2691 // SetProgressValue(Number, 0, AWorkCountMax);
2692 // ProgressBar.Visible := True;
2693 if csDestroying in Self.ComponentState then
2694 Exit;
2695
2696 ProgressBar.Position := 0;
2697 ProgressBar.Max := AWorkCountMax;
2698 FDownloadTitle := AWorkTitle;
2699 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申';
2700 FDownloadMax := AWorkCountMax;
2701 end;
2702
2703 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
2704 begin
2705 if csDestroying in Self.ComponentState then
2706 Exit;
2707 ProgressBar.Position := 0;
2708 if FDownloadMax <> 0 then
2709 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
2710 end;
2711
2712 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
2713 begin
2714 if csDestroying in Self.ComponentState then
2715 Exit;
2716 ProgressBar.Position := AWorkCount;
2717 // SetProgressValue(Number, AWorkCount);
2718 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
2719 end;
2720
2721 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
2722 var
2723 ListItem: TListItem;
2724 begin
2725 MessageListView.Items.BeginUpdate;
2726 try
2727 ListItem := MessageListView.Items.Add;
2728 ListItem.Caption := ACaption;
2729 ListItem.Data := AObject;
2730 ListItem.MakeVisible(False);
2731 case Icon of
2732 gmiOK: ListItem.ImageIndex := 0;
2733 gmiSAD: ListItem.ImageIndex := 1;
2734 gmiNG: ListItem.ImageIndex := 2;
2735 gmiWhat: ListItem.ImageIndex := 3;
2736 end;
2737 finally
2738 MessageListView.Items.EndUpdate;
2739 end;
2740 end;
2741
2742 //! 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Browser鐃緒申鐃?鐃緒申
2743 procedure TGikoForm.ReleaseOldestBrowser;
2744 var
2745 i: Integer;
2746 begin
2747 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2748 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2749 TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2750 ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
2751 break;
2752 end;
2753 end;
2754 end;
2755
2756 function TGikoForm.InsertBrowserTab(
2757 ThreadItem : TThreadItem;
2758 ActiveTab : Boolean = True
2759 ) : TBrowserRecord;
2760 var
2761 i, j, idx : Integer;
2762 favItem : TFavoriteThreadItem;
2763 newBrowser : TBrowserRecord;
2764 ins : Integer;
2765 begin
2766
2767 Result := nil;
2768 if Threaditem = nil then Exit;
2769
2770 if ThreadItem.IsLogFile then begin
2771 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申browser鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2772 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申Active鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2773 if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
2774 (FActiveContent.Browser <> BrowserNullTab.Browser)then begin
2775 j := FBrowsers.IndexOf(FActiveContent.Browser);
2776 if j = BROWSER_COUNT - 1 then
2777 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2778 end;
2779 favItem := TFavoriteThreadItem.Create(ThreadItem.URL, ThreadItem.Title );
2780 if not FHistoryList.AddHistory( favItem, TreeView, FTreeType ) then
2781 favItem.Free;
2782
2783 for i := 0 to BrowserTab.Tabs.Count - 1 do begin
2784 if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin
2785 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
2786 Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] );
2787 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin
2788 //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2789 ReleaseOldestBrowser;
2790 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2791 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2792 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2793 end;
2794 if ActiveTab then begin
2795 BrowserTab.TabIndex := i;
2796 BrowserTab.OnChange(nil);
2797 BrowserTab.Repaint;
2798 end;
2799 Exit;
2800 end;
2801 end;
2802 end;
2803 idx := BrowserTab.TabIndex;
2804 newBrowser := TBrowserRecord.Create;
2805 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2806 ReleaseOldestBrowser;
2807 newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2808 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2809 newBrowser.thread := ThreadItem;
2810 newBrowser.Repaint := true;
2811
2812 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
2813 BrowserTab.Tabs.InsertObject(0, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2814 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2815 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2816 end;// else begin
2817 //end;
2818 BrowserTab.Repaint;
2819 if ActiveTab then begin
2820 BrowserTab.TabIndex := 0;
2821 end;
2822 end else if GikoSys.Setting.BrowserTabAppend = gtaLast then begin
2823 i := BrowserTab.Tabs.AddObject(GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2824 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2825 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2826 end;
2827 //end;
2828 BrowserTab.Repaint;
2829 if ActiveTab then begin
2830 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2831 BrowserTab.TabIndex := 0
2832 else
2833 BrowserTab.TabIndex := i;
2834 end;
2835 end else begin
2836 // 鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2837 ins := -1;
2838 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2839 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2840 TWebBrowser(FBrowsers[1]) then begin
2841 ins := i;
2842 break;
2843 end;
2844 end;
2845 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2846 Inc(ins);
2847 end;
2848 // 鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2849 if (ins < 0) then begin
2850 ins := 0;
2851 end;
2852 BrowserTab.Tabs.InsertObject(ins, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2853 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2854 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2855 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2856 end else begin
2857 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2858 end;
2859 end;
2860 //end;
2861 BrowserTab.Repaint;
2862 if ActiveTab then begin
2863 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2864 BrowserTab.TabIndex := 0
2865 else
2866 BrowserTab.TabIndex := ins;
2867 end;
2868 end;
2869 Result := newBrowser;
2870 if(ActiveTab) or (idx = -1) then begin
2871 BrowserTab.OnChange(nil);
2872 end;
2873 end else begin
2874 if BrowserNullTab = nil then begin
2875 BrowserNullTab := TBrowserRecord.Create;
2876 BrowserNullTab.Browser := Browser;
2877 end;
2878 // if BrowserNullTab.thread <> ThreadItem then begin
2879 // BrowserNullTab.Movement := '';
2880 // end;
2881 BrowserNullTab.thread := ThreadItem;
2882 Result := BrowserNullTab;
2883 BrowserTab.TabIndex := -1;
2884 SetContent(BrowserNullTab);
2885 end;
2886
2887 if GikoSys.Setting.URLDisplay then
2888 AddressComboBox.Text := ThreadItem.URL;
2889
2890 end;
2891
2892 procedure TGikoForm.SetContent(inThread : TBrowserRecord);
2893 var
2894 BBSID: string;
2895 FileName: string;
2896 sTitle: string;
2897 doc: OleVariant;
2898 s: string;
2899 idx: Integer;
2900 ThreadItem: TThreadItem;
2901 Thread: TBrowserRecord;
2902 ThreadTitle, ThreadPTitle: string;
2903 ThreadIsLog, {ThreadUnRead,} ThreadNewArraical: boolean;
2904 begin
2905 Thread := inThread;
2906 idx := BrowserTab.TabIndex;
2907 if (not FStartUp) and
2908 (FActiveContent <> nil) and
2909 (FActiveContent.Thread <> Thread.Thread) and
2910 (FActiveContent.Browser <> nil) and
2911 (Assigned(FActiveContent.Browser.ControlInterface.Document)) then begin
2912 try
2913 try
2914 FActiveContent.Thread.ScrollTop := FActiveContent.Browser.OleObject.Document.Body.ScrollTop;
2915 except
2916 on E: Exception do
2917 MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0);
2918 end;
2919 finally
2920 end;
2921 end;
2922 if not (Assigned(Thread)) or (Thread.Thread = nil) then begin
2923 Thread.Browser.Navigate(BLANK_HTML);
2924 BrowserBoardNameLabel.Caption := '';
2925 ItemBoardImage.Picture := nil;
2926 BrowserNameLabel.Caption := '';
2927 ItemImage.Picture := nil;
2928 BrowserNullTab.Thread := nil;
2929 //TOleControl(BrowserNullTab.Browser).Visible := true;
2930 ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
2931 FActiveContent := nil;
2932 Exit;
2933 end else if Thread.Browser = nil then begin
2934 if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then
2935 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2936 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2937 ReleaseOldestBrowser;
2938 Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2939 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2940 end;
2941
2942 ThreadTitle := Thread.Thread.Title;
2943 ThreadPTitle := Thread.Thread.ParentBoard.Title;
2944 //ThreadScrollTop := Thread.Thread.ScrollTop;
2945 if Thread.Thread.IsLogFile then