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.661.2.1 - (show annotations) (download) (as text)
Sun Mar 16 14:06:49 2008 UTC (16 years, 1 month ago) by h677
Branch: Bb57
CVS Tags: v1_57_2_749
Changes since 1.661: +1 -1 lines
File MIME type: text/x-pascal
bata58側に入れた、名前欄の数字がポップアップしない不具合の修正反映

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