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.660 - (show annotations) (download) (as text)
Thu Feb 14 16:48:00 2008 UTC (16 years, 2 months ago) by h677
Branch: MAIN
CVS Tags: v1_57_0_741
Changes since 1.659: +8 -6 lines
File MIME type: text/x-pascal
ダウンロード中の終了で、クラッシュする不具合対応(eggcakeさんありがとう)

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