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.681 - (show annotations) (download) (as text)
Wed Oct 8 15:35:40 2008 UTC (15 years, 6 months ago) by eggcake
Branch: MAIN
CVS Tags: v1_59_0_773
Changes since 1.680: +3 -1 lines
File MIME type: text/x-pascal
保存したタブのログが存在しない場合にFActiveContentがNilになりPostMessageでこけるバグを修正

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