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