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.666 - (show annotations) (download) (as text)
Sun Apr 13 05:25:14 2008 UTC (16 years ago) by eggcake
Branch: MAIN
Changes since 1.665: +6 -0 lines
File MIME type: text/x-pascal
mailto:以降に@と.がないときはメーラーを起動しないように修正

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