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.651 - (show annotations) (download) (as text)
Wed Sep 19 15:00:38 2007 UTC (16 years, 7 months ago) by h677
Branch: MAIN
Changes since 1.650: +12 -1 lines
File MIME type: text/x-pascal
初期化時に問題があったときに、ギコナビを終了するようにした。

1 unit Giko;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils,
8 {$IF Defined(DELPRO) }
9 SHDocVw,
10 MSHTML,
11 {$ELSE}
12 SHDocVw_TLB,
13 MSHTML_TLB,
14 {$IFEND}
15 IdHTTP, ActiveX, ActnList, ImgList,
16 ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils,
17 CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload,
18 Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent,
19 {HintWindow,} GikoCoolBar, GikoListView, Search, ExternalBoardManager,
20 ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,
21 IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem,
22 ShellAPI,Preview, HistoryList, ResPopupBrowser;
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 //! D&D鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
696 procedure WMDropFiles(var Msg: TWMDropFiles); Message WM_DropFiles;
697 //! 鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?
698 function isValidFile(FileName: String) : boolean;
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
706 public
707 { Public 鐃緒申鐃緒申 }
708 LastRoundTime: TDateTime;
709 BrowserNullTab: TBrowserRecord;
710 FControlThread: TThreadControl;
711 FIconData : TNotifyIconData;
712 procedure MoveToURL(const inURL: string);
713 function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
714 procedure ReloadBBS;
715 function GetHttpState: Boolean;
716 procedure SetEnabledCloseButton(Enabled: Boolean);
717 function GetTreeNode(Data: TObject): TTreeNode;
718 procedure ListViewAllSelect;
719 property ListStyle: TViewStyle read FListStyle write FListStyle;
720 property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
721 property ViewType: TGikoViewType read FViewType write FViewType;
722 property NameCookie: string read FNameCookie write FNameCookie;
723 property MailCookie: string read FMailCookie write FMailCookie;
724 property ClickNode: TTreeNode read FClickNode write FClickNode;
725 property TreeType: TGikoTreeType read FTreeType write FTreeType;
726 property ActiveContent: TBrowserRecord read FActiveContent write FActiveContent;
727 property ResRangeMenuSelect: Longint read FResRangeMenuSelect write FResRangeMenuSelect;
728 property SelectResWord : string read FSelectResWord write FSelectResWord;
729 property BrowserSizeWidth: Integer read FBrowserSizeWidth write FBrowserSizeWidth;
730 property BrowserSizeHeight: Integer read FBrowserSizeHeight write FBrowserSizeHeight;
731 property SearchDialog: TSearchDialog read FSearchDialog write FSearchDialog;
732 property ToolBarSettingSender : TToolBarSettingSenderType
733 read FToolBarSettingSender write FToolBarSettingSender;
734 property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
735 property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
736 property WorkCount: Integer read FWorkCount write FWorkCount;
737 procedure SetContent(inThread: TBrowserRecord);
738 function GetActiveContent(popup :Boolean = false): TThreadItem;
739 function GetActiveList: TObject;
740
741 procedure SetListViewType(AViewType: TGikoViewType); overload;
742 procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
743 procedure PlaySound(SoundEventName: string);
744 procedure ShowBBSTree( inBBS : TBBS );
745 procedure ShowBBSTreeOld( inBBS : TBBS );
746 procedure ShowHistoryTree;
747 procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
748 procedure SetBrowserTabState;
749 procedure SetToolBarPopup;
750 procedure ShowFavoriteAddDialog( Item : TObject );
751 procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
752 procedure RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);
753 property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
754 property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
755 property OddColor : TColor read FOddColor write FOddColor;
756 function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
757 procedure OnPlugInMenuItem( Sender : TObject );
758 procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
759 /// ListView 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申 KuroutSetting鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
760 procedure ActiveListColumnSave;
761 procedure SetActiveList(Obj: TObject);
762 property ActiveList: TObject read GetActiveList write SetActiveList;
763 /// CoolBar 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
764 procedure CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
765 //鐃緒申鐃緒申ID鐃緒申鐃緒申鐃緒申鐃?鐃緒申
766 procedure IndividualAbonID(Atype : Integer);
767 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申
768 procedure IndividualAbon(Atag, Atype : Integer);
769 //鐃緒申鐃緒申ID鐃緒申NG鐃緒申鐃?鐃?鐃緒申鐃?鐃?
770 procedure AddIDtoNGWord(invisible : boolean);
771 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申 true:鐃?鐃緒申鐃緒申鐃?鐃? false:鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
772 procedure RepaintAllTabsBrowser();
773 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
774 procedure SetLinkBar;
775 procedure FavoriteBrowseFolder( node: TTreeNode );
776 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
777 procedure DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False);
778 //鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
779 procedure DownloadList(Board: TBoard; ForceDownload: Boolean = False);
780 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
781 procedure DeleteHistory( threadItem: TThreadItem );
782 //鐃?鐃?鐃緒申鐃緒申鐃緒申 鐃?鐃緒申鐃?鐃?鐃?鐃緒申
783 procedure DeleteTab(ThreadItem: TThreadItem); overload;
784 //鐃?鐃?鐃緒申鐃緒申鐃緒申 鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
785 procedure DeleteTab(BrowserRecord: TBrowserRecord); overload;
786 // 鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
787 procedure DeleteTab(index, selectIndex: Integer); overload;
788 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
789 procedure BrowserMovement(const AName: string); overload;
790 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
791 procedure BrowserMovement(scroll: Integer); overload;
792 //Application鐃緒申MainForm鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
793 function GetMainForm(): TComponent;
794 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
795 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?
796 procedure OnGestureStart(Sender: TObject);
797 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申
798 procedure OnGestureMove(Sender: TObject);
799 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
800 procedure OnGestureEnd(Sender: TObject);
801 /// 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
802 procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
803 //ListView鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
804 procedure SelectListItem(List: TList);
805 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
806 procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
807 //
808 procedure ModifySelectList;
809 //
810 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;
811 //
812 procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
813 //
814 procedure SetSelectRoundName(Sender: TObject);
815 //
816 function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
817 //
818 function WebBrowserClick(Sender: TObject): WordBool;
819 //! 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
820 procedure SetSelectComboBox();
821
822 //! 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
823 procedure TaskTrayIconMessage(var Msg : TMsg); message WM_USER + 2010;
824 //! 鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申
825 procedure StoredTaskTray;
826 published
827 property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
828 end;
829
830 TFavoriteMenuItem = class(TMenuItem)
831 private
832 FData : Pointer;
833 public
834 property Data: Pointer read FData write FData;
835 end;
836
837 TBBSMenuItem = class(TMenuItem)
838 private
839 FData : Pointer;
840 public
841 property Data: Pointer read FData write FData;
842 end;
843
844 TLinkToolButton = class(TToolButton)
845 private
846 FData : Pointer;
847 public
848 property Data: Pointer read FData write FData;
849 end;
850
851 var
852 GikoForm: TGikoForm;
853
854 implementation
855
856 uses
857 GikoUtil, IndividualAbon, Math, Kotehan, KeySetting,
858 YofUtils, ToolBarUtil, ToolBarSetting,
859 GikoXMLDoc, RoundName, IniFiles, FavoriteAdd,
860 FavoriteArrange, AddressHistory, Gesture,
861 About, Option, Round, Splash, Sort, ListSelect, Imm,
862 NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter,
863 HTMLCreate, ListViewUtils, GikoDataModule, GikoMessage,
864 InputAssistDataModule, Types, ReplaceDataModule;
865
866 const
867 BLANK_HTML: string = 'about:blank';
868 BROWSER_COUNT = 5; //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
869 //D&D鐃緒申鐃?
870 DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel)
871 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
872 HTML_FILE_NAME = 'temp_preview.html';
873 //鐃緒申鐃?鐃?鐃?鐃?ID
874 USER_TREECLICK = WM_USER + 2000;
875 USER_RESIZED = WM_USER + 2001;
876 USER_MINIMIZED = WM_USER + 2002;
877 USER_SETLINKBAR = WM_USER + 2003;
878 USER_DOCUMENTCOMPLETE = WM_USER + 2004; ///< wParam : TWebBrowser
879 USER_TASKTRAY = WM_USER + 2010;
880 {$R *.DFM}
881
882 procedure TGikoForm.CreateParams(var Params: TCreateParams);
883 begin
884 inherited;
885 if FormStyle in [fsNormal, fsStayOnTop] then begin
886 if BorderStyle in [bsSingle, bsSizeable] then begin
887 Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
888 Params.WndParent := 0;
889 end;
890 end;
891 end;
892
893 procedure TGikoForm.FormCreate(Sender: TObject);
894 const
895 TVS_NOTOOLTIPS = $0080;
896 var
897 FileName: string;
898 Style: DWORD;
899 msg: string;
900 i: Integer;
901 wp: TWindowPlacement;
902 begin
903 {$IFDEF DEBUG}
904 AllocConsole;
905 Writeln('============================================================');
906 Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
907 Writeln('');
908 Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
909 Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
910 Writeln('============================================================');
911 {$ENDIF}
912 //try
913 Sort.SetSortDate(Now());
914
915 FTreeType := gttNone;
916 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
917 FStartUp := true;
918 Application.HookMainWindow(Hook);
919 FIsIgnoreResize := rtResizing;
920 //ActionList鐃緒申GuoupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?0鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
921 //(鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申Down鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申)
922 //鐃緒申鐃緒申鐃緒申鐃緒申Set鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?Action鐃緒申Checked鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
923 GetGroupIndex(GikoDM.GikoFormActionList);
924 FSearchDialog := nil;
925 FResPopupBrowser := nil;
926 CreateBrowsers(BROWSER_COUNT);
927 FIconData.uID := 0;
928
929 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
930 SetMenuFont;
931
932 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
933 Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
934
935 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
936 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
937
938 EnabledCloseButton := True;
939
940 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
941 ListView.ViewStyle := GikoSys.Setting.ListStyle;
942
943 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
944 AnimePanel.Top := 0;
945 AnimePanel.Left := 0;
946
947 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
948
949 //鐃?鐃緒申鐃?鐃?鐃?鐃?
950 CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
951
952 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
953 GikoDM.MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
954 GikoDM.MsgBarVisibleActionExecute(nil);
955 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
956
957 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
958 GikoDM.StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
959 GikoDM.StatusBarVisibleActionExecute(nil);
960
961 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
962 TreeView.Items.BeginUpdate;
963 FavoriteTreeView.Items.BeginUpdate;
964 ListView.Items.BeginUpdate;
965 try
966 TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
967 TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
968 TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
969 TreeView.Color := GikoSys.Setting.CabinetBackColor;
970 FavoriteTreeView.Font.Assign(TreeView.Font);
971 FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
972
973 ListView.Font.Name := GikoSys.Setting.ListFontName;
974 ListView.Font.Size := GikoSys.Setting.ListFontSize;
975 ListView.Font.Color := GikoSys.Setting.ListFontColor;
976 ListView.Font.Style := [];
977 if GikoSys.Setting.ListFontBold then
978 ListView.Font.Style := [fsbold];
979 if GikoSys.Setting.ListFontItalic then
980 ListView.Font.Style := ListView.Font.Style + [fsitalic];
981
982 ListViewBackGroundColor := clWhite; // 鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
983 ListViewBackGroundColor := GikoSys.Setting.ListBackColor; // 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
984 FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
985 FOddColor := GikoSys.Setting.OddColor;
986
987 finally
988 TreeView.Items.EndUpdate;
989 FavoriteTreeView.Items.EndUpdate;
990 ListView.Items.EndUpdate;
991 end;
992 //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
993 GikoDM.ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
994
995 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
996 GikoDM.MuteAction.Checked := GikoSys.Setting.Mute;
997
998 // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
999 FResRangeMenuSelect := GikoSys.ResRange;
1000 case GikoSys.ResRange of
1001 Ord( grrAll ):
1002 begin
1003 GikoDM.AllResAction.Execute;
1004 end;
1005 Ord( grrSelect ):
1006 begin
1007 SelectComboBox.Text := SelectComboBox.Items[ 1 ];
1008 GikoDM.SelectResAction.Checked := True;
1009 end;
1010 else
1011 case FResRangeMenuSelect of
1012 Ord( grrKoko ): GikoDM.OnlyKokoResAction.Checked := True;
1013 Ord( grrNew ): GikoDM.OnlyNewResAction.Checked := True;
1014 100: GikoDM.OnlyAHundredResAction.Checked := True;
1015 end;
1016 end;
1017
1018 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1019 case GikoSys.Setting.ThreadRange of
1020 gtrAll:
1021 begin
1022 GikoDM.AllItemAction.Checked := True;
1023 ViewType := gvtAll;
1024 end;
1025 gtrLog:
1026 begin
1027 GikoDM.LogItemAction.Checked := True;
1028 ViewType := gvtLog;
1029 end;
1030 gtrNew:
1031 begin
1032 GikoDM.NewItemAction.Checked := True;
1033 ViewType := gvtNew;
1034 end;
1035 gtrLive:
1036 begin
1037 GikoDM.LiveItemAction.Checked := True;
1038 ViewType := gvtLive;
1039 end;
1040 gtrArch:
1041 begin
1042 GikoDM.ArchiveItemAction.Checked := True;
1043 ViewType := gvtArch;
1044 end;
1045 end;
1046
1047
1048 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1049 BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1050 BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1051 BrowserTab.Font.Style := [];
1052 if GikoSys.Setting.BrowserTabFontBold then
1053 BrowserTab.Font.Style := [fsBold];
1054 if GikoSys.Setting.BrowserTabFontItalic then
1055 BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic];
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 {$IFDEF SPAM_FILTER_ENABLED}
1294 // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1295 GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
1296 {$ENDIF}
1297
1298 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1299 MouseGesture := TMouseGesture.Create;
1300 GikoSys.Setting.Gestures.LoadGesture(
1301 GikoSys.Setting.GetGestureFileName, GikoDM.GikoFormActionList );
1302 MouseGesture.Margin := GikoSys.Setting.Gestures.Margin;
1303 MouseGesture.OnGestureStart := OnGestureStart;
1304 MouseGesture.OnGestureMove := OnGestureMove;
1305 MouseGesture.OnGestureEnd := OnGestureEnd;
1306 if GikoSys.Setting.GestureEnabled then
1307 MouseGesture.SetHook( Handle );
1308
1309 //2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1310 GikoSys.SetGikoMessage;
1311
1312 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1313 if GikoSys.Setting.AutoLogin then
1314 GikoDM.LoginAction.Execute;
1315
1316 GikoSys.Setting.BeLogin := GikoSys.Setting.BeAutoLogin;
1317
1318 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1319 FavoriteAddToolButton.Caption := '鐃緒申鐃緒申...';
1320 AntiIndivAbonMenuItem.Caption := '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申';
1321
1322 //鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1323 InputAssistDM.Init(GikoSys.GetInputAssistFileName);
1324
1325 //鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1326 ReplaceDM.LoadFromFile(GikoSys.GetReplaceFileName);
1327
1328 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?
1329 ResPopupClearTimer.Interval := GikoSys.Setting.RespopupWait;
1330
1331 // D&D鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1332 DragAcceptFiles(Self.Handle, True);
1333
1334 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?
1335 if (FavoriteDM.AbEnd) then begin
1336 GikoUtil.MsgBox(Self.Handle, '鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?',
1337 '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
1338 Self.Close;
1339 end;
1340
1341 end;
1342
1343 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1344 procedure TGikoForm.SaveCoolBarSettings;
1345 begin
1346
1347 if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then
1348 Exit;
1349 SaveMainCoolBarSettings;
1350 SaveBoardCoolBarSettings;
1351 SaveBrowserCoolBarSettings;
1352
1353 end;
1354 procedure TGikoForm.SaveMainCoolBarSettings;
1355 var
1356 i : Integer;
1357 CoolSet : TCoolSet;
1358 begin
1359 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1360 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1361 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1362 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1363 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1364 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1365 end;
1366 end;
1367 procedure TGikoForm.SaveBoardCoolBarSettings;
1368 var
1369 i : Integer;
1370 CoolSet : TCoolSet;
1371 begin
1372 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1373 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1374 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1375 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1376 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1377 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1378 end;
1379 end;
1380 procedure TGikoForm.SaveBrowserCoolBarSettings;
1381 var
1382 i : Integer;
1383 CoolSet : TCoolSet;
1384 begin
1385 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1386 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1387 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1388 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1389 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1390 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1391 end;
1392 end;
1393 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1394 procedure TGikoForm.LoadCoolBarSettings;
1395 var
1396 i : Integer;
1397 CoolSet : TCoolSet;
1398 begin
1399
1400 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1401 MainCoolBar.Bands.BeginUpdate;
1402 try
1403 // for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1404 for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin
1405 CoolSet := GikoSys.Setting.MainCoolSet[i];
1406 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1407 FIsIgnoreResize := rtNone;
1408 SaveCoolBarSettings;
1409 Exit;
1410 end;
1411 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1412 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1413 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1414 end;
1415 finally
1416 MainCoolBar.Bands.EndUpdate;
1417 end;
1418
1419 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1420 ListCoolBar.Bands.BeginUpdate;
1421 try
1422 // for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1423 for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin
1424 CoolSet := GikoSys.Setting.ListCoolSet[i];
1425 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1426 FIsIgnoreResize := rtNone;
1427 SaveCoolBarSettings;
1428 Exit;
1429 end;
1430 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1431 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1432 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1433 end;
1434 finally
1435 ListCoolBar.Bands.EndUpdate;
1436 end;
1437
1438 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1439 BrowserCoolBar.Bands.BeginUpdate;
1440 try
1441 // for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1442 for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
1443 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1444 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1445 FIsIgnoreResize := rtNone;
1446 SaveCoolBarSettings;
1447 Exit;
1448 end;
1449 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1450 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1451 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1452 end;
1453 finally
1454 BrowserCoolBar.Bands.EndUpdate;
1455 end;
1456
1457 end;
1458 //
1459 procedure TGikoForm.FormShow(Sender: TObject);
1460 var
1461 item : TThreadItem;
1462 begin
1463 if FStartUp then begin
1464 ShowWindow(Application.Handle, SW_HIDE);
1465
1466 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1467 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1468 GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1469 GikoDM.StdToolBarVisibleActionExecute( nil );
1470 GikoDM.AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1471 GikoDM.AddressBarVisibleActionExecute( nil );
1472 GikoDM.LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1473 GikoDM.LinkBarVisibleActionExecute( nil );
1474 GikoDM.ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1475 GikoDM.ListToolBarVisibleActionExecute( nil );
1476 GikoDM.ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1477 GikoDM.ListNameBarVisibleActionExecute( nil );
1478 GikoDM.BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1479 GikoDM.BrowserToolBarVisibleActionExecute( nil );
1480 GikoDM.BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1481 GikoDM.BrowserNameBarVisibleActionExecute( nil );
1482
1483 // CoolBar 鐃緒申鐃緒申
1484 LoadCoolBarSettings;
1485
1486 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1487 // ResetBandInfo( ListCoolBar, ListToolBar );
1488 FIsIgnoreResize := rtNone;
1489
1490 //FormCrete鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1491 if GikoSys.Setting.TabAutoLoadSave then begin
1492 GikoDM.TabsOpenAction.Tag := 1;
1493 GikoDM.TabsOpenAction.Execute;
1494 GikoDM.TabsOpenAction.Tag := 0;
1495 if (GikoSys.Setting.LastCloseTabURL <> '') then begin
1496 PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 );
1497 if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
1498 while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and
1499 (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
1500 Application.ProcessMessages;
1501 end;
1502 end;
1503 item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL );
1504 if (item <> nil) and (item.IsLogFile) then begin
1505 OpenThreadItem(item, item.URL);
1506 end;
1507 GikoSys.Setting.LastCloseTabURL := '';
1508 end;
1509 end;
1510
1511 //ActionList鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1512 SetGroupIndex(GikoDM.GikoFormActionList);
1513
1514 FStartUp := false;
1515 end;
1516 end;
1517
1518 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1519 begin
1520 // if GikoForm.WindowState <> wsMinimized then
1521 // SaveCoolBarSettings;
1522 CanClose := True;
1523 if ( GikoSys.Setting.ShowDialogForEnd ) and
1524 (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1525 CanClose := false;
1526 Exit;
1527 end;
1528
1529 GikoSys.Setting.LastCloseTabURL := '';
1530 if GikoSys.Setting.TabAutoLoadSave then begin
1531 GikoDM.TabsSaveAction.Execute;
1532 if (GetActiveContent <> nil) and
1533 (GetActiveContent.IsLogFile) then begin
1534 GikoSys.Setting.LastCloseTabURL := GetActiveContent.URL;
1535 end;
1536 end;
1537
1538 if (SearchDialog <> nil) then begin
1539 if (SearchDialog.Visible) then begin
1540 SearchDialog.Close;
1541 try
1542 SearchDialog.Release;
1543 except
1544 end;
1545 SearchDialog := nil;
1546 end;
1547 end;
1548
1549 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?EditorForm鐃緒申鐃緒申鐃緒申鐃緒申
1550 GikoDM.CloseAllEditorAction.Execute;
1551
1552 Application.UnhookMainWindow(Hook);
1553 Application.Terminate;
1554 end;
1555
1556 procedure TGikoForm.FormDestroy(Sender: TObject);
1557 var
1558 i : Integer;
1559 wp : TWindowPlacement;
1560 tmpBool : Boolean;
1561 begin
1562 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1563 try
1564 MouseGesture.Clear;
1565 MouseGesture.UnHook;
1566 MouseGesture.Free;
1567 MouseGesture := nil;
1568 except
1569 end;
1570 try
1571 ActiveListColumnSave;
1572 except
1573 end;
1574 try
1575 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1576 wp.length := sizeof(wp);
1577 GetWindowPlacement(Handle, @wp);
1578 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1579 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1580 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1581 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1582 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1583
1584 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1585 GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked;
1586 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1587 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1588 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1589 if GikoDM.ArrangeAction.Checked then
1590 GikoSys.Setting.ListOrientation := gloVertical
1591 else
1592 GikoSys.Setting.ListOrientation := gloHorizontal;
1593 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1594 except
1595 end;
1596
1597 try
1598 // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1599 if not GikoSys.Setting.ResRangeHold then
1600 GikoSys.Setting.ResRange := FResRangeMenuSelect;
1601 except
1602 end;
1603 if WindowState <> wsNormal then
1604 WindowState := wsNormal;
1605 SaveCoolBarSettings;
1606 try
1607 GikoSys.Setting.WriteWindowSettingFile;
1608 GikoSys.Setting.WriteNameMailSettingFile;
1609 except
1610 end;
1611 // 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申 CoolBar 鐃緒申鐃緒申
1612 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1613
1614 // 鐃緒申FormDestroy鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?2004/04/09鐃?
1615 // CoolBar 鐃緒申鐃緒申
1616 //if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then
1617
1618 //鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1619 InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName);
1620
1621 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1622 try
1623 //FavoriteDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1624 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1625 if not (FavoriteDM.AbEnd) then begin
1626 FavoriteDM.WriteFavorite;
1627 end;
1628 FavoriteDM.Clear;
1629 except
1630 end;
1631 LockWindowUpdate(Self.Handle);
1632 try
1633 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1634 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1635 GikoSys.Setting.ShowDialogForAllTabClose := false;
1636 GikoDM.AllTabCloseAction.Execute;
1637 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1638 except
1639 end;
1640 try
1641 for i := FBrowsers.Count - 1 downto 0 do begin
1642 TWebBrowser(FBrowsers[i]).Free;
1643 end;
1644 FBrowsers.Clear;
1645 FBrowsers.Capacity := 0;
1646 finally
1647 FBrowsers.Free;
1648 end;
1649 try
1650 if BrowserNullTab <> nil then begin
1651 BrowserNullTab.Browser := nil; {*BrowserNullTab鐃緒申Browser鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
1652 *鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Free鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1653 *}
1654 BrowserNullTab.Free;
1655 end;
1656 except
1657 end;
1658
1659 try
1660 TreeView.Items.BeginUpdate;
1661 TreeView.Items.GetFirstNode.Free;
1662 TreeView.Items.Clear;
1663 TreeView.Items.EndUpdate;
1664 except
1665 end;
1666
1667 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1668 try
1669 //AddressHistoryDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1670 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
1671 except
1672 end;
1673
1674 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1675 try
1676 FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
1677 except
1678 end;
1679 try
1680 try
1681 FHistoryList.Clear;
1682 except
1683 end;
1684 finally
1685 FHistoryList.Free;
1686 end;
1687
1688 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1689 try
1690 RoundList.SaveRoundFile;
1691 except
1692 end;
1693 try
1694 try
1695 RoundList.Clear;
1696 except
1697 end;
1698 finally
1699 RoundList.Free;
1700 end;
1701
1702 try
1703 try
1704 FControlThread.Terminate;
1705 FControlThread.WaitFor;
1706 except
1707 end;
1708 finally
1709 FControlThread.Free;
1710 end;
1711 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1712 for i := GikoForm.PlugInMenu.Count - 1 downto 0 do begin
1713 GikoForm.PlugInMenu.items[i].Free;
1714 end;
1715 GikoForm.PlugInMenu.Clear;
1716
1717
1718 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1719 // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1720 // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1721 for i := Length(BoardGroups) - 1 downto 0 do begin
1722 //BoardGroups[i].Clear;
1723 BoardGroups[i].Free;
1724 end;
1725
1726 try
1727 for i := Length( BBSs ) - 1 downto 0 do begin
1728 if BBSs[ i ] <> nil then
1729 BBSs[ i ].Free;
1730 BBSs[ i ] := nil;
1731 end;
1732 except
1733 end;
1734
1735 try
1736 if FEvent <> nil then
1737 FEvent.Free;
1738
1739 try
1740 if FResPopupBrowser <> nil then begin
1741 TOleControl(FResPopupBrowser).Parent := nil;
1742 FResPopupBrowser.Free;
1743 end;
1744
1745 except
1746 end;
1747 //Preview鐃?鐃緒申
1748 if FPreviewBrowser <> nil then begin
1749 FPreviewBrowser.Free;
1750 FPreviewBrowser := nil;
1751 end;
1752 except
1753 end;
1754 LockWindowUpdate(0);
1755 end;
1756
1757 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1758 procedure TGikoForm.SetBBSMenu;
1759 var
1760 i : Integer;
1761 item : TBBSMenuItem;
1762 begin
1763
1764 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1765 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1766 try
1767 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1768 CabinetSelectPopupMenu.Items[ i ].Free;
1769 CabinetMenu.Items[ i ].Free;
1770 BBSSelectPopupMenu.Items[ i ].Free;
1771 end;
1772 except
1773 end;
1774 end;
1775
1776 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1777 for i := Length( BBSs ) - 1 downto 0 do begin
1778 try
1779 item := TBBSMenuItem.Create( PopupMenu );
1780 item.Caption := BBSs[ i ].Title;
1781 item.Data := BBSs[ i ];
1782 item.OnClick := BBSMenuItemOnClick;
1783 CabinetSelectPopupMenu.Items.Insert( 0, item );
1784 item := TBBSMenuItem.Create( PopupMenu );
1785 item.Caption := BBSs[ i ].Title;
1786 item.Data := BBSs[ i ];
1787 item.OnClick := BBSMenuItemOnClick;
1788 CabinetMenu.Insert( 0, item );
1789 item := TBBSMenuItem.Create( PopupMenu );
1790 item.Caption := BBSs[ i ].Title;
1791 item.Data := BBSs[ i ];
1792 item.OnClick := BBSMenuItemOnClick;
1793 BBSSelectPopupMenu.Items.Insert( 0, Item );
1794 except
1795 end;
1796 end;
1797
1798 end;
1799
1800 procedure TGikoForm.ReloadBBS;
1801 var
1802 i : Integer;
1803 tmpBool: Boolean;
1804 begin
1805 LockWindowUpdate(Self.Handle);
1806
1807 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1808 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1809 GikoSys.Setting.ShowDialogForAllTabClose := false;
1810 GikoDM.AllTabCloseAction.Execute;
1811 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1812 SetContent(BrowserNullTab);
1813 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1814 TreeView.Items.Clear;
1815
1816 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1817 try
1818 RoundList.SaveRoundFile;
1819 except
1820 end;
1821 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1822 try
1823 RoundList.Clear;
1824 except
1825 end;
1826
1827 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1828 try
1829 FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
1830 FHistoryList.Clear;
1831 except
1832 end;
1833
1834 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1835 try
1836 FavoriteDM.WriteFavorite;
1837 FavoriteDM.Clear;
1838 except
1839 end;
1840
1841 //鐃緒申鐃?鐃?鐃緒申鐃?PLUGIN鐃緒申鐃?鐃緒申
1842 for i := Length(BoardGroups) - 1 downto 0 do begin
1843 try
1844 BoardGroups[i].Free;
1845 except
1846 end;
1847 end;
1848 //BBS鐃?鐃緒申
1849 try
1850 for i := Length( BBSs ) - 1 downto 0 do begin
1851 if BBSs[ i ] <> nil then
1852 BBSs[ i ].Free;
1853 BBSs[ i ] := nil;
1854 end;
1855 except
1856 end;
1857
1858 ActiveList := nil;
1859
1860 FTreeType := gttNone;
1861
1862 //============鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申================================//
1863
1864 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1865 InitializeBoardPlugIns;
1866
1867 GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1868
1869 // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1870 for i := Length(BBSs) - 1 downto 0 do begin
1871 if not BBSs[i].IsBoardFileRead then
1872 GikoSys.ReadBoardFile(BBSs[i]);
1873 end;
1874
1875 // BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1876 SetBBSMenu;
1877
1878 ShowBBSTree( BBSs[ 0 ] );
1879
1880 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1881 FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml',
1882 TreeView, FTreeType);
1883
1884 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1885 FavoriteDM.ReadFavorite;
1886
1887 SetLinkBar;
1888
1889 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1890 RoundList.LoadRoundBoardFile;
1891 RoundList.LoadRoundThreadFile;
1892
1893 LockWindowUpdate(0);
1894 end;
1895
1896 {!
1897 \todo 鐃緒申鐃緒申 IE 7 鐃緒申鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1898 (IE 7 鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申)
1899 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1900 }
1901 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
1902 var
1903 p: TPoint;
1904 s: string;
1905 tmp2: string;
1906 URL: string;
1907 ATitle: Boolean;
1908
1909 threadItem : TThreadItem;
1910 board : TBoard;
1911 Protocol, Host, Path, Document, Port, Bookmark: string;
1912
1913 wkInt: Integer;
1914 wkIntSt: Integer;
1915 wkIntTo: Integer;
1916 ActiveFileName: string;
1917 e: IHTMLElement;
1918 Ext: string;
1919 PathRec: TPathRec;
1920 Text2: string;
1921 cResPopup: TResPopupBrowser;
1922 begin
1923 // 鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申 about:blank.. 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1924 // IE 7 鐃緒申鐃緒申 about:blank.. 鐃緒申鐃緒申鐃緒申鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申鐃緒申鐃緒申)
1925 if Pos('about:..', Text) = 1 then
1926 Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) )
1927 else
1928 Text2 := Text;
1929 if not( TObject(Sender) is TWebBrowser )then
1930 Exit;
1931 try
1932 try
1933 if (TWebBrowser(Sender) <> nil) and (not TWebBrowser(Sender).Busy) and (Assigned(TWebBrowser(Sender).Document)) then begin
1934 if LowerCase(OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset) <> 'shift_jis' then begin
1935 OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset := 'shift_jis';
1936 end;
1937 end;
1938 except
1939 end;
1940 finally
1941 end;
1942 if PreviewTimer.Enabled then
1943 PreviewTimer.Enabled := False;
1944 Application.CancelHint;
1945 try
1946 if GetActiveContent <> nil then
1947 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
1948 else
1949 ActiveFileName := '';
1950 except
1951 FActiveContent := nil;
1952 Exit;
1953 end;
1954 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1955 if (StatusBar.Panels[1].Text = Text2) then begin
1956 if Text2 = '' then begin
1957 if FResPopupBrowser <> nil then begin
1958 if not(Sender is TResPopupBrowser) then
1959 FResPopupBrowser.Clear
1960 else begin
1961 TResPopupBrowser(Sender).ChildClear;
1962 end;
1963 end;
1964 end;
1965 Exit;
1966 end;
1967 StatusBar.Panels[1].Text := Text2;
1968
1969
1970 if FPreviewBrowser <> nil then
1971 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
1972
1973 if FResPopupBrowser <> nil then begin
1974 if not(Sender is TResPopupBrowser) then begin
1975 if (FResPopupBrowser.Visible) then begin
1976 if ResPopupClearTimer.Interval > 0 then begin
1977 ResPopupClearTimer.Enabled := True;
1978 ResPopupClearTimer.Tag := 0;
1979 end else begin
1980 FResPopupBrowser.Clear;
1981 end;
1982 end;
1983 end else begin
1984 if ResPopupClearTimer.Interval > 0 then begin
1985 ResPopupClearTimer.Enabled := True;
1986 ResPopupClearTimer.Tag := 1;
1987 end else begin
1988 TResPopupBrowser(Sender).ChildClear;
1989 end;
1990 end;
1991 end;
1992 cResPopup := nil;
1993
1994 if not(Sender is TResPopupBrowser) then
1995 if not GikoSys.Setting.UnActivePopup then
1996 if not GikoForm.Active then
1997 Exit;
1998
1999
2000
2001 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2002 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2003
2004 s := '';
2005 Ext := AnsiLowerCase(ExtractFileExt(Text2));
2006 if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
2007 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2008 if FPreviewBrowser = nil then begin
2009 FPreviewBrowser := TPreviewBrowser.Create(Self);
2010 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2011 TOleControl(FPreviewBrowser).Parent := nil;
2012 end;
2013 FPreviewBrowser.Navigate(BLANK_HTML);//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2014 FPreviewURL := Text2;
2015 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2016 PreviewTimer.Enabled := True;
2017 end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin
2018 if Pos('mailto:', Text2) = 1 then begin
2019 s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]);
2020 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2021 GetCursorPos(p);
2022 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2023 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2024 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2025 if (Assigned(e)) then begin
2026 CreateResPopupBrowser;
2027
2028 if not(Sender is TResPopupBrowser) then begin
2029 if (FResPopupBrowser.Visible) then begin
2030 FResPopupBrowser.Clear;
2031 end;
2032 end else begin
2033 TResPopupBrowser(Sender).ChildClear;
2034 end;
2035
2036 cResPopup := FResPopupBrowser.CreateNewBrowser;
2037 tmp2 := ZenToHan(e.Get_outerText);
2038 if (GikoSys.IsNumeric(tmp2)) then begin
2039 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2040 wkIntSt := StrToInt64(tmp2);
2041 wkIntTo := StrToInt64(tmp2);
2042 cResPopup.PopupType := gptThread;
2043 HTMLCreater.SetResPopupText(cResPopup, GetActiveContent(true), wkIntSt, wkIntTo, False, False);
2044 end else begin
2045 cResPopup.PopupType := gptRaw;
2046 cResPopup.Title := s;
2047 end;
2048 end;
2049 end else begin
2050 CreateResPopupBrowser;
2051
2052 if not(Sender is TResPopupBrowser) then begin
2053 if (FResPopupBrowser.Visible) then begin
2054 FResPopupBrowser.Clear;
2055 end;
2056 end else begin
2057 TResPopupBrowser(Sender).ChildClear;
2058 end;
2059
2060 threadItem := GetActiveContent(true);
2061 URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL);
2062 PathRec := Gikosys.Parse2chURL2(URL);
2063 if (PathRec.FNoParam) then begin
2064 PathRec.FSt := 1;
2065 PathRec.FTo := 1;
2066 end else begin
2067 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2068 end;
2069 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2070
2071 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
2072
2073 URL := GikoSys.GetBrowsableThreadURL( URL );
2074 wkIntSt := PathRec.FSt;
2075 wkIntTo := PathRec.FTo;
2076
2077 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2078 wkIntSt := 1;
2079 wkIntTo := 1;
2080 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2081 wkIntSt := wkIntTo;
2082 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2083 wkIntTo := wkIntSt;
2084 end else if wkIntSt > wkIntTo then begin
2085 wkInt := wkIntTo;
2086 wkIntTo := wkIntSt;
2087 wkIntSt := wkInt;
2088 end;
2089 if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
2090 ATitle := false
2091 else
2092 ATitle := true;
2093
2094 threadItem := BBSsFindThreadFromURL( URL );
2095
2096 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2097 board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2098 if board <> nil then begin
2099 if not board.IsThreadDatRead then
2100 GikoSys.ReadSubjectFile( board );
2101 threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
2102 end;
2103 end;
2104
2105 if threadItem <> nil then begin
2106 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2107 //URL鐃緒申鐃緒申鐃緒申鐃緒申/鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2108 if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin
2109 wkIntSt := 1;
2110 wkIntTo := 1;
2111 end;
2112 cResPopup := FResPopupBrowser.CreateNewBrowser;
2113 cResPopup.PopupType := gptThread;
2114 HTMLCreater.SetResPopupText(cResPopup, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2115 end;
2116 end;
2117 end;
2118 if (cResPopup <> nil) then begin
2119 ResPopupClearTimer.Enabled := False;
2120
2121 if cResPopup.PopupType = gptRaw then begin
2122 if cResPopup.Title <> '' then begin
2123 cResPopup.TitlePopup;
2124 end;
2125 end else begin
2126 if cResPopup.RawDocument <> '' then begin
2127 cResPopup.Popup;
2128 end else if cResPopup.Title <> '' then begin
2129 cResPopup.TitlePopup;
2130 end;
2131 end;
2132 end;
2133 end;
2134 end;
2135
2136 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2137 var
2138 SysMenu: HMenu;
2139 begin
2140 FEnabledCloseButton := Enabled;
2141 SysMenu := GetSystemMenu(Handle, False);
2142
2143 if Enabled then begin
2144 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2145 end else begin
2146 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2147 end;
2148
2149 DrawMenuBar(Handle);
2150 end;
2151
2152 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2153 var AllowChange: Boolean);
2154 begin
2155 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2156 // if FTreeType = gtt2ch then
2157 // FSortIndex := -1;
2158 end;
2159
2160 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2161 Shift: TShiftState);
2162 var
2163 pos : TPoint;
2164 begin
2165 if GetActiveList is TBoard then begin
2166 case Key of
2167 VK_BACK:; // UpFolderButtonClick(Sender);
2168 VK_SPACE: ListDoubleClick(Shift);
2169 VK_RETURN: ListClick;
2170 VK_APPS:
2171 begin
2172 if ListView.Selected <> nil then begin
2173 pos.X := ListView.Column[ 0 ].Width;
2174 pos.Y := ListView.Selected.Top;
2175 end else begin
2176 pos.X := ListView.Left;
2177 pos.Y := ListView.Top;
2178 end;
2179 Windows.ClientToScreen( ListView.Handle, pos );
2180 ListPopupMenu.Popup( pos.X, pos.Y );
2181 end;
2182 end;
2183 end else begin // TBBS, TCategory
2184 case Key of
2185 VK_BACK:; // UpFolderButtonClick(Sender);
2186 VK_SPACE: ListClick;
2187 VK_RETURN: ListDoubleClick(Shift);
2188 VK_APPS:
2189 begin
2190 if ListView.Selected <> nil then begin
2191 pos.X := ListView.Column[ 0 ].Width;
2192 pos.Y := ListView.Selected.Top;
2193 end else begin
2194 pos.X := ListView.Left;
2195 pos.Y := ListView.Top;
2196 end;
2197 Windows.ClientToScreen( ListView.Handle, pos );
2198 ListPopupMenu.Popup( pos.X, pos.Y );
2199 end;
2200 end;
2201 end;
2202 end;
2203
2204 function TGikoForm.GetHttpState: Boolean;
2205 begin
2206 Result := FHttpState;
2207 end;
2208
2209 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2210 Column: TListColumn);
2211 var
2212 id, idx : Integer;
2213 orderList : TList;
2214 vSortIndex : Integer;
2215 vSortOrder : Boolean;
2216 begin
2217 idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
2218 if TObject( FActiveList ) is TBBS then begin
2219 orderList := GikoSys.Setting.BBSColumnOrder;
2220 vSortIndex := GikoSys.Setting.BBSSortIndex;
2221 vSortOrder := GikoSys.Setting.BBSSortOrder;
2222 end else if TObject( FActiveList ) is TCategory then begin
2223 orderList := GikoSys.Setting.CategoryColumnOrder;
2224 vSortIndex := GikoSys.Setting.CategorySortIndex;
2225 vSortOrder := GikoSys.Setting.CategorySortOrder;
2226 end else if TObject( FActiveList ) is TBoard then begin
2227 orderList := GikoSys.Setting.BoardColumnOrder;
2228 vSortIndex := GikoSys.Setting.BoardSortIndex;
2229 vSortOrder := GikoSys.Setting.BoardSortOrder;
2230 end else
2231 Exit;
2232
2233 id := Integer( orderList[ idx ] );
2234
2235
2236 if vSortIndex = id then
2237 vSortOrder := not vSortOrder
2238 else begin
2239 vSortOrder := id = 0;
2240 end;
2241
2242 TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, vSortOrder);
2243 end;
2244
2245 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2246 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2247 var
2248 ARect: TRect;
2249 begin
2250 DefaultDraw := True;
2251 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Exit鐃緒申鐃緒申鐃緒申鐃緒申
2252 Exit;
2253 DefaultDraw := False;
2254 if (cdsSelected in State) or (cdsHot in State) then begin
2255 Sender.Canvas.Brush.Color := clHighlight;
2256 Sender.Canvas.Font.Color := clHighlightText;
2257 end else begin
2258 Sender.Canvas.Brush.Color := clBtnFace;
2259 Sender.Canvas.Font.Color := clBtnText;
2260 end;
2261 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2262 Sender.Canvas.FillRect(ARect);
2263 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2264 end;
2265
2266 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2267 var
2268 Nodes: TTreeNodes;
2269 i: integer;
2270 begin
2271 Nodes := TreeView.Items;
2272
2273 for i := 0 to Nodes.Count - 1 do begin
2274 if Nodes.Item[i].Data = Data then begin
2275 Result := Nodes.Item[i];
2276 Exit;
2277 end;
2278 end;
2279 Result := nil;
2280 end;
2281
2282 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2283 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2284 Headers: OleVariant; var Cancel: WordBool);
2285 var
2286 sNo: string;
2287 p: TPoint;
2288 const
2289 kMenuName: string = 'menu:';
2290 begin
2291 {$IFDEF DEBUG}
2292 Writeln(URL);
2293 {$ENDIF}
2294 if Pos(kMenuName, URL) <> 0 then begin
2295 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2296
2297 if not GikoSys.IsNumeric(sNo) then Exit;
2298
2299 Cancel := True;
2300 GetCursorpos(p);
2301 KokoPopupMenu.PopupComponent := nil;
2302 if (Sender is TComponent) then
2303 KokoPopupMenu.PopupComponent := TComponent(Sender);
2304 KokoPopupMenu.Tag := StrToInt(sNo);
2305 KokoPopupMenu.Popup(p.x, p.y);
2306 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2307 Cancel := not GikoSys.Setting.OpenMailer;
2308 end;
2309
2310 end;
2311
2312 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2313 const ARect: TRect; var DefaultDraw: Boolean);
2314 var
2315 NodeRect: TRect;
2316 i, j: Integer;
2317 IsBoardNode: Boolean;
2318 Cnt: Integer;
2319 CntText: string;
2320 TextWidth: Integer;
2321 TextRect: TRect;
2322 Board: TBoard;
2323 Category: TCategory;
2324 Bitmap: TBitmap;
2325 NodeWidth: Integer;
2326 begin
2327 DefaultDraw := True;
2328
2329 if FTreeType = gttHistory then Exit;
2330
2331 TreeView.Canvas.Font.Color := clBlue;
2332 IsBoardNode := False;
2333 for i := 0 to TreeView.Items.Count - 1 do begin
2334 Cnt := 0;
2335 if not TreeView.Items[i].IsVisible then
2336 continue;
2337
2338 if TObject(TreeView.Items[i].Data) is TCategory then begin
2339 if TreeView.Items[i].Expanded then
2340 continue;
2341
2342 IsBoardNode := False;
2343 Category := TCategory(TreeView.Items[i].Data);
2344 for j := 0 to Category.Count - 1 do begin
2345 Board := Category.Items[j];
2346 if Board <> nil then begin
2347 if Board.UnRead > 0 then begin
2348 Cnt := 1;
2349 Break;
2350 end;
2351 end;
2352 end;
2353 if Cnt <> 1 then
2354 continue;
2355 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2356 IsBoardNode := True;
2357 Board := TBoard(TreeView.Items[i].Data);
2358
2359 Cnt := Board.UnRead;
2360 if Cnt <= 0 then
2361 continue;
2362 end else
2363 continue;
2364
2365 Bitmap := TBitmap.Create;
2366 try
2367 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2368 Bitmap.Canvas.Font.Style := [fsBold];
2369 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2370 finally
2371 Bitmap.Free;
2372 end;
2373
2374 NodeRect := TreeView.Items[i].DisplayRect(True);
2375
2376 if IsBoardNode then
2377 CntText := '(' + IntToStr(Cnt) + ')'
2378 else if Cnt = 1 then
2379 CntText := '(+)';
2380
2381
2382 TextWidth := TreeView.Canvas.TextWidth(CntText);
2383
2384 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2385 NodeRect.Top,
2386 NodeRect.Left + NodeWidth + TextWidth + 8,
2387 NodeRect.Bottom);
2388 DrawText(TreeView.Canvas.Handle,
2389 PChar(CntText),
2390 -1,
2391 TextRect,
2392 DT_SINGLELINE or DT_VCENTER);
2393 end;
2394 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2395 end;
2396
2397 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2398 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2399 var
2400 Board: TBoard;
2401 Category: TCategory;
2402 i: Integer;
2403 begin
2404 DefaultDraw := True;
2405
2406 if FTreeType = gttHistory then Exit;
2407
2408 TreeView.Canvas.Font.Style := [];
2409 if Node <> nil then begin
2410 if TObject(Node.Data) is TCategory then begin
2411 Category := TCategory(Node.Data);
2412 for i := 0 to Category.Count - 1 do begin
2413 Board := Category.Items[i];
2414 if Board <> nil then begin
2415 if Board.UnRead > 0 then begin
2416 TreeView.Canvas.Font.Style := [fsBold];
2417 Break;
2418 end;
2419 end;
2420 end;
2421 end else if TObject(Node.Data) is TBoard then begin
2422 Board := TBoard(Node.Data);
2423 if Board.UnRead > 0 then
2424 TreeView.Canvas.Font.Style := [fsBold];
2425 end;
2426 end;
2427 end;
2428
2429 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2430 begin
2431 TreeView.Invalidate;
2432
2433 if TObject(Node.Data) is TBBS then begin
2434 TBBS(Node.Data).NodeExpand := True;
2435 end else if TObject(Node.Data) is TCategory then begin
2436 TCategory(Node.Data).NodeExpand := True;
2437 end else if TObject(Node.Data) is TBoard then begin
2438 TBoard(Node.Data).NodeExpand := True;
2439 end;
2440 end;
2441
2442 procedure TGikoForm.ListViewAllSelect;
2443 begin
2444 ListView.SetFocus;
2445 ListView.SelectAll;
2446 end;
2447 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2448 begin
2449 AddMessageList(Msg, nil, Icon);
2450 end;
2451 // *************************************************************************
2452 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?
2453 // *************************************************************************
2454 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2455 var
2456 ATitle: string;
2457 s: string;
2458 boardPlugIn : TBoardPlugIn;
2459 i: Integer;
2460 Res : TResRec;
2461 begin
2462 try
2463 if Item.DownType = gdtBoard then
2464 ATitle := Item.Board.Title
2465 else
2466 ATitle := Item.ThreadItem.Title;
2467 if ATitle = '' then
2468 ATitle := GikoSys.GetGikoMessage(gmUnKnown);
2469
2470 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2471 //鐃緒申鐃緒申鐃?鐃緒申
2472 if Item.DownType = gdtBoard then begin
2473 //鐃緒申
2474 Item.SaveListFile;
2475 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureItiran), nil, gmiOK);
2476 if GetActiveList = Item.Board then begin
2477 FActiveList := nil;
2478 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申
2479 if (GikoSys.Setting.AutoSortThreadList) then begin
2480 GikoSys.Setting.BoardSortIndex := 0;
2481 GikoSys.Setting.BoardSortOrder := True;
2482 end;
2483 Sort.SetSortDate(Now());
2484 SetActiveList(Item.Board);
2485 end;
2486 Item.Board.Modified := True;
2487 Item.Board.IsThreadDatRead := True;
2488 PlaySound('New');
2489 ListView.Refresh;
2490 end else if Item.DownType = gdtThread then begin
2491 //鐃?鐃緒申
2492 Item.SaveItemFile;
2493 Item.ThreadItem.NewArrival := True;
2494 //if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2495 if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2496 //boardPlugIn := Item.ThreadItem.BoardPlugIn;
2497 boardPlugIn := Item.ThreadItem.ParentBoard.BoardPlugIn;
2498 THTMLCreate.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 ), @Res);
2499 Item.ThreadItem.Title := Res.FTitle;
2500 ATitle := Item.ThreadItem.Title;
2501 end else if ATitle = '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?' then begin
2502 THTMLCreate.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1), @Res);
2503 ATitle := Res.FTitle;
2504 end;
2505 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2506 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin
2507 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2508 break;
2509 end;
2510 end;
2511 if GikoSys.Setting.BrowserTabVisible then begin
2512 if GetActiveContent = Item.ThreadItem then
2513 InsertBrowserTab(Item.ThreadItem)
2514 else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then
2515 InsertBrowserTab(Item.ThreadItem, True)
2516 else
2517 InsertBrowserTab(Item.ThreadItem, False);
2518
2519 end else begin
2520 if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then
2521 InsertBrowserTab(Item.ThreadItem);
2522 end;
2523
2524 Application.ProcessMessages;
2525
2526 if Item.State = gdsComplete then begin
2527 PlaySound('New');
2528 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureSyutoku), nil, gmiOK);
2529 //Add by Genyakun
2530 DiffComp := True;
2531 end else begin
2532 PlaySound('NewDiff');
2533 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureDiff), nil, gmiOK);
2534 //Add by Genyakun
2535 DiffComp := True;
2536 end;
2537
2538 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2539 if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
2540 Item.ThreadItem.Round := False;
2541 //Item.ThreadItem.RoundName := '';
2542 AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
2543 end;
2544 TreeView.Refresh;
2545 //ListView鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
2546 if (ActiveList <> nil) and (ActiveList is TBoard) then begin
2547 TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount;
2548 TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount;
2549 TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount;
2550 //ListView鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?
2551 case GikoForm.ViewType of
2552 gvtAll: ListView.Items.Count := TBoard(ActiveList).Count;
2553 gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount;
2554 gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount;
2555 gvtArch: ListView.Items.Count := TBoard(ActiveList).ArchiveThreadCount;
2556 gvtLive: ListView.Items.Count := TBoard(ActiveList).LiveThreadCount;
2557 gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount;
2558 end;
2559 end;
2560 RefreshListView(Item.ThreadItem);
2561 end;
2562
2563 end else if Item.State = gdsNotModify then begin
2564 //鐃緒申鐃?鐃?鐃?
2565 { if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
2566 //SetContent(Item.ThreadItem);
2567 InsertBrowserTab(Item.ThreadItem);
2568 end;}
2569 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmNotMod), nil, gmiSAD);
2570 PlaySound('NoChange');
2571 Screen.Cursor := crDefault;
2572 end else if Item.State = gdsAbort then begin
2573 //鐃緒申鐃?
2574 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
2575 end else if Item.State = gdsError then begin
2576 //鐃?鐃緒申鐃?
2577 s := Item.ErrText;
2578 if s <> '' then
2579 s := ':' + s;
2580 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmError) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG);
2581 // if Item.ResponseCode = 302 then
2582 // AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG);
2583 PlaySound('Error');
2584 end;
2585 finally
2586 Item.Free;
2587 Dec(FWorkCount);
2588 if FWorkCount < 0 then FWorkCount := 0;
2589 if FWorkCount = 0 then begin
2590 try
2591 Animate.Active := False;
2592 finally
2593 Screen.Cursor := crDefault;
2594 end;
2595 end;
2596
2597 end;
2598 end;
2599
2600 procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
2601 begin
2602 // SetProgressValue(Number, 0, AWorkCountMax);
2603 // ProgressBar.Visible := True;
2604 ProgressBar.Position := 0;
2605 ProgressBar.Max := AWorkCountMax;
2606 FDownloadTitle := AWorkTitle;
2607 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申';
2608 FDownloadMax := AWorkCountMax;
2609 end;
2610
2611 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
2612 begin
2613 ProgressBar.Position := 0;
2614 if FDownloadMax <> 0 then
2615 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
2616 end;
2617
2618 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
2619 begin
2620 ProgressBar.Position := AWorkCount;
2621 // SetProgressValue(Number, AWorkCount);
2622 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
2623 end;
2624
2625 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
2626 var
2627 ListItem: TListItem;
2628 begin
2629 MessageListView.Items.BeginUpdate;
2630 try
2631 ListItem := MessageListView.Items.Add;
2632 ListItem.Caption := ACaption;
2633 ListItem.Data := AObject;
2634 ListItem.MakeVisible(False);
2635 case Icon of
2636 gmiOK: ListItem.ImageIndex := 0;
2637 gmiSAD: ListItem.ImageIndex := 1;
2638 gmiNG: ListItem.ImageIndex := 2;
2639 gmiWhat: ListItem.ImageIndex := 3;
2640 end;
2641 finally
2642 MessageListView.Items.EndUpdate;
2643 end;
2644 end;
2645
2646 //! 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Browser鐃緒申鐃?鐃緒申
2647 procedure TGikoForm.ReleaseOldestBrowser;
2648 var
2649 i: Integer;
2650 begin
2651 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2652 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2653 TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2654 ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
2655 break;
2656 end;
2657 end;
2658 end;
2659
2660 function TGikoForm.InsertBrowserTab(
2661 ThreadItem : TThreadItem;
2662 ActiveTab : Boolean = True
2663 ) : TBrowserRecord;
2664 var
2665 i, j, idx : Integer;
2666 favItem : TFavoriteThreadItem;
2667 newBrowser : TBrowserRecord;
2668 ins : Integer;
2669 begin
2670
2671 Result := nil;
2672 if Threaditem = nil then Exit;
2673
2674 if ThreadItem.IsLogFile then begin
2675 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申browser鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2676 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申Active鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2677 if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
2678 (FActiveContent.Browser <> BrowserNullTab.Browser)then begin
2679 j := FBrowsers.IndexOf(FActiveContent.Browser);
2680 if j = BROWSER_COUNT - 1 then
2681 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2682 end;
2683 favItem := TFavoriteThreadItem.Create(ThreadItem.URL, ThreadItem.Title );
2684 if not FHistoryList.AddHistory( favItem, TreeView, FTreeType ) then
2685 favItem.Free;
2686
2687 for i := 0 to BrowserTab.Tabs.Count - 1 do begin
2688 if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin
2689 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
2690 Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] );
2691 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin
2692 //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2693 ReleaseOldestBrowser;
2694 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2695 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2696 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2697 end;
2698 if ActiveTab then begin
2699 BrowserTab.TabIndex := i;
2700 BrowserTab.OnChange(nil);
2701 BrowserTab.Repaint;
2702 end;
2703 Exit;
2704 end;
2705 end;
2706 end;
2707 idx := BrowserTab.TabIndex;
2708 newBrowser := TBrowserRecord.Create;
2709 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2710 ReleaseOldestBrowser;
2711 newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2712 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2713 newBrowser.thread := ThreadItem;
2714 newBrowser.Repaint := true;
2715
2716 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
2717 BrowserTab.Tabs.InsertObject(0, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2718 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2719 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2720 end;// else begin
2721 //end;
2722 BrowserTab.Repaint;
2723 if ActiveTab then begin
2724 BrowserTab.TabIndex := 0;
2725 end;
2726 end else if GikoSys.Setting.BrowserTabAppend = gtaLast then begin
2727 i := BrowserTab.Tabs.AddObject(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[ 0 ] ) );
2730 end;
2731 //end;
2732 BrowserTab.Repaint;
2733 if ActiveTab then begin
2734 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2735 BrowserTab.TabIndex := 0
2736 else
2737 BrowserTab.TabIndex := i;
2738 end;
2739 end else begin
2740 // 鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2741 ins := -1;
2742 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2743 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2744 TWebBrowser(FBrowsers[1]) then begin
2745 ins := i;
2746 break;
2747 end;
2748 end;
2749 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2750 Inc(ins);
2751 end;
2752 // 鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2753 if (ins < 0) then begin
2754 ins := 0;
2755 end;
2756 BrowserTab.Tabs.InsertObject(ins, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2757 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2758 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2759 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2760 end else begin
2761 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2762 end;
2763 end;
2764 //end;
2765 BrowserTab.Repaint;
2766 if ActiveTab then begin
2767 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2768 BrowserTab.TabIndex := 0
2769 else
2770 BrowserTab.TabIndex := ins;
2771 end;
2772 end;
2773 Result := newBrowser;
2774 if(ActiveTab) or (idx = -1) then begin
2775 BrowserTab.OnChange(nil);
2776 end;
2777 end else begin
2778 if BrowserNullTab = nil then begin
2779 BrowserNullTab := TBrowserRecord.Create;
2780 BrowserNullTab.Browser := Browser;
2781 end;
2782 // if BrowserNullTab.thread <> ThreadItem then begin
2783 // BrowserNullTab.Movement := '';
2784 // end;
2785 BrowserNullTab.thread := ThreadItem;
2786 Result := BrowserNullTab;
2787 BrowserTab.TabIndex := -1;
2788 SetContent(BrowserNullTab);
2789 end;
2790
2791 if GikoSys.Setting.URLDisplay then
2792 AddressComboBox.Text := ThreadItem.URL;
2793
2794 end;
2795
2796 procedure TGikoForm.SetContent(inThread : TBrowserRecord);
2797 var
2798 BBSID: string;
2799 FileName: string;
2800 sTitle: string;
2801 doc: Variant;
2802 s: string;
2803 idx: Integer;
2804 ThreadItem: TThreadItem;
2805 Thread: TBrowserRecord;
2806 ThreadTitle, ThreadPTitle: string;
2807 ThreadIsLog, {ThreadUnRead,} ThreadNewArraical: boolean;
2808 begin
2809 Thread := inThread;
2810 idx := BrowserTab.TabIndex;
2811 if (not FStartUp) and
2812 (FActiveContent <> nil) and
2813 (FActiveContent.Thread <> Thread.Thread) and
2814 (FActiveContent.Browser <> nil) and
2815 (Assigned(FActiveContent.Browser.Document)) then begin
2816 try
2817 try
2818 FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document).Body).ScrollTop;
2819 except
2820 on E: Exception do
2821 MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0);
2822 end;
2823 finally
2824 end;
2825 end;
2826 if not (Assigned(Thread)) or (Thread.Thread = nil) then begin
2827 Thread.Browser.Navigate(BLANK_HTML);
2828 BrowserBoardNameLabel.Caption := '';
2829 ItemBoardImage.Picture := nil;
2830 BrowserNameLabel.Caption := '';
2831 ItemImage.Picture := nil;
2832 BrowserNullTab.Thread := nil;
2833 //TOleControl(BrowserNullTab.Browser).Visible := true;
2834 ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
2835 FActiveContent := nil;
2836 Exit;
2837 end else if Thread.Browser = nil then begin
2838 if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then
2839 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2840 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2841 ReleaseOldestBrowser;
2842 Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2843 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2844 end;
2845
2846 ThreadTitle := Thread.Thread.Title;
2847 ThreadPTitle := Thread.Thread.ParentBoard.Title;
2848 //ThreadScrollTop := Thread.Thread.ScrollTop;
2849 if Thread.Thread.IsLogFile then begin
2850 if not FileExists(Thread.Thread.GetThreadFileName) then begin
2851 Thread.Thread.DeleteLogFile;
2852 end;
2853 end;
2854
2855 ThreadIsLog := Thread.Thread.IsLogFile;
2856 ThreadItem := Thread.Thread;
2857 ThreadNewArraical := Thread.Thread.NewArrival;
2858 //ThreadUnRead := Thread.Thread.UnRead;
2859 BBSID := ThreadItem.ParentBoard.BBSID;
2860 FileName := ThreadItem.FileName;
2861
2862 if GetCapture = ListView.Handle then
2863 ReleaseCapture;
2864
2865 Screen.Cursor := crHourGlass;
2866
2867
2868 try
2869 if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin
2870 if (FActiveContent.Browser <> BrowserNullTab.Browser) then
2871 ShowWindow(FActiveContent.Browser.Handle, SW_HIDE);
2872 end;
2873 ShowWindow(Thread.Browser.Handle, SW_SHOW);
2874 if (not Assigned(Thread.Browser.Document)) then begin
2875 Thread.Browser.Navigate('about:blank');
2876 end;
2877 while (Thread.Browser.ReadyState <> READYSTATE_COMPLETE) and
2878 (Thread.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
2879 Application.ProcessMessages;
2880 if idx <> BrowserTab.TabIndex then begin
2881 Exit;
2882 end;
2883 end;
2884
2885 if (Thread <> nil) and (ThreadItem <>nil) then begin
2886 BrowserBoardNameLabel.Caption := ThreadPTitle;
2887 ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap);
2888 BrowserNameLabel.Caption := ThreadTitle;
2889 ItemImage.Picture := nil;
2890 if ThreadIsLog then
2891 if ThreadNewArraical then
2892 ItemImageList.GetBitmap(2, ItemImage.Picture.Bitmap)
2893 else
2894 ItemImageList.GetBitmap(0, ItemImage.Picture.Bitmap)
2895 else
2896 ItemImageList.GetBitmap(1, ItemImage.Picture.Bitmap);
2897
2898 ItemImage.Left := BrowserBoardNameLabel.Left + BrowserBoardNameLabel.Width + 8;
2899 BrowserNameLabel.Left := ItemImage.Left + 20;
2900
2901 end;
2902 //ActiveContent鐃?鐃緒申鐃?鐃?
2903 FActiveContent := Thread;
2904
2905 if not ThreadIsLog then begin
2906 Self.Caption := GikoDataModule.CAPTION_NAME ;
2907 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
2908 StatusBar.Panels[THREADSIZE_PANEL].Text := '';
2909 try
2910