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