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.656 - (show annotations) (download) (as text)
Sun Feb 3 15:00:26 2008 UTC (16 years, 2 months ago) by h677
Branch: MAIN
CVS Tags: v1_57_0_738
Changes since 1.655: +10 -5 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 {$IFDEF SPAM_FILTER_ENABLED}
1294 // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1295 GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
1296 {$ENDIF}
1297
1298 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1299 MouseGesture := TMouseGesture.Create;
1300 GikoSys.Setting.Gestures.LoadGesture(
1301 GikoSys.Setting.GetGestureFileName, GikoDM.GikoFormActionList );
1302 MouseGesture.Margin := GikoSys.Setting.Gestures.Margin;
1303 MouseGesture.OnGestureStart := OnGestureStart;
1304 MouseGesture.OnGestureMove := OnGestureMove;
1305 MouseGesture.OnGestureEnd := OnGestureEnd;
1306 if GikoSys.Setting.GestureEnabled then
1307 MouseGesture.SetHook( Handle );
1308
1309 //2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1310 GikoSys.SetGikoMessage;
1311
1312 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1313 if GikoSys.Setting.AutoLogin then
1314 GikoDM.LoginAction.Execute;
1315
1316 GikoSys.Setting.BeLogin := GikoSys.Setting.BeAutoLogin;
1317
1318 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1319 FavoriteAddToolButton.Caption := '鐃緒申鐃緒申...';
1320 AntiIndivAbonMenuItem.Caption := '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申';
1321
1322 //鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1323 InputAssistDM.Init(GikoSys.GetInputAssistFileName);
1324
1325 //鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1326 ReplaceDM.LoadFromFile(GikoSys.GetReplaceFileName);
1327
1328 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?
1329 ResPopupClearTimer.Interval := GikoSys.Setting.RespopupWait;
1330
1331 // D&D鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1332 DragAcceptFiles(ListView.Handle, True);
1333
1334 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?
1335 if (FavoriteDM.AbEnd) then begin
1336 GikoUtil.MsgBox(Self.Handle, '鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?',
1337 '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
1338 Self.Close;
1339 end;
1340
1341 end;
1342
1343 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1344 procedure TGikoForm.SaveCoolBarSettings;
1345 begin
1346
1347 if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then
1348 Exit;
1349 SaveMainCoolBarSettings;
1350 SaveBoardCoolBarSettings;
1351 SaveBrowserCoolBarSettings;
1352
1353 end;
1354 procedure TGikoForm.SaveMainCoolBarSettings;
1355 var
1356 i : Integer;
1357 CoolSet : TCoolSet;
1358 begin
1359 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1360 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1361 CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1362 CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1363 CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1364 GikoSys.Setting.MainCoolSet[i] := CoolSet;
1365 end;
1366 end;
1367 procedure TGikoForm.SaveBoardCoolBarSettings;
1368 var
1369 i : Integer;
1370 CoolSet : TCoolSet;
1371 begin
1372 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1373 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1374 CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1375 CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1376 CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1377 GikoSys.Setting.ListCoolSet[i] := CoolSet;
1378 end;
1379 end;
1380 procedure TGikoForm.SaveBrowserCoolBarSettings;
1381 var
1382 i : Integer;
1383 CoolSet : TCoolSet;
1384 begin
1385 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1386 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1387 CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1388 CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1389 CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1390 GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1391 end;
1392 end;
1393 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1394 procedure TGikoForm.LoadCoolBarSettings;
1395 var
1396 i : Integer;
1397 CoolSet : TCoolSet;
1398 begin
1399
1400 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1401 MainCoolBar.Bands.BeginUpdate;
1402 try
1403 // for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1404 for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin
1405 CoolSet := GikoSys.Setting.MainCoolSet[i];
1406 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1407 FIsIgnoreResize := rtNone;
1408 SaveCoolBarSettings;
1409 Exit;
1410 end;
1411 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1412 MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1413 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1414 end;
1415 finally
1416 MainCoolBar.Bands.EndUpdate;
1417 end;
1418
1419 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1420 ListCoolBar.Bands.BeginUpdate;
1421 try
1422 // for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1423 for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin
1424 CoolSet := GikoSys.Setting.ListCoolSet[i];
1425 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1426 FIsIgnoreResize := rtNone;
1427 SaveCoolBarSettings;
1428 Exit;
1429 end;
1430 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1431 ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1432 ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1433 end;
1434 finally
1435 ListCoolBar.Bands.EndUpdate;
1436 end;
1437
1438 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1439 BrowserCoolBar.Bands.BeginUpdate;
1440 try
1441 // for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1442 for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
1443 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1444 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1445 FIsIgnoreResize := rtNone;
1446 SaveCoolBarSettings;
1447 Exit;
1448 end;
1449 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1450 BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1451 BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1452 end;
1453 finally
1454 BrowserCoolBar.Bands.EndUpdate;
1455 end;
1456
1457 end;
1458 //
1459 procedure TGikoForm.FormShow(Sender: TObject);
1460 var
1461 item : TThreadItem;
1462 begin
1463 if FStartUp then begin
1464 ShowWindow(Application.Handle, SW_HIDE);
1465
1466 //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1467 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1468 GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1469 GikoDM.StdToolBarVisibleActionExecute( nil );
1470 GikoDM.AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1471 GikoDM.AddressBarVisibleActionExecute( nil );
1472 GikoDM.LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1473 GikoDM.LinkBarVisibleActionExecute( nil );
1474 GikoDM.ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1475 GikoDM.ListToolBarVisibleActionExecute( nil );
1476 GikoDM.ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1477 GikoDM.ListNameBarVisibleActionExecute( nil );
1478 GikoDM.BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1479 GikoDM.BrowserToolBarVisibleActionExecute( nil );
1480 GikoDM.BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1481 GikoDM.BrowserNameBarVisibleActionExecute( nil );
1482
1483 // CoolBar 鐃緒申鐃緒申
1484 LoadCoolBarSettings;
1485
1486 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1487 // ResetBandInfo( ListCoolBar, ListToolBar );
1488 FIsIgnoreResize := rtNone;
1489
1490 //FormCrete鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1491 if GikoSys.Setting.TabAutoLoadSave then begin
1492 GikoDM.TabsOpenAction.Tag := 1;
1493 GikoDM.TabsOpenAction.Execute;
1494 GikoDM.TabsOpenAction.Tag := 0;
1495 if (GikoSys.Setting.LastCloseTabURL <> '') then begin
1496 PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 );
1497 if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
1498 while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and
1499 (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
1500 Application.ProcessMessages;
1501 end;
1502 end;
1503 item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL );
1504 if (item <> nil) and (item.IsLogFile) then begin
1505 OpenThreadItem(item, item.URL);
1506 end;
1507 GikoSys.Setting.LastCloseTabURL := '';
1508 end;
1509 end;
1510
1511 //ActionList鐃緒申GroupIndex鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1512 SetGroupIndex(GikoDM.GikoFormActionList);
1513
1514 FStartUp := false;
1515 end;
1516 end;
1517
1518 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1519 begin
1520 // if GikoForm.WindowState <> wsMinimized then
1521 // SaveCoolBarSettings;
1522 CanClose := True;
1523 if ( GikoSys.Setting.ShowDialogForEnd ) and
1524 (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1525 CanClose := false;
1526 Exit;
1527 end;
1528
1529 GikoSys.Setting.LastCloseTabURL := '';
1530 if GikoSys.Setting.TabAutoLoadSave then begin
1531 GikoDM.TabsSaveAction.Execute;
1532 if (GetActiveContent <> nil) and
1533 (GetActiveContent.IsLogFile) then begin
1534 GikoSys.Setting.LastCloseTabURL := GetActiveContent.URL;
1535 end;
1536 end;
1537
1538 if (SearchDialog <> nil) then begin
1539 if (SearchDialog.Visible) then begin
1540 SearchDialog.Close;
1541 end;
1542 try
1543 SearchDialog.Release;
1544 except
1545 end;
1546 SearchDialog := nil;
1547 end;
1548
1549 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?EditorForm鐃緒申鐃緒申鐃緒申鐃緒申
1550 GikoDM.CloseAllEditorAction.Execute;
1551
1552 Application.UnhookMainWindow(Hook);
1553 Application.Terminate;
1554 end;
1555
1556 procedure TGikoForm.FormDestroy(Sender: TObject);
1557 var
1558 i : Integer;
1559 wp : TWindowPlacement;
1560 tmpBool : Boolean;
1561 begin
1562 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1563 try
1564 if GikoSys.Setting.GestureEnabled then begin
1565 MouseGesture.OnGestureStart := nil;
1566 MouseGesture.OnGestureMove := nil;
1567 MouseGesture.OnGestureEnd := nil;
1568 end;
1569 MouseGesture.Clear;
1570 MouseGesture.UnHook;
1571 // MouseGesture.Free; // Free 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1572 // MouseGesture := nil;
1573 except
1574 end;
1575 try
1576 ActiveListColumnSave;
1577 except
1578 end;
1579 try
1580 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1581 wp.length := sizeof(wp);
1582 GetWindowPlacement(Handle, @wp);
1583 GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1584 GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1585 GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1586 GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1587 GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1588
1589 GikoSys.Setting.ListStyle := ListView.ViewStyle;
1590 GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked;
1591 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1592 GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1593 GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1594 if GikoDM.ArrangeAction.Checked then
1595 GikoSys.Setting.ListOrientation := gloVertical
1596 else
1597 GikoSys.Setting.ListOrientation := gloHorizontal;
1598 GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1599 except
1600 end;
1601
1602 try
1603 // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1604 if not GikoSys.Setting.ResRangeHold then
1605 GikoSys.Setting.ResRange := FResRangeMenuSelect;
1606 except
1607 end;
1608 if WindowState <> wsNormal then
1609 WindowState := wsNormal;
1610 SaveCoolBarSettings;
1611 try
1612 GikoSys.Setting.WriteWindowSettingFile;
1613 GikoSys.Setting.WriteNameMailSettingFile;
1614 except
1615 end;
1616 // 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申 CoolBar 鐃緒申鐃緒申
1617 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1618
1619 // 鐃緒申FormDestroy鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?2004/04/09鐃?
1620 // CoolBar 鐃緒申鐃緒申
1621 //if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then
1622
1623 //鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1624 InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName);
1625
1626 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1627 try
1628 //FavoriteDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1629 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1630 if not (FavoriteDM.AbEnd) then begin
1631 FavoriteDM.WriteFavorite;
1632 end;
1633 FavoriteDM.Clear;
1634 except
1635 end;
1636 //LockWindowUpdate(Self.Handle);
1637 try
1638 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1639 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1640 GikoSys.Setting.ShowDialogForAllTabClose := false;
1641 GikoDM.AllTabCloseAction.Execute;
1642 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1643 except
1644 end;
1645 try
1646 for i := FBrowsers.Count - 1 downto 0 do begin
1647 TWebBrowser(FBrowsers[i]).Free;
1648 end;
1649 FBrowsers.Clear;
1650 FBrowsers.Capacity := 0;
1651 finally
1652 FBrowsers.Free;
1653 end;
1654 try
1655 if BrowserNullTab <> nil then begin
1656 BrowserNullTab.Browser := nil; {*BrowserNullTab鐃緒申Browser鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
1657 *鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Free鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1658 *}
1659 BrowserNullTab.Free;
1660 end;
1661 except
1662 end;
1663
1664 try
1665 TreeView.Items.BeginUpdate;
1666 TreeView.Items.GetFirstNode.Free;
1667 TreeView.Items.Clear;
1668 TreeView.Items.EndUpdate;
1669 except
1670 end;
1671
1672 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1673 try
1674 //AddressHistoryDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1675 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
1676 except
1677 end;
1678
1679 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1680 try
1681 FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
1682 except
1683 end;
1684 try
1685 try
1686 FHistoryList.Clear;
1687 except
1688 end;
1689 finally
1690 FHistoryList.Free;
1691 end;
1692
1693 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1694 try
1695 RoundList.SaveRoundFile;
1696 except
1697 end;
1698 try
1699 try
1700 RoundList.Clear;
1701 except
1702 end;
1703 finally
1704 RoundList.Free;
1705 end;
1706
1707 try
1708 try
1709 FControlThread.Terminate;
1710 FControlThread.WaitFor;
1711 except
1712 end;
1713 finally
1714 FControlThread.Free;
1715 end;
1716 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1717 for i := GikoForm.PlugInMenu.Count - 1 downto 0 do begin
1718 GikoForm.PlugInMenu.items[i].Free;
1719 end;
1720 GikoForm.PlugInMenu.Clear;
1721
1722
1723 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1724 // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1725 // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1726 for i := Length(BoardGroups) - 1 downto 0 do begin
1727 //BoardGroups[i].Clear;
1728 BoardGroups[i].Free;
1729 end;
1730
1731 try
1732 for i := Length( BBSs ) - 1 downto 0 do begin
1733 if BBSs[ i ] <> nil then
1734 BBSs[ i ].Free;
1735 BBSs[ i ] := nil;
1736 end;
1737 except
1738 end;
1739
1740 try
1741 if FEvent <> nil then
1742 FEvent.Free;
1743
1744 try
1745 if FResPopupBrowser <> nil then begin
1746 TOleControl(FResPopupBrowser).Parent := nil;
1747 FResPopupBrowser.Free;
1748 end;
1749
1750 except
1751 end;
1752 //Preview鐃?鐃緒申
1753 if FPreviewBrowser <> nil then begin
1754 FPreviewBrowser.Free;
1755 FPreviewBrowser := nil;
1756 end;
1757 except
1758 end;
1759 //LockWindowUpdate(0);
1760 end;
1761
1762 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1763 procedure TGikoForm.SetBBSMenu;
1764 var
1765 i : Integer;
1766 item : TBBSMenuItem;
1767 begin
1768
1769 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1770 for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1771 try
1772 if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1773 CabinetSelectPopupMenu.Items[ i ].Free;
1774 CabinetMenu.Items[ i ].Free;
1775 BBSSelectPopupMenu.Items[ i ].Free;
1776 end;
1777 except
1778 end;
1779 end;
1780
1781 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1782 for i := Length( BBSs ) - 1 downto 0 do begin
1783 try
1784 item := TBBSMenuItem.Create( PopupMenu );
1785 item.Caption := BBSs[ i ].Title;
1786 item.Data := BBSs[ i ];
1787 item.OnClick := BBSMenuItemOnClick;
1788 CabinetSelectPopupMenu.Items.Insert( 0, item );
1789 item := TBBSMenuItem.Create( PopupMenu );
1790 item.Caption := BBSs[ i ].Title;
1791 item.Data := BBSs[ i ];
1792 item.OnClick := BBSMenuItemOnClick;
1793 CabinetMenu.Insert( 0, item );
1794 item := TBBSMenuItem.Create( PopupMenu );
1795 item.Caption := BBSs[ i ].Title;
1796 item.Data := BBSs[ i ];
1797 item.OnClick := BBSMenuItemOnClick;
1798 BBSSelectPopupMenu.Items.Insert( 0, Item );
1799 except
1800 end;
1801 end;
1802
1803 end;
1804
1805 procedure TGikoForm.ReloadBBS;
1806 var
1807 i : Integer;
1808 tmpBool: Boolean;
1809 begin
1810 LockWindowUpdate(Self.Handle);
1811
1812 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1813 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1814 GikoSys.Setting.ShowDialogForAllTabClose := false;
1815 GikoDM.AllTabCloseAction.Execute;
1816 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1817 SetContent(BrowserNullTab);
1818 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1819 TreeView.Items.Clear;
1820
1821 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1822 try
1823 RoundList.SaveRoundFile;
1824 except
1825 end;
1826 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1827 try
1828 RoundList.Clear;
1829 except
1830 end;
1831
1832 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1833 try
1834 FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
1835 FHistoryList.Clear;
1836 except
1837 end;
1838
1839 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1840 try
1841 FavoriteDM.WriteFavorite;
1842 FavoriteDM.Clear;
1843 except
1844 end;
1845
1846 //鐃緒申鐃?鐃?鐃緒申鐃?PLUGIN鐃緒申鐃?鐃緒申
1847 for i := Length(BoardGroups) - 1 downto 0 do begin
1848 try
1849 BoardGroups[i].Free;
1850 except
1851 end;
1852 end;
1853 //BBS鐃?鐃緒申
1854 try
1855 for i := Length( BBSs ) - 1 downto 0 do begin
1856 if BBSs[ i ] <> nil then
1857 BBSs[ i ].Free;
1858 BBSs[ i ] := nil;
1859 end;
1860 except
1861 end;
1862
1863 ActiveList := nil;
1864
1865 FTreeType := gttNone;
1866
1867 //============鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申================================//
1868
1869 // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1870 InitializeBoardPlugIns;
1871
1872 GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1873
1874 // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1875 for i := Length(BBSs) - 1 downto 0 do begin
1876 if not BBSs[i].IsBoardFileRead then
1877 GikoSys.ReadBoardFile(BBSs[i]);
1878 end;
1879
1880 // BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1881 SetBBSMenu;
1882
1883 ShowBBSTree( BBSs[ 0 ] );
1884
1885 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1886 FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml',
1887 TreeView, FTreeType);
1888
1889 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1890 FavoriteDM.ReadFavorite;
1891
1892 SetLinkBar;
1893
1894 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1895 RoundList.LoadRoundBoardFile;
1896 RoundList.LoadRoundThreadFile;
1897
1898 LockWindowUpdate(0);
1899 end;
1900
1901 {!
1902 \todo 鐃緒申鐃緒申 IE 7 鐃緒申鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1903 (IE 7 鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申)
1904 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1905 }
1906 procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
1907 var
1908 p: TPoint;
1909 s: string;
1910 tmp2: string;
1911 URL: string;
1912 ATitle: Boolean;
1913
1914 threadItem : TThreadItem;
1915 board : TBoard;
1916 Protocol, Host, Path, Document, Port, Bookmark: string;
1917
1918 wkInt: Integer;
1919 wkIntSt: Integer;
1920 wkIntTo: Integer;
1921 ActiveFileName: string;
1922 e: IHTMLElement;
1923 Ext: string;
1924 PathRec: TPathRec;
1925 Text2: string;
1926 cResPopup: TResPopupBrowser;
1927 begin
1928 // 鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申 about:blank.. 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1929 // IE 7 鐃緒申鐃緒申 about:blank.. 鐃緒申鐃緒申鐃緒申鐃緒申 about:.. 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申鐃緒申鐃緒申)
1930 if Pos('about:..', Text) = 1 then
1931 Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) )
1932 else
1933 Text2 := Text;
1934 if not( TObject(Sender) is TWebBrowser )then
1935 Exit;
1936 try
1937 try
1938 if (TWebBrowser(Sender) <> nil) and (not TWebBrowser(Sender).Busy) and (Assigned(TWebBrowser(Sender).Document)) then begin
1939 if LowerCase(OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset) <> 'shift_jis' then begin
1940 OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset := 'shift_jis';
1941 end;
1942 end;
1943 except
1944 end;
1945 finally
1946 end;
1947 if PreviewTimer.Enabled then
1948 PreviewTimer.Enabled := False;
1949 Application.CancelHint;
1950 try
1951 if GetActiveContent <> nil then
1952 ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
1953 else
1954 ActiveFileName := '';
1955 except
1956 FActiveContent := nil;
1957 Exit;
1958 end;
1959 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1960 if (StatusBar.Panels[1].Text = Text2) then begin
1961 if Text2 = '' then begin
1962 if FResPopupBrowser <> nil then begin
1963 if not(Sender is TResPopupBrowser) then
1964 FResPopupBrowser.Clear
1965 else begin
1966 TResPopupBrowser(Sender).ChildClear;
1967 end;
1968 end;
1969 end;
1970 Exit;
1971 end;
1972 StatusBar.Panels[1].Text := Text2;
1973
1974
1975 if FPreviewBrowser <> nil then
1976 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
1977
1978 if FResPopupBrowser <> nil then begin
1979 if not(Sender is TResPopupBrowser) then begin
1980 if (FResPopupBrowser.Visible) then begin
1981 if ResPopupClearTimer.Interval > 0 then begin
1982 ResPopupClearTimer.Enabled := True;
1983 ResPopupClearTimer.Tag := 0;
1984 end else begin
1985 FResPopupBrowser.Clear;
1986 end;
1987 end;
1988 end else begin
1989 if ResPopupClearTimer.Interval > 0 then begin
1990 ResPopupClearTimer.Enabled := True;
1991 ResPopupClearTimer.Tag := 1;
1992 end else begin
1993 TResPopupBrowser(Sender).ChildClear;
1994 end;
1995 end;
1996 end;
1997 cResPopup := nil;
1998
1999 if not(Sender is TResPopupBrowser) then
2000 if not GikoSys.Setting.UnActivePopup then
2001 if not GikoForm.Active then
2002 Exit;
2003
2004
2005
2006 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2007 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2008
2009 s := '';
2010 Ext := AnsiLowerCase(ExtractFileExt(Text2));
2011 if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
2012 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2013 if FPreviewBrowser = nil then begin
2014 FPreviewBrowser := TPreviewBrowser.Create(Self);
2015 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2016 TOleControl(FPreviewBrowser).Parent := nil;
2017 end;
2018 FPreviewBrowser.Navigate(BLANK_HTML);//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2019 FPreviewURL := Text2;
2020 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2021 PreviewTimer.Enabled := True;
2022 end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin
2023 if (Pos('mailto:', Text2) = 1) and (GikoSys.Setting.RespopupMailTo) then begin
2024 s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]);
2025 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2026 GetCursorPos(p);
2027 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2028 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2029 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2030 if (Assigned(e)) then begin
2031 CreateResPopupBrowser;
2032
2033 if not(Sender is TResPopupBrowser) then begin
2034 if (FResPopupBrowser.Visible) then begin
2035 FResPopupBrowser.Clear;
2036 end;
2037 end else begin
2038 TResPopupBrowser(Sender).ChildClear;
2039 end;
2040
2041 cResPopup := FResPopupBrowser.CreateNewBrowser;
2042 tmp2 := ZenToHan(e.Get_outerText);
2043 if (GikoSys.IsNumeric(tmp2)) then begin
2044 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2045 wkIntSt := StrToInt64(tmp2);
2046 wkIntTo := StrToInt64(tmp2);
2047 cResPopup.PopupType := gptThread;
2048 HTMLCreater.SetResPopupText(cResPopup, GetActiveContent(true), wkIntSt, wkIntTo, False, False);
2049 end else begin
2050 cResPopup.PopupType := gptRaw;
2051 cResPopup.Title := s;
2052 end;
2053 end;
2054 end else begin
2055 CreateResPopupBrowser;
2056
2057 if not(Sender is TResPopupBrowser) then begin
2058 if (FResPopupBrowser.Visible) then begin
2059 FResPopupBrowser.Clear;
2060 end;
2061 end else begin
2062 TResPopupBrowser(Sender).ChildClear;
2063 end;
2064
2065 threadItem := GetActiveContent(true);
2066 URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL);
2067 PathRec := Gikosys.Parse2chURL2(URL);
2068 if (PathRec.FNoParam) then begin
2069 PathRec.FSt := 1;
2070 PathRec.FTo := 1;
2071 end else begin
2072 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2073 end;
2074 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2075
2076 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
2077
2078 URL := GikoSys.GetBrowsableThreadURL( URL );
2079 wkIntSt := PathRec.FSt;
2080 wkIntTo := PathRec.FTo;
2081
2082 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2083 wkIntSt := 1;
2084 wkIntTo := 1;
2085 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2086 wkIntSt := wkIntTo;
2087 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2088 wkIntTo := wkIntSt;
2089 end else if wkIntSt > wkIntTo then begin
2090 wkInt := wkIntTo;
2091 wkIntTo := wkIntSt;
2092 wkIntSt := wkInt;
2093 end;
2094 if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
2095 ATitle := false
2096 else
2097 ATitle := true;
2098
2099 threadItem := BBSsFindThreadFromURL( URL );
2100
2101 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2102 board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2103 if board <> nil then begin
2104 if not board.IsThreadDatRead then
2105 GikoSys.ReadSubjectFile( board );
2106 threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
2107 end;
2108 end;
2109
2110 if threadItem <> nil then begin
2111 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2112 //URL鐃緒申鐃緒申鐃緒申鐃緒申/鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2113 if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin
2114 wkIntSt := 1;
2115 wkIntTo := 1;
2116 end;
2117 cResPopup := FResPopupBrowser.CreateNewBrowser;
2118 cResPopup.PopupType := gptThread;
2119 HTMLCreater.SetResPopupText(cResPopup, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2120 end;
2121 end;
2122 end;
2123 if (cResPopup <> nil) then begin
2124 ResPopupClearTimer.Enabled := False;
2125
2126 if cResPopup.PopupType = gptRaw then begin
2127 if cResPopup.Title <> '' then begin
2128 cResPopup.TitlePopup;
2129 end;
2130 end else begin
2131 if cResPopup.RawDocument <> '' then begin
2132 cResPopup.Popup;
2133 end else if cResPopup.Title <> '' then begin
2134 cResPopup.TitlePopup;
2135 end;
2136 end;
2137 end;
2138 end;
2139 end;
2140
2141 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2142 var
2143 SysMenu: HMenu;
2144 begin
2145 FEnabledCloseButton := Enabled;
2146 SysMenu := GetSystemMenu(Handle, False);
2147
2148 if Enabled then begin
2149 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2150 end else begin
2151 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2152 end;
2153
2154 DrawMenuBar(Handle);
2155 end;
2156
2157 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2158 var AllowChange: Boolean);
2159 begin
2160 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2161 // if FTreeType = gtt2ch then
2162 // FSortIndex := -1;
2163 end;
2164
2165 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2166 Shift: TShiftState);
2167 var
2168 pos : TPoint;
2169 begin
2170 if GetActiveList is TBoard then begin
2171 case Key of
2172 VK_BACK:; // UpFolderButtonClick(Sender);
2173 VK_SPACE: ListDoubleClick(Shift);
2174 VK_RETURN: ListClick;
2175 VK_APPS:
2176 begin
2177 if ListView.Selected <> nil then begin
2178 pos.X := ListView.Column[ 0 ].Width;
2179 pos.Y := ListView.Selected.Top;
2180 end else begin
2181 pos.X := ListView.Left;
2182 pos.Y := ListView.Top;
2183 end;
2184 Windows.ClientToScreen( ListView.Handle, pos );
2185 ListPopupMenu.Popup( pos.X, pos.Y );
2186 end;
2187 end;
2188 end else begin // TBBS, TCategory
2189 case Key of
2190 VK_BACK:; // UpFolderButtonClick(Sender);
2191 VK_SPACE: ListClick;
2192 VK_RETURN: ListDoubleClick(Shift);
2193 VK_APPS:
2194 begin
2195 if ListView.Selected <> nil then begin
2196 pos.X := ListView.Column[ 0 ].Width;
2197 pos.Y := ListView.Selected.Top;
2198 end else begin
2199 pos.X := ListView.Left;
2200 pos.Y := ListView.Top;
2201 end;
2202 Windows.ClientToScreen( ListView.Handle, pos );
2203 ListPopupMenu.Popup( pos.X, pos.Y );
2204 end;
2205 end;
2206 end;
2207 end;
2208
2209 function TGikoForm.GetHttpState: Boolean;
2210 begin
2211 Result := FHttpState;
2212 end;
2213
2214 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2215 Column: TListColumn);
2216 var
2217 id, idx : Integer;
2218 orderList : TList;
2219 vSortIndex : Integer;
2220 vSortOrder : Boolean;
2221 begin
2222 idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
2223 if TObject( FActiveList ) is TBBS then begin
2224 orderList := GikoSys.Setting.BBSColumnOrder;
2225 vSortIndex := GikoSys.Setting.BBSSortIndex;
2226 vSortOrder := GikoSys.Setting.BBSSortOrder;
2227 end else if TObject( FActiveList ) is TCategory then begin
2228 orderList := GikoSys.Setting.CategoryColumnOrder;
2229 vSortIndex := GikoSys.Setting.CategorySortIndex;
2230 vSortOrder := GikoSys.Setting.CategorySortOrder;
2231 end else if TObject( FActiveList ) is TBoard then begin
2232 orderList := GikoSys.Setting.BoardColumnOrder;
2233 vSortIndex := GikoSys.Setting.BoardSortIndex;
2234 vSortOrder := GikoSys.Setting.BoardSortOrder;
2235 end else
2236 Exit;
2237
2238 id := Integer( orderList[ idx ] );
2239
2240
2241 if vSortIndex = id then
2242 vSortOrder := not vSortOrder
2243 else begin
2244 vSortOrder := id = 0;
2245 end;
2246
2247 TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, vSortOrder);
2248 end;
2249
2250 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2251 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2252 var
2253 ARect: TRect;
2254 begin
2255 DefaultDraw := True;
2256 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Exit鐃緒申鐃緒申鐃緒申鐃緒申
2257 Exit;
2258 DefaultDraw := False;
2259 if (cdsSelected in State) or (cdsHot in State) then begin
2260 Sender.Canvas.Brush.Color := clHighlight;
2261 Sender.Canvas.Font.Color := clHighlightText;
2262 end else begin
2263 Sender.Canvas.Brush.Color := clBtnFace;
2264 Sender.Canvas.Font.Color := clBtnText;
2265 end;
2266 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2267 Sender.Canvas.FillRect(ARect);
2268 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2269 end;
2270
2271 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2272 var
2273 Nodes: TTreeNodes;
2274 i: integer;
2275 begin
2276 Nodes := TreeView.Items;
2277
2278 for i := 0 to Nodes.Count - 1 do begin
2279 if Nodes.Item[i].Data = Data then begin
2280 Result := Nodes.Item[i];
2281 Exit;
2282 end;
2283 end;
2284 Result := nil;
2285 end;
2286
2287 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2288 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2289 Headers: OleVariant; var Cancel: WordBool);
2290 var
2291 sNo: string;
2292 p: TPoint;
2293 const
2294 kMenuName: string = 'menu:';
2295 begin
2296 {$IFDEF DEBUG}
2297 Writeln(URL);
2298 {$ENDIF}
2299 if Pos(kMenuName, URL) <> 0 then begin
2300 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2301
2302 if not GikoSys.IsNumeric(sNo) then Exit;
2303
2304 Cancel := True;
2305 GetCursorpos(p);
2306 KokoPopupMenu.PopupComponent := nil;
2307 if (Sender is TComponent) then
2308 KokoPopupMenu.PopupComponent := TComponent(Sender);
2309 KokoPopupMenu.Tag := StrToInt(sNo);
2310 KokoPopupMenu.Popup(p.x, p.y);
2311 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2312 Cancel := not GikoSys.Setting.OpenMailer;
2313 end;
2314
2315 end;
2316
2317 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2318 const ARect: TRect; var DefaultDraw: Boolean);
2319 var
2320 NodeRect: TRect;
2321 i, j: Integer;
2322 IsBoardNode: Boolean;
2323 Cnt: Integer;
2324 CntText: string;
2325 TextWidth: Integer;
2326 TextRect: TRect;
2327 Board: TBoard;
2328 Category: TCategory;
2329 Bitmap: TBitmap;
2330 NodeWidth: Integer;
2331 begin
2332 DefaultDraw := True;
2333
2334 if FTreeType = gttHistory then Exit;
2335
2336 TreeView.Canvas.Font.Color := clBlue;
2337 IsBoardNode := False;
2338 for i := 0 to TreeView.Items.Count - 1 do begin
2339 Cnt := 0;
2340 if not TreeView.Items[i].IsVisible then
2341 continue;
2342
2343 if TObject(TreeView.Items[i].Data) is TCategory then begin
2344 if TreeView.Items[i].Expanded then
2345 continue;
2346
2347 IsBoardNode := False;
2348 Category := TCategory(TreeView.Items[i].Data);
2349 for j := 0 to Category.Count - 1 do begin
2350 Board := Category.Items[j];
2351 if Board <> nil then begin
2352 if Board.UnRead > 0 then begin
2353 Cnt := 1;
2354 Break;
2355 end;
2356 end;
2357 end;
2358 if Cnt <> 1 then
2359 continue;
2360 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2361 IsBoardNode := True;
2362 Board := TBoard(TreeView.Items[i].Data);
2363
2364 Cnt := Board.UnRead;
2365 if Cnt <= 0 then
2366 continue;
2367 end else
2368 continue;
2369
2370 Bitmap := TBitmap.Create;
2371 try
2372 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2373 Bitmap.Canvas.Font.Style := [fsBold];
2374 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2375 finally
2376 Bitmap.Free;
2377 end;
2378
2379 NodeRect := TreeView.Items[i].DisplayRect(True);
2380
2381 if IsBoardNode then
2382 CntText := '(' + IntToStr(Cnt) + ')'
2383 else if Cnt = 1 then
2384 CntText := '(+)';
2385
2386
2387 TextWidth := TreeView.Canvas.TextWidth(CntText);
2388
2389 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2390 NodeRect.Top,
2391 NodeRect.Left + NodeWidth + TextWidth + 8,
2392 NodeRect.Bottom);
2393 DrawText(TreeView.Canvas.Handle,
2394 PChar(CntText),
2395 -1,
2396 TextRect,
2397 DT_SINGLELINE or DT_VCENTER);
2398 end;
2399 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2400 end;
2401
2402 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2403 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2404 var
2405 Board: TBoard;
2406 Category: TCategory;
2407 i: Integer;
2408 begin
2409 DefaultDraw := True;
2410
2411 if FTreeType = gttHistory then Exit;
2412
2413 TreeView.Canvas.Font.Style := [];
2414 if Node <> nil then begin
2415 if TObject(Node.Data) is TCategory then begin
2416 Category := TCategory(Node.Data);
2417 for i := 0 to Category.Count - 1 do begin
2418 Board := Category.Items[i];
2419 if Board <> nil then begin
2420 if Board.UnRead > 0 then begin
2421 TreeView.Canvas.Font.Style := [fsBold];
2422 Break;
2423 end;
2424 end;
2425 end;
2426 end else if TObject(Node.Data) is TBoard then begin
2427 Board := TBoard(Node.Data);
2428 if Board.UnRead > 0 then
2429 TreeView.Canvas.Font.Style := [fsBold];
2430 end;
2431 end;
2432 end;
2433
2434 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2435 begin
2436 TreeView.Invalidate;
2437
2438 if TObject(Node.Data) is TBBS then begin
2439 TBBS(Node.Data).NodeExpand := True;
2440 end else if TObject(Node.Data) is TCategory then begin
2441 TCategory(Node.Data).NodeExpand := True;
2442 end else if TObject(Node.Data) is TBoard then begin
2443 TBoard(Node.Data).NodeExpand := True;
2444 end;
2445 end;
2446
2447 procedure TGikoForm.ListViewAllSelect;
2448 begin
2449 ListView.SetFocus;
2450 ListView.SelectAll;
2451 end;
2452 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2453 begin
2454 AddMessageList(Msg, nil, Icon);
2455 end;
2456 // *************************************************************************
2457 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?
2458 // *************************************************************************
2459 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2460 var
2461 ATitle: string;
2462 s: string;
2463 boardPlugIn : TBoardPlugIn;
2464 i: Integer;
2465 Res : TResRec;
2466 begin
2467 try
2468 if Item.DownType = gdtBoard then
2469 ATitle := Item.Board.Title
2470 else
2471 ATitle := Item.ThreadItem.Title;
2472 if ATitle = '' then
2473 ATitle := GikoSys.GetGikoMessage(gmUnKnown);
2474
2475 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2476 //鐃緒申鐃緒申鐃?鐃緒申
2477 if Item.DownType = gdtBoard then begin
2478 //鐃緒申
2479 Item.SaveListFile;
2480 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureItiran), nil, gmiOK);
2481 if GetActiveList = Item.Board then begin
2482 FActiveList := nil;
2483 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申
2484 if (GikoSys.Setting.AutoSortThreadList) then begin
2485 GikoSys.Setting.BoardSortIndex := 0;
2486 GikoSys.Setting.BoardSortOrder := True;
2487 end;
2488 Sort.SetSortDate(Now());
2489 SetActiveList(Item.Board);
2490 end;
2491 Item.Board.Modified := True;
2492 Item.Board.IsThreadDatRead := True;
2493 PlaySound('New');
2494 ListView.Refresh;
2495 end else if Item.DownType = gdtThread then begin
2496 //鐃?鐃緒申
2497 Item.SaveItemFile;
2498 Item.ThreadItem.NewArrival := True;
2499 //if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2500 if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2501 //boardPlugIn := Item.ThreadItem.BoardPlugIn;
2502 boardPlugIn := Item.ThreadItem.ParentBoard.BoardPlugIn;
2503 THTMLCreate.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 ), @Res);
2504 Item.ThreadItem.Title := Res.FTitle;
2505 ATitle := Item.ThreadItem.Title;
2506 end else if ATitle = '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?' then begin
2507 THTMLCreate.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1), @Res);
2508 ATitle := Res.FTitle;
2509 end;
2510 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2511 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin
2512 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2513 break;
2514 end;
2515 end;
2516 if GikoSys.Setting.BrowserTabVisible then begin
2517 if GetActiveContent = Item.ThreadItem then
2518 InsertBrowserTab(Item.ThreadItem)
2519 else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then
2520 InsertBrowserTab(Item.ThreadItem, True)
2521 else
2522 InsertBrowserTab(Item.ThreadItem, False);
2523
2524 end else begin
2525 if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then
2526 InsertBrowserTab(Item.ThreadItem);
2527 end;
2528
2529 Application.ProcessMessages;
2530
2531 if Item.State = gdsComplete then begin
2532 PlaySound('New');
2533 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureSyutoku), nil, gmiOK);
2534 //Add by Genyakun
2535 DiffComp := True;
2536 end else begin
2537 PlaySound('NewDiff');
2538 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureDiff), nil, gmiOK);
2539 //Add by Genyakun
2540 DiffComp := True;
2541 end;
2542
2543 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2544 if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
2545 Item.ThreadItem.Round := False;
2546 //Item.ThreadItem.RoundName := '';
2547 AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
2548 end;
2549 TreeView.Refresh;
2550 //ListView鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
2551 if (ActiveList <> nil) and (ActiveList is TBoard) then begin
2552 TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount;
2553 TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount;
2554 TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount;
2555 //ListView鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?
2556 case GikoForm.ViewType of
2557 gvtAll: ListView.Items.Count := TBoard(ActiveList).Count;
2558 gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount;
2559 gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount;
2560 gvtArch: ListView.Items.Count := TBoard(ActiveList).ArchiveThreadCount;
2561 gvtLive: ListView.Items.Count := TBoard(ActiveList).LiveThreadCount;
2562 gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount;
2563 end;
2564 end;
2565 RefreshListView(Item.ThreadItem);
2566 end;
2567
2568 end else if Item.State = gdsNotModify then begin
2569 //鐃緒申鐃?鐃?鐃?
2570 { if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
2571 //SetContent(Item.ThreadItem);
2572 InsertBrowserTab(Item.ThreadItem);
2573 end;}
2574 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmNotMod), nil, gmiSAD);
2575 PlaySound('NoChange');
2576 Screen.Cursor := crDefault;
2577 end else if Item.State = gdsAbort then begin
2578 //鐃緒申鐃?
2579 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
2580 end else if Item.State = gdsError then begin
2581 //鐃?鐃緒申鐃?
2582 s := Item.ErrText;
2583 if s <> '' then
2584 s := ':' + s;
2585 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmError) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG);
2586 // if Item.ResponseCode = 302 then
2587 // AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG);
2588 PlaySound('Error');
2589 end;
2590 finally
2591 Item.Free;
2592 Dec(FWorkCount);
2593 if FWorkCount < 0 then FWorkCount := 0;
2594 if FWorkCount = 0 then begin
2595 try
2596 Animate.Active := False;
2597 finally
2598 Screen.Cursor := crDefault;
2599 end;
2600 end;
2601
2602 end;
2603 end;
2604
2605 procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
2606 begin
2607 // SetProgressValue(Number, 0, AWorkCountMax);
2608 // ProgressBar.Visible := True;
2609 ProgressBar.Position := 0;
2610 ProgressBar.Max := AWorkCountMax;
2611 FDownloadTitle := AWorkTitle;
2612 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申';
2613 FDownloadMax := AWorkCountMax;
2614 end;
2615
2616 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
2617 begin
2618 ProgressBar.Position := 0;
2619 if FDownloadMax <> 0 then
2620 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
2621 end;
2622
2623 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
2624 begin
2625 ProgressBar.Position := AWorkCount;
2626 // SetProgressValue(Number, AWorkCount);
2627 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
2628 end;
2629
2630 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
2631 var
2632 ListItem: TListItem;
2633 begin
2634 MessageListView.Items.BeginUpdate;
2635 try
2636 ListItem := MessageListView.Items.Add;
2637 ListItem.Caption := ACaption;
2638 ListItem.Data := AObject;
2639 ListItem.MakeVisible(False);
2640 case Icon of
2641 gmiOK: ListItem.ImageIndex := 0;
2642 gmiSAD: ListItem.ImageIndex := 1;
2643 gmiNG: ListItem.ImageIndex := 2;
2644 gmiWhat: ListItem.ImageIndex := 3;
2645 end;
2646 finally
2647 MessageListView.Items.EndUpdate;
2648 end;
2649 end;
2650
2651 //! 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Browser鐃緒申鐃?鐃緒申
2652 procedure TGikoForm.ReleaseOldestBrowser;
2653 var
2654 i: Integer;
2655 begin
2656 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2657 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2658 TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2659 ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
2660 break;
2661 end;
2662 end;
2663 end;
2664
2665 function TGikoForm.InsertBrowserTab(
2666 ThreadItem : TThreadItem;
2667 ActiveTab : Boolean = True
2668 ) : TBrowserRecord;
2669 var
2670 i, j, idx : Integer;
2671 favItem : TFavoriteThreadItem;
2672 newBrowser : TBrowserRecord;
2673 ins : Integer;
2674 begin
2675
2676 Result := nil;
2677 if Threaditem = nil then Exit;
2678
2679 if ThreadItem.IsLogFile then begin
2680 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申browser鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2681 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申Active鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2682 if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
2683 (FActiveContent.Browser <> BrowserNullTab.Browser)then begin
2684 j := FBrowsers.IndexOf(FActiveContent.Browser);
2685 if j = BROWSER_COUNT - 1 then
2686 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2687 end;
2688 favItem := TFavoriteThreadItem.Create(ThreadItem.URL, ThreadItem.Title );
2689 if not FHistoryList.AddHistory( favItem, TreeView, FTreeType ) then
2690 favItem.Free;
2691
2692 for i := 0 to BrowserTab.Tabs.Count - 1 do begin
2693 if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin
2694 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
2695 Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] );
2696 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin
2697 //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2698 ReleaseOldestBrowser;
2699 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2700 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2701 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2702 end;
2703 if ActiveTab then begin
2704 BrowserTab.TabIndex := i;
2705 BrowserTab.OnChange(nil);
2706 BrowserTab.Repaint;
2707 end;
2708 Exit;
2709 end;
2710 end;
2711 end;
2712 idx := BrowserTab.TabIndex;
2713 newBrowser := TBrowserRecord.Create;
2714 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2715 ReleaseOldestBrowser;
2716 newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2717 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2718 newBrowser.thread := ThreadItem;
2719 newBrowser.Repaint := true;
2720
2721 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
2722 BrowserTab.Tabs.InsertObject(0, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2723 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2724 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2725 end;// else begin
2726 //end;
2727 BrowserTab.Repaint;
2728 if ActiveTab then begin
2729 BrowserTab.TabIndex := 0;
2730 end;
2731 end else if GikoSys.Setting.BrowserTabAppend = gtaLast then begin
2732 i := BrowserTab.Tabs.AddObject(GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2733 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2734 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2735 end;
2736 //end;
2737 BrowserTab.Repaint;
2738 if ActiveTab then begin
2739 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2740 BrowserTab.TabIndex := 0
2741 else
2742 BrowserTab.TabIndex := i;
2743 end;
2744 end else begin
2745 // 鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2746 ins := -1;
2747 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2748 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2749 TWebBrowser(FBrowsers[1]) then begin
2750 ins := i;
2751 break;
2752 end;
2753 end;
2754 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2755 Inc(ins);
2756 end;
2757 // 鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2758 if (ins < 0) then begin
2759 ins := 0;
2760 end;
2761 BrowserTab.Tabs.InsertObject(ins, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2762 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2763 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2764 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2765 end else begin
2766 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2767 end;
2768 end;
2769 //end;
2770 BrowserTab.Repaint;
2771 if ActiveTab then begin
2772 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2773 BrowserTab.TabIndex := 0
2774 else
2775 BrowserTab.TabIndex := ins;
2776 end;
2777 end;
2778 Result := newBrowser;
2779 if(ActiveTab) or (idx = -1) then begin
2780 BrowserTab.OnChange(nil);
2781 end;
2782 end else begin
2783 if BrowserNullTab = nil then begin
2784 BrowserNullTab := TBrowserRecord.Create;
2785 BrowserNullTab.Browser := Browser;
2786 end;
2787 // if BrowserNullTab.thread <> ThreadItem then begin
2788 // BrowserNullTab.Movement := '';
2789 // end;
2790 BrowserNullTab.thread := ThreadItem;
2791 Result := BrowserNullTab;
2792 BrowserTab.TabIndex := -1;
2793 SetContent(BrowserNullTab);
2794 end;
2795
2796 if GikoSys.Setting.URLDisplay then
2797 AddressComboBox.Text := ThreadItem.URL;
2798
2799 end;
2800
2801 procedure TGikoForm.SetContent(inThread : TBrowserRecord);
2802 var
2803 BBSID: string;
2804 FileName: string;
2805 sTitle: string;
2806 doc: Variant;
2807 s: string;
2808 idx: Integer;
2809 ThreadItem: TThreadItem;
2810 Thread: TBrowserRecord;
2811 ThreadTitle, ThreadPTitle: string;
2812 ThreadIsLog, {ThreadUnRead,} ThreadNewArraical: boolean;
2813 begin
2814 Thread := inThread;
2815 idx := BrowserTab.TabIndex;
2816 if (not FStartUp) and
2817 (FActiveContent <> nil) and
2818 (FActiveContent.Thread <> Thread.Thread) and
2819 (FActiveContent.Browser <> nil) and
2820 (Assigned(FActiveContent.Browser.Document)) then begin
2821 try
2822 try
2823 FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document).Body).ScrollTop;
2824 except
2825 on E: Exception do
2826 MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0);
2827 end;
2828 finally
2829 end;
2830 end;
2831 if not (Assigned(Thread)) or (Thread.Thread = nil) then begin
2832 Thread.Browser.Navigate(BLANK_HTML);
2833 BrowserBoardNameLabel.Caption := '';
2834 ItemBoardImage.Picture := nil;
2835 BrowserNameLabel.Caption := '';
2836 ItemImage.Picture := nil;
2837 BrowserNullTab.Thread := nil;
2838 //TOleControl(BrowserNullTab.Browser).Visible := true;
2839 ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
2840 FActiveContent := nil;
2841 Exit;
2842 end else if Thread.Browser = nil then begin
2843 if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then
2844 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2845 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2846 ReleaseOldestBrowser;
2847 Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2848 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2849 end;
2850
2851 ThreadTitle := Thread.Thread.Title;
2852 ThreadPTitle := Thread.Thread.ParentBoard.Title;
2853 //ThreadScrollTop := Thread.Thread.ScrollTop;
2854 if Thread.Thread.IsLogFile then begin
2855 if not FileExists(Thread.Thread.GetThreadFileName) then begin
2856 Thread.Thread.DeleteLogFile;
2857 end;
2858 end;
2859
2860 ThreadIsLog := Thread.Thread.IsLogFile;
2861 ThreadItem := Thread.Thread;
2862 ThreadNewArraical := Thread.Thread.NewArrival;
2863 //ThreadUnRead := Thread.Thread.UnRead;
2864 BBSID := ThreadItem.ParentBoard.BBSID;
2865 FileName := ThreadItem.FileName;
2866
2867 if GetCapture = ListView.Handle then
2868 ReleaseCapture;
2869
2870 Screen.Cursor := crHourGlass;
2871
2872
2873 try
2874 if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin
2875 if (FActiveContent.Browser <> BrowserNullTab.Browser) then
2876 ShowWindow(FActiveContent.Browser.Handle, SW_HIDE);
2877 end;
2878 ShowWindow(Thread.Browser.Handle, SW_SHOW);
2879 if (not Assigned(Thread.Browser.Document)) then begin
2880 Thread.Browser.Navigate('about:blank');
2881 end;
2882 while (Thread.Browser.ReadyState <> READYSTATE_COMPLETE) and
2883 (Thread.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
2884 Application.ProcessMessages;
2885 if idx <> BrowserTab.TabIndex then begin
2886 Exit;
2887 end;
2888 end;
2889
2890 if (Thread <> nil) and (ThreadItem <>nil) then begin
2891 BrowserBoardNameLabel.Caption := ThreadPTitle;
2892 ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap);
2893 BrowserNameLabel.Caption := ThreadTitle;
2894 ItemImage.Picture := nil;
2895 if ThreadIsLog then
2896 if ThreadNewArraical then
2897 ItemImageList.GetBitmap(2, ItemImage.Picture.Bitmap)
2898 else
2899 ItemImageList.GetBitmap(0, ItemImage.Picture.Bitmap)
2900 else
2901 ItemImageList.GetBitmap(1, ItemImage.Picture.Bitmap);
2902
2903 ItemImage.Left := BrowserBoardNameLabel.Left + BrowserBoardNameLabel.Width + 8;
2904 BrowserNameLabel.Left := ItemImage.Left + 20;
2905
2906 end;
2907 //ActiveContent鐃?鐃緒申鐃?鐃?
2908 FActiveContent := Thread;
2909
2910 if not ThreadIsLog then begin
2911 Self.Caption := GikoDataModule.CAPTION_NAME ;
2912 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
2913 StatusBar.Panels[THREADSIZE_PANEL].Text :=