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.659 - (show annotations) (download) (as text)
Thu Feb 14 16:20:15 2008 UTC (16 years, 2 months ago) by h677
Branch: MAIN
Changes since 1.658: +24 -22 lines
File MIME type: text/x-pascal
マウスジェスチャーの見直し
スレッドダウンロードの各イベントの最初に、フォーム破棄の最中は
なにもせずに脱出する記述追加

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