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.664 - (show annotations) (download) (as text)
Thu Mar 13 16:42:23 2008 UTC (16 years, 1 month ago) by h677
Branch: MAIN
CVS Tags: v1_58_0_748, v1_58_0_750, v1_58_0_751
Changes since 1.663: +1 -1 lines
File MIME type: text/x-pascal
名前欄の数字がレスポップアップされない不具合の修正

1 unit Giko;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils,
8 {$IF Defined(DELPRO) }
9 SHDocVw,
10 MSHTML,
11 {$ELSE}
12 SHDocVw_TLB,
13 MSHTML_TLB,
14 {$IFEND}
15 IdHTTP, ActiveX, ActnList, ImgList,
16 ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils,
17 CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload,
18 Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent,
19 {HintWindow,} GikoCoolBar, GikoListView, Search, ExternalBoardManager,
20 ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,
21 IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem,
22 ShellAPI,Preview, HistoryList, ResPopupBrowser, ExtPreviewDatamodule;
23
24 const
25 NGWORDNAME_PANEL = 3;
26 THREADSIZE_PANEL = 2;
27 USER_RESPOPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser
28
29 type
30
31 TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
32 TMinimizeType = (mtNone, mtMinimizing, mtMinimized);
33 TResizeType = (rtNone, rtResizing);
34
35 // TBrowserRecord = class;
36
37 TGikoForm = class(TForm)
38 StatusBar: TStatusBar;
39 MainPanel: TPanel;
40 ClientPanel: TPanel;
41 TreeSplitter: TSplitter;
42 CabinetPanel: TPanel;
43 TreeView: TTreeView;
44 ThreadMainPanel: TPanel;
45 ListSplitter: TSplitter;
46 ViewPanel: TPanel;
47 ListView: TGikoListView;
48 ThreadPanel: TPanel;
49 MessagePanel: TPanel;
50 MessageBar: TPanel;
51 MessageHideButton: TSpeedButton;
52 MessageListView: TListView;
53 MessageSplitter: TSplitter;
54 Panel3: TPanel;
55 CabinetCloseSpeedButton: TSpeedButton;
56 ToolBar1: TToolBar;
57 CabinetSelectToolButton: TToolButton;
58 HistoryToolBar: TToolBar;
59 HistoryShowToolButton: TToolButton;
60 HistoryAllClearToolButton: TToolButton;
61 ItemIcon16: TImageList;
62 ItemIcon32: TImageList;
63 HotToobarImageList: TImageList;
64 ItemImageList: TImageList;
65 MainMenu: TMainMenu;
66 FileMenu: TMenuItem;
67 DeleteMenu: TMenuItem;
68 ExitMenu: TMenuItem;
69 KidokuMenu: TMenuItem;
70 MidokuMenu: TMenuItem;
71 AllSelectMenu: TMenuItem;
72 ViewMenu: TMenuItem;
73 StdToolBarMenu: TMenuItem;
74 CabinetMenu: TMenuItem;
75 H1: TMenuItem;
76 N4: TMenuItem;
77 CabinetVisibleMenu: TMenuItem;
78 MessageMenu: TMenuItem;
79 StatusBarMenu: TMenuItem;
80 MMSep03: TMenuItem;
81 LargeIconMenu: TMenuItem;
82 SmallIconMenu: TMenuItem;
83 ListMenu: TMenuItem;
84 DetailMenu: TMenuItem;
85 ToolMenu: TMenuItem;
86 Find1: TMenuItem;
87 RoundMenu: TMenuItem;
88 MMSep04: TMenuItem;
89 OptionMenu: TMenuItem;
90 HelpMenu: TMenuItem;
91 G1: TMenuItem;
92 N1: TMenuItem;
93 AboutMenu: TMenuItem;
94 BrowserPopupMenu: TPopupMenu;
95 ShowThreadMenu: TMenuItem;
96 ShowBoardMenu: TMenuItem;
97 ListIconPopupMenu: TPopupMenu;
98 LargeIconPMenu: TMenuItem;
99 SmallIconPMenu: TMenuItem;
100 ListPMenu: TMenuItem;
101 DetailPMenu: TMenuItem;
102 ClosePopupMenu: TPopupMenu;
103 CloseMenu: TMenuItem;
104 U1: TMenuItem;
105 N3: TMenuItem;
106 B1: TMenuItem;
107 S1: TMenuItem;
108 N2: TMenuItem;
109 A1: TMenuItem;
110 L1: TMenuItem;
111 N5: TMenuItem;
112 S2: TMenuItem;
113 ListPopupMenu: TPopupMenu;
114 ListRoundPMenu: TMenuItem;
115 ListReservPMenu: TMenuItem;
116 LPMSep01: TMenuItem;
117 ItemRoundPMenu: TMenuItem;
118 LPMSep02: TMenuItem;
119 KidokuPMenu: TMenuItem;
120 MidokuPMenu: TMenuItem;
121 AllSelectPMenu: TMenuItem;
122 UrlCopyPMenu: TMenuItem;
123 LPMSep05: TMenuItem;
124 DeletePMenu: TMenuItem;
125 LPMSep06: TMenuItem;
126 ViewPMenu: TMenuItem;
127 LargeIconLPMenu: TMenuItem;
128 SmallIconLPMenu: TMenuItem;
129 ListLPMenu: TMenuItem;
130 DetailLPMenu: TMenuItem;
131 T1: TMenuItem;
132 B2: TMenuItem;
133 N8: TMenuItem;
134 URLC1: TMenuItem;
135 N9: TMenuItem;
136 N10: TMenuItem;
137 G2: TMenuItem;
138 N11: TMenuItem;
139 T3: TMenuItem;
140 L2: TMenuItem;
141 N12: TMenuItem;
142 K1: TMenuItem;
143 N13: TMenuItem;
144 N14: TMenuItem;
145 R1: TMenuItem;
146 A2: TMenuItem;
147 N15: TMenuItem;
148 KokoPopupMenu: TPopupMenu;
149 KokomadePMenu: TMenuItem;
150 AllPMenu: TMenuItem;
151 MenuItem1: TMenuItem;
152 MenuItem2: TMenuItem;
153 BrowserTabPopupMenu: TPopupMenu;
154 Close1: TMenuItem;
155 A3: TMenuItem;
156 N16: TMenuItem;
157 A4: TMenuItem;
158 TreePopupMenu: TPopupMenu;
159 TreeSelectThreadPupupMenu: TMenuItem;
160 TreeSelectBoardPupupMenu: TMenuItem;
161 TPMSep01: TMenuItem;
162 TreeSelectURLPupupMenu: TMenuItem;
163 T2: TMenuItem;
164 L3: TMenuItem;
165 B3: TMenuItem;
166 BrowserBottomPanel: TGikoPanel;
167 CabinetSelectPopupMenu: TPopupMenu;
168 H2: TMenuItem;
169 ItemReservPMenu: TMenuItem;
170 RoundNamePopupMenu: TPopupMenu;
171 N7: TMenuItem;
172 B4: TMenuItem;
173 L4: TMenuItem;
174 K2: TMenuItem;
175 A5: TMenuItem;
176 A6: TMenuItem;
177 C1: TMenuItem;
178 V1: TMenuItem;
179 N19: TMenuItem;
180 D1: TMenuItem;
181 D2: TMenuItem;
182 MessageImageList: TImageList;
183 ProgressBar: TProgressBar;
184 URL1: TMenuItem;
185 NameUrlCopyPMenu: TMenuItem;
186 URLC2: TMenuItem;
187 URLN1: TMenuItem;
188 N21: TMenuItem;
189 URLC3: TMenuItem;
190 URLN2: TMenuItem;
191 N23: TMenuItem;
192 ListCoolBar: TGikoCoolBar;
193 ListToolBar: TToolBar;
194 BrowserCoolBar: TGikoCoolBar;
195 BrowserToolBar: TToolBar;
196 ListNameToolBar: TToolBar;
197 ListNameLabel: TLabel;
198 FolderImage: TImage;
199 BrowserNameToolBar: TToolBar;
200 ItemBoardImage: TImage;
201 BrowserBoardNameLabel: TLabel;
202 ItemImage: TImage;
203 BrowserNameLabel: TLabel;
204 D3: TMenuItem;
205 N25: TMenuItem;
206 N26: TMenuItem;
207 D4: TMenuItem;
208 S3: TMenuItem;
209 R2: TMenuItem;
210 TreeSelectNameURLPupupMenu: TMenuItem;
211 N27: TMenuItem;
212 H3: TMenuItem;
213 I1: TMenuItem;
214 BrowserTabToolBar: TToolBar;
215 BrowserTab: TTabControl;
216 About1: TMenuItem;
217 N28: TMenuItem;
218 S4: TMenuItem;
219 N29: TMenuItem;
220 N30: TMenuItem;
221 N31: TMenuItem;
222 L5: TMenuItem;
223 L6: TMenuItem;
224 A7: TMenuItem;
225 R3: TMenuItem;
226 FavoriteMenu: TMenuItem;
227 N32: TMenuItem;
228 BoardFavoriteAddMenu: TMenuItem;
229 ThreadFavoriteAddMenu: TMenuItem;
230 N33: TMenuItem;
231 TreeSelectFavoriteAddPupupMenu: TMenuItem;
232 FavoriteTreeView: TTreeView;
233 StateIconImageList: TImageList;
234 TopPanel: TPanel;
235 TopRightPanel: TPanel;
236 AnimePanel: TPanel;
237 Animate: TAnimate;
238 TopCoolPanel: TPanel;
239 MainCoolBar: TGikoCoolBar;
240 MenuToolBar: TToolBar;
241 StdToolBar: TToolBar;
242 AddressToolBar: TToolBar;
243 AddressComboBox: TComboBox;
244 MoveToToolButton: TToolButton;
245 AddressImageList: TImageList;
246 AddressToolBarMenu: TMenuItem;
247 T4: TMenuItem;
248 Show1: TMenuItem;
249 N34: TMenuItem;
250 T5: TMenuItem;
251 B5: TMenuItem;
252 N35: TMenuItem;
253 A8: TMenuItem;
254 U2: TMenuItem;
255 F1: TMenuItem;
256 PreviewTimer: TTimer;
257 MonazillaWebPageAction1: TMenuItem;
258 N36: TMenuItem;
259 H4: TMenuItem;
260 K3: TMenuItem;
261 L7: TMenuItem;
262 N37: TMenuItem;
263 A9: TMenuItem;
264 ChevronPopupMenu: TPopupMenu;
265 N2N1: TMenuItem;
266 N38: TMenuItem;
267 F2: TMenuItem;
268 LinkToolBar: TToolBar;
269 a10: TMenuItem;
270 N39: TMenuItem;
271 T6: TMenuItem;
272 N40: TMenuItem;
273 LinkBarPopupMenu: TPopupMenu;
274 T7: TMenuItem;
275 ThreadPopupMenu: TPopupMenu;
276 MenuItem4: TMenuItem;
277 MenuItem5: TMenuItem;
278 MenuItem6: TMenuItem;
279 T8: TMenuItem;
280 URLN3: TMenuItem;
281 SelectItemNameCopyAction1: TMenuItem;
282 B6: TMenuItem;
283 T9: TMenuItem;
284 NameCopyPMenu: TMenuItem;
285 SelectComboBox: TComboBox;
286 MainCoolBarPopupMenu: TPopupMenu;
287 StdToolBarVisiblePMenu: TMenuItem;
288 AddressToolBarVisiblePMenu: TMenuItem;
289 LinkToolBarVisiblePMenu: TMenuItem;
290 NG1: TMenuItem;
291 NG2: TMenuItem;
292 N43: TMenuItem;
293 N44: TMenuItem;
294 L9: TMenuItem;
295 I3: TMenuItem;
296 N45: TMenuItem;
297 B9: TMenuItem;
298 R5: TMenuItem;
299 T12: TMenuItem;
300 Show3: TMenuItem;
301 N46: TMenuItem;
302 T13: TMenuItem;
303 B10: TMenuItem;
304 N47: TMenuItem;
305 A12: TMenuItem;
306 U4: TMenuItem;
307 F4: TMenuItem;
308 N48: TMenuItem;
309 T14: TMenuItem;
310 N50: TMenuItem;
311 A11: TMenuItem;
312 S5: TMenuItem;
313 Reload: TMenuItem;
314 GoBack: TMenuItem;
315 GoFoward: TMenuItem;
316 IndividualAbon1: TMenuItem;
317 N41: TMenuItem;
318 IndividualAbon2: TMenuItem;
319 AntiIndivAbonMenuItem: TMenuItem;
320 AntiIndividualAbon: TMenuItem;
321 N49: TMenuItem;
322 N51: TMenuItem;
323 N52: TMenuItem;
324 SearchBoardName: TMenuItem;
325 TreeSelectLogDeleteSeparator: TMenuItem;
326 N54: TMenuItem;
327 A13: TMenuItem;
328 FavoriteTreePopupMenu: TPopupMenu;
329 FavoriteTreeRenamePopupMenu: TMenuItem;
330 FavoriteTreeNewFolderPopupMenu: TMenuItem;
331 N56: TMenuItem;
332 FavoriteTreeDeletePopupMenu: TMenuItem;
333 FavoriteToolBar: TToolBar;
334 FavoriteAddToolButton: TToolButton;
335 FavoriteArrangeToolButton: TToolButton;
336 FavoriteTreeBrowseFolderPopupMenu: TMenuItem;
337 N57: TMenuItem;
338 FavoriteTreeReloadPopupMenu: TMenuItem;
339 N58: TMenuItem;
340 FavoriteTreeURLCopyPopupMenu: TMenuItem;
341 FavoriteTreeNameCopyPopupMenu: TMenuItem;
342 FavoriteTreeLogDeletePopupMenu: TMenuItem;
343 N59: TMenuItem;
344 FavoriteTreeNameURLCopyPopupMenu: TMenuItem;
345 N60: TMenuItem;
346 ExportFavoriteFileAction1: TMenuItem;
347 N6: TMenuItem;
348 N17: TMenuItem;
349 N18: TMenuItem;
350 N20: TMenuItem;
351 N24: TMenuItem;
352 N62: TMenuItem;
353 N61: TMenuItem;
354 N63: TMenuItem;
355 N64: TMenuItem;
356 dummy1: TMenuItem;
357 TreeSelectLogDeletePopupMenu: TMenuItem;
358 N65: TMenuItem;
359 BBSSelectPopupMenu: TPopupMenu;
360 PlugInMenu: TMenuItem;
361 TreeSelectNamePupupMenu: TMenuItem;
362 BrowserPanel: TPanel;
363 SelectTimer: TTimer;
364 SelectThreadSave: TMenuItem;
365 N55: TMenuItem;
366 N66: TMenuItem;
367 dat1: TMenuItem;
368 OpenLogFolder: TMenuItem;
369 Browser: TWebBrowser;
370 TabSave: TMenuItem;
371 TabOpen: TMenuItem;
372 ResRangePopupMenu: TPopupMenu;
373 ResRangeHundPMenuItem: TMenuItem;
374 ResRangeKokoPMenuItem: TMenuItem;
375 ResRangeNewPMenuItem: TMenuItem;
376 ResRangeAllPMenuItem: TMenuItem;
377 BrowsBoradHeadAction1: TMenuItem;
378 ThreadRangePopupMenu: TPopupMenu;
379 A15: TMenuItem;
380 L8: TMenuItem;
381 N67: TMenuItem;
382 N68: TMenuItem;
383 S6: TMenuItem;
384 N69: TMenuItem;
385 ResRangeSelectPMenuItem: TMenuItem;
386 ListColumnPopupMenu: TPopupMenu;
387 N70: TMenuItem;
388 ID1: TMenuItem;
389 ID2: TMenuItem;
390 N53: TMenuItem;
391 ID3: TMenuItem;
392 N71: TMenuItem;
393 N72: TMenuItem;
394 N73: TMenuItem;
395 SelectComboBoxPanel: TPanel;
396 SelectComboBoxSplitter: TImage;
397 N74: TMenuItem;
398 WikiFAQ: TMenuItem;
399 GikoApplicationEvents: TApplicationEvents;
400 N22: TMenuItem;
401 N42: TMenuItem;
402 DAT2: TMenuItem;
403 N75: TMenuItem;
404 DAT3: TMenuItem;
405 N76: TMenuItem;
406 FavoriteTreeItemNameCopyPopupMenu: TMenuItem;
407 N77: TMenuItem;
408 N78: TMenuItem;
409 SaveThreadFile: TMenuItem;
410 N79: TMenuItem;
411 HTML1: TMenuItem;
412 DAT4: TMenuItem;
413 N80: TMenuItem;
414 SameBoardThreadItem: TMenuItem;
415 N81: TMenuItem;
416 N82: TMenuItem;
417 IDNG1: TMenuItem;
418 IDNG2: TMenuItem;
419 ResPopupClearTimer: TTimer;
420 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 // 鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申URL鐃緒申鐃?鐃?
1996 if (ExtPreviewDM.PreviewURL(Text2)) then begin
1997 Exit;
1998 end;
1999 s := '';
2000 Ext := AnsiLowerCase(ExtractFileExt(Text2));
2001 if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
2002 ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2003 if FPreviewBrowser = nil then begin
2004 FPreviewBrowser := TPreviewBrowser.Create(Self);
2005 ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2006 TOleControl(FPreviewBrowser).Parent := nil;
2007 end;
2008 FPreviewBrowser.Navigate(BLANK_HTML);//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2009 FPreviewURL := Text2;
2010 PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2011 PreviewTimer.Enabled := True;
2012 end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin
2013 if (Pos('mailto:', Text2) = 1) and (GikoSys.Setting.RespopupMailTo) then begin
2014 s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]);
2015 //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2016 GetCursorPos(p);
2017 p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2018 p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2019 e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2020 if (Assigned(e)) then begin
2021 CreateResPopupBrowser;
2022
2023 if not(Sender is TResPopupBrowser) then begin
2024 if (FResPopupBrowser.Visible) then begin
2025 FResPopupBrowser.Clear;
2026 end;
2027 end else begin
2028 TResPopupBrowser(Sender).ChildClear;
2029 end;
2030
2031 cResPopup := FResPopupBrowser.CreateNewBrowser;
2032 tmp2 := Trim(ZenToHan(e.Get_outerText));
2033 if (GikoSys.IsNumeric(tmp2)) then begin
2034 //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2035 wkIntSt := StrToInt64(tmp2);
2036 wkIntTo := StrToInt64(tmp2);
2037 cResPopup.PopupType := gptThread;
2038 HTMLCreater.SetResPopupText(cResPopup, GetActiveContent(true), wkIntSt, wkIntTo, False, False);
2039 end else begin
2040 cResPopup.PopupType := gptRaw;
2041 cResPopup.Title := s;
2042 end;
2043 end;
2044 end else begin
2045 CreateResPopupBrowser;
2046
2047 if not(Sender is TResPopupBrowser) then begin
2048 if (FResPopupBrowser.Visible) then begin
2049 FResPopupBrowser.Clear;
2050 end;
2051 end else begin
2052 TResPopupBrowser(Sender).ChildClear;
2053 end;
2054
2055 threadItem := GetActiveContent(true);
2056 URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL);
2057 PathRec := Gikosys.Parse2chURL2(URL);
2058 if (PathRec.FNoParam) then begin
2059 PathRec.FSt := 1;
2060 PathRec.FTo := 1;
2061 end else begin
2062 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
2063 end;
2064 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
2065
2066 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
2067
2068 URL := GikoSys.GetBrowsableThreadURL( URL );
2069 wkIntSt := PathRec.FSt;
2070 wkIntTo := PathRec.FTo;
2071
2072 if (wkIntSt = 0) and (wkIntTo = 0) then begin
2073 wkIntSt := 1;
2074 wkIntTo := 1;
2075 end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2076 wkIntSt := wkIntTo;
2077 end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2078 wkIntTo := wkIntSt;
2079 end else if wkIntSt > wkIntTo then begin
2080 wkInt := wkIntTo;
2081 wkIntTo := wkIntSt;
2082 wkIntSt := wkInt;
2083 end;
2084 if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
2085 ATitle := false
2086 else
2087 ATitle := true;
2088
2089 threadItem := BBSsFindThreadFromURL( URL );
2090
2091 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
2092 board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
2093 if board <> nil then begin
2094 if not board.IsThreadDatRead then
2095 GikoSys.ReadSubjectFile( board );
2096 threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
2097 end;
2098 end;
2099
2100 if threadItem <> nil then begin
2101 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2102 //URL鐃緒申鐃緒申鐃緒申鐃緒申/鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2103 if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin
2104 wkIntSt := 1;
2105 wkIntTo := 1;
2106 end;
2107 cResPopup := FResPopupBrowser.CreateNewBrowser;
2108 cResPopup.PopupType := gptThread;
2109 HTMLCreater.SetResPopupText(cResPopup, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
2110 end;
2111 end;
2112 end;
2113 if (cResPopup <> nil) then begin
2114 ResPopupClearTimer.Enabled := False;
2115
2116 if cResPopup.PopupType = gptRaw then begin
2117 if cResPopup.Title <> '' then begin
2118 cResPopup.TitlePopup;
2119 end;
2120 end else begin
2121 if cResPopup.RawDocument <> '' then begin
2122 cResPopup.Popup;
2123 end else if cResPopup.Title <> '' then begin
2124 cResPopup.TitlePopup;
2125 end;
2126 end;
2127 end;
2128 end;
2129 end;
2130
2131 procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2132 var
2133 SysMenu: HMenu;
2134 begin
2135 FEnabledCloseButton := Enabled;
2136 SysMenu := GetSystemMenu(Handle, False);
2137
2138 if Enabled then begin
2139 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2140 end else begin
2141 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2142 end;
2143
2144 DrawMenuBar(Handle);
2145 end;
2146
2147 procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2148 var AllowChange: Boolean);
2149 begin
2150 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2151 // if FTreeType = gtt2ch then
2152 // FSortIndex := -1;
2153 end;
2154
2155 procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2156 Shift: TShiftState);
2157 var
2158 pos : TPoint;
2159 begin
2160 if GetActiveList is TBoard then begin
2161 case Key of
2162 VK_BACK:; // UpFolderButtonClick(Sender);
2163 VK_SPACE: ListDoubleClick(Shift);
2164 VK_RETURN: ListClick;
2165 VK_APPS:
2166 begin
2167 if ListView.Selected <> nil then begin
2168 pos.X := ListView.Column[ 0 ].Width;
2169 pos.Y := ListView.Selected.Top;
2170 end else begin
2171 pos.X := ListView.Left;
2172 pos.Y := ListView.Top;
2173 end;
2174 Windows.ClientToScreen( ListView.Handle, pos );
2175 ListPopupMenu.Popup( pos.X, pos.Y );
2176 end;
2177 end;
2178 end else begin // TBBS, TCategory
2179 case Key of
2180 VK_BACK:; // UpFolderButtonClick(Sender);
2181 VK_SPACE: ListClick;
2182 VK_RETURN: ListDoubleClick(Shift);
2183 VK_APPS:
2184 begin
2185 if ListView.Selected <> nil then begin
2186 pos.X := ListView.Column[ 0 ].Width;
2187 pos.Y := ListView.Selected.Top;
2188 end else begin
2189 pos.X := ListView.Left;
2190 pos.Y := ListView.Top;
2191 end;
2192 Windows.ClientToScreen( ListView.Handle, pos );
2193 ListPopupMenu.Popup( pos.X, pos.Y );
2194 end;
2195 end;
2196 end;
2197 end;
2198
2199 function TGikoForm.GetHttpState: Boolean;
2200 begin
2201 Result := FHttpState;
2202 end;
2203
2204 procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2205 Column: TListColumn);
2206 var
2207 id, idx : Integer;
2208 orderList : TList;
2209 vSortIndex : Integer;
2210 vSortOrder : Boolean;
2211 begin
2212 idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
2213 if TObject( FActiveList ) is TBBS then begin
2214 orderList := GikoSys.Setting.BBSColumnOrder;
2215 vSortIndex := GikoSys.Setting.BBSSortIndex;
2216 vSortOrder := GikoSys.Setting.BBSSortOrder;
2217 end else if TObject( FActiveList ) is TCategory then begin
2218 orderList := GikoSys.Setting.CategoryColumnOrder;
2219 vSortIndex := GikoSys.Setting.CategorySortIndex;
2220 vSortOrder := GikoSys.Setting.CategorySortOrder;
2221 end else if TObject( FActiveList ) is TBoard then begin
2222 orderList := GikoSys.Setting.BoardColumnOrder;
2223 vSortIndex := GikoSys.Setting.BoardSortIndex;
2224 vSortOrder := GikoSys.Setting.BoardSortOrder;
2225 end else
2226 Exit;
2227
2228 id := Integer( orderList[ idx ] );
2229
2230
2231 if vSortIndex = id then
2232 vSortOrder := not vSortOrder
2233 else begin
2234 vSortOrder := id = 0;
2235 end;
2236
2237 TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, vSortOrder);
2238 end;
2239
2240 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2241 Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2242 var
2243 ARect: TRect;
2244 begin
2245 DefaultDraw := True;
2246 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Exit鐃緒申鐃緒申鐃緒申鐃緒申
2247 Exit;
2248 DefaultDraw := False;
2249 if (cdsSelected in State) or (cdsHot in State) then begin
2250 Sender.Canvas.Brush.Color := clHighlight;
2251 Sender.Canvas.Font.Color := clHighlightText;
2252 end else begin
2253 Sender.Canvas.Brush.Color := clBtnFace;
2254 Sender.Canvas.Font.Color := clBtnText;
2255 end;
2256 ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2257 Sender.Canvas.FillRect(ARect);
2258 DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2259 end;
2260
2261 function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2262 var
2263 Nodes: TTreeNodes;
2264 i: integer;
2265 begin
2266 Nodes := TreeView.Items;
2267
2268 for i := 0 to Nodes.Count - 1 do begin
2269 if Nodes.Item[i].Data = Data then begin
2270 Result := Nodes.Item[i];
2271 Exit;
2272 end;
2273 end;
2274 Result := nil;
2275 end;
2276
2277 procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2278 const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2279 Headers: OleVariant; var Cancel: WordBool);
2280 var
2281 sNo: string;
2282 p: TPoint;
2283 const
2284 kMenuName: string = 'menu:';
2285 begin
2286 {$IFDEF DEBUG}
2287 Writeln(URL);
2288 {$ENDIF}
2289 if Pos(kMenuName, URL) <> 0 then begin
2290 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2291
2292 if not GikoSys.IsNumeric(sNo) then Exit;
2293
2294 Cancel := True;
2295 GetCursorpos(p);
2296 KokoPopupMenu.PopupComponent := nil;
2297 if (Sender is TComponent) then
2298 KokoPopupMenu.PopupComponent := TComponent(Sender);
2299 KokoPopupMenu.Tag := StrToInt(sNo);
2300 KokoPopupMenu.Popup(p.x, p.y);
2301 end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2302 Cancel := not GikoSys.Setting.OpenMailer;
2303 end;
2304
2305 end;
2306
2307 procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2308 const ARect: TRect; var DefaultDraw: Boolean);
2309 var
2310 NodeRect: TRect;
2311 i, j: Integer;
2312 IsBoardNode: Boolean;
2313 Cnt: Integer;
2314 CntText: string;
2315 TextWidth: Integer;
2316 TextRect: TRect;
2317 Board: TBoard;
2318 Category: TCategory;
2319 Bitmap: TBitmap;
2320 NodeWidth: Integer;
2321 begin
2322 DefaultDraw := True;
2323
2324 if FTreeType = gttHistory then Exit;
2325
2326 TreeView.Canvas.Font.Color := clBlue;
2327 IsBoardNode := False;
2328 for i := 0 to TreeView.Items.Count - 1 do begin
2329 Cnt := 0;
2330 if not TreeView.Items[i].IsVisible then
2331 continue;
2332
2333 if TObject(TreeView.Items[i].Data) is TCategory then begin
2334 if TreeView.Items[i].Expanded then
2335 continue;
2336
2337 IsBoardNode := False;
2338 Category := TCategory(TreeView.Items[i].Data);
2339 for j := 0 to Category.Count - 1 do begin
2340 Board := Category.Items[j];
2341 if Board <> nil then begin
2342 if Board.UnRead > 0 then begin
2343 Cnt := 1;
2344 Break;
2345 end;
2346 end;
2347 end;
2348 if Cnt <> 1 then
2349 continue;
2350 end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2351 IsBoardNode := True;
2352 Board := TBoard(TreeView.Items[i].Data);
2353
2354 Cnt := Board.UnRead;
2355 if Cnt <= 0 then
2356 continue;
2357 end else
2358 continue;
2359
2360 Bitmap := TBitmap.Create;
2361 try
2362 Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2363 Bitmap.Canvas.Font.Style := [fsBold];
2364 NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2365 finally
2366 Bitmap.Free;
2367 end;
2368
2369 NodeRect := TreeView.Items[i].DisplayRect(True);
2370
2371 if IsBoardNode then
2372 CntText := '(' + IntToStr(Cnt) + ')'
2373 else if Cnt = 1 then
2374 CntText := '(+)';
2375
2376
2377 TextWidth := TreeView.Canvas.TextWidth(CntText);
2378
2379 TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2380 NodeRect.Top,
2381 NodeRect.Left + NodeWidth + TextWidth + 8,
2382 NodeRect.Bottom);
2383 DrawText(TreeView.Canvas.Handle,
2384 PChar(CntText),
2385 -1,
2386 TextRect,
2387 DT_SINGLELINE or DT_VCENTER);
2388 end;
2389 TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2390 end;
2391
2392 procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2393 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2394 var
2395 Board: TBoard;
2396 Category: TCategory;
2397 i: Integer;
2398 begin
2399 DefaultDraw := True;
2400
2401 if FTreeType = gttHistory then Exit;
2402
2403 TreeView.Canvas.Font.Style := [];
2404 if Node <> nil then begin
2405 if TObject(Node.Data) is TCategory then begin
2406 Category := TCategory(Node.Data);
2407 for i := 0 to Category.Count - 1 do begin
2408 Board := Category.Items[i];
2409 if Board <> nil then begin
2410 if Board.UnRead > 0 then begin
2411 TreeView.Canvas.Font.Style := [fsBold];
2412 Break;
2413 end;
2414 end;
2415 end;
2416 end else if TObject(Node.Data) is TBoard then begin
2417 Board := TBoard(Node.Data);
2418 if Board.UnRead > 0 then
2419 TreeView.Canvas.Font.Style := [fsBold];
2420 end;
2421 end;
2422 end;
2423
2424 procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2425 begin
2426 TreeView.Invalidate;
2427
2428 if TObject(Node.Data) is TBBS then begin
2429 TBBS(Node.Data).NodeExpand := True;
2430 end else if TObject(Node.Data) is TCategory then begin
2431 TCategory(Node.Data).NodeExpand := True;
2432 end else if TObject(Node.Data) is TBoard then begin
2433 TBoard(Node.Data).NodeExpand := True;
2434 end;
2435 end;
2436
2437 procedure TGikoForm.ListViewAllSelect;
2438 begin
2439 ListView.SetFocus;
2440 ListView.SelectAll;
2441 end;
2442 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
2443 begin
2444 if csDestroying in Self.ComponentState then
2445 Exit;
2446 AddMessageList(Msg, nil, Icon);
2447 end;
2448 // *************************************************************************
2449 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?
2450 // *************************************************************************
2451 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
2452 var
2453 ATitle: string;
2454 s: string;
2455 boardPlugIn : TBoardPlugIn;
2456 i: Integer;
2457 Res : TResRec;
2458 begin
2459 try
2460 if csDestroying in Self.ComponentState then
2461 Exit;
2462 if Item.DownType = gdtBoard then
2463 ATitle := Item.Board.Title
2464 else
2465 ATitle := Item.ThreadItem.Title;
2466 if ATitle = '' then
2467 ATitle := GikoSys.GetGikoMessage(gmUnKnown);
2468
2469 if Item.State in [gdsComplete, gdsDiffComplete] then begin
2470 //鐃緒申鐃緒申鐃?鐃緒申
2471 if Item.DownType = gdtBoard then begin
2472 //鐃緒申
2473 Item.SaveListFile;
2474 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureItiran), nil, gmiOK);
2475 if GetActiveList = Item.Board then begin
2476 FActiveList := nil;
2477 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申
2478 if (GikoSys.Setting.AutoSortThreadList) then begin
2479 GikoSys.Setting.BoardSortIndex := 0;
2480 GikoSys.Setting.BoardSortOrder := True;
2481 end;
2482 Sort.SetSortDate(Now());
2483 SetActiveList(Item.Board);
2484 end;
2485 Item.Board.Modified := True;
2486 Item.Board.IsThreadDatRead := True;
2487 PlaySound('New');
2488 ListView.Refresh;
2489 end else if Item.DownType = gdtThread then begin
2490 //鐃?鐃緒申
2491 Item.SaveItemFile;
2492 Item.ThreadItem.NewArrival := True;
2493 //if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2494 if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
2495 //boardPlugIn := Item.ThreadItem.BoardPlugIn;
2496 boardPlugIn := Item.ThreadItem.ParentBoard.BoardPlugIn;
2497 THTMLCreate.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 ), @Res);
2498 Item.ThreadItem.Title := Res.FTitle;
2499 ATitle := Item.ThreadItem.Title;
2500 end else if ATitle = '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?' then begin
2501 THTMLCreate.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1), @Res);
2502 ATitle := Res.FTitle;
2503 end;
2504 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2505 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin
2506 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2507 break;
2508 end;
2509 end;
2510 if GikoSys.Setting.BrowserTabVisible then begin
2511 if GetActiveContent = Item.ThreadItem then
2512 InsertBrowserTab(Item.ThreadItem)
2513 else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then
2514 InsertBrowserTab(Item.ThreadItem, True)
2515 else
2516 InsertBrowserTab(Item.ThreadItem, False);
2517
2518 end else begin
2519 if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then
2520 InsertBrowserTab(Item.ThreadItem);
2521 end;
2522
2523 Application.ProcessMessages;
2524
2525 if Item.State = gdsComplete then begin
2526 PlaySound('New');
2527 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureSyutoku), nil, gmiOK);
2528 //Add by Genyakun
2529 DiffComp := True;
2530 end else begin
2531 PlaySound('NewDiff');
2532 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureDiff), nil, gmiOK);
2533 //Add by Genyakun
2534 DiffComp := True;
2535 end;
2536
2537 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2538 if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin
2539 // 2ch鐃緒申鐃?鐃緒申鐃?1000鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2540 if (Item.ThreadItem.ParentBoard.Is2ch) then begin
2541 Item.ThreadItem.Round := False;
2542 AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK);
2543 end;
2544 end;
2545 TreeView.Refresh;
2546 //ListView鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
2547 if (ActiveList <> nil) and (ActiveList is TBoard) then begin
2548 TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount;
2549 TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount;
2550 TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount;
2551 //ListView鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?
2552 case GikoForm.ViewType of
2553 gvtAll: ListView.Items.Count := TBoard(ActiveList).Count;
2554 gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount;
2555 gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount;
2556 gvtArch: ListView.Items.Count := TBoard(ActiveList).ArchiveThreadCount;
2557 gvtLive: ListView.Items.Count := TBoard(ActiveList).LiveThreadCount;
2558 gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount;
2559 end;
2560 end;
2561 RefreshListView(Item.ThreadItem);
2562 end;
2563
2564 end else if Item.State = gdsNotModify then begin
2565 //鐃緒申鐃?鐃?鐃?
2566 { if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin
2567 //SetContent(Item.ThreadItem);
2568 InsertBrowserTab(Item.ThreadItem);
2569 end;}
2570 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmNotMod), nil, gmiSAD);
2571 PlaySound('NoChange');
2572 Screen.Cursor := crDefault;
2573 end else if Item.State = gdsAbort then begin
2574 //鐃緒申鐃?
2575 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
2576 end else if Item.State = gdsError then begin
2577 //鐃?鐃緒申鐃?
2578 s := Item.ErrText;
2579 if s <> '' then
2580 s := ':' + s;
2581 AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmError) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG);
2582 // if Item.ResponseCode = 302 then
2583 // AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG);
2584 PlaySound('Error');
2585 end;
2586 finally
2587 Item.Free;
2588 Dec(FWorkCount);
2589 if FWorkCount < 0 then FWorkCount := 0;
2590 if FWorkCount = 0 then begin
2591 try
2592 Animate.Active := False;
2593 finally
2594 Screen.Cursor := crDefault;
2595 end;
2596 end;
2597
2598 end;
2599 end;
2600
2601 procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
2602 begin
2603 // SetProgressValue(Number, 0, AWorkCountMax);
2604 // ProgressBar.Visible := True;
2605 if csDestroying in Self.ComponentState then
2606 Exit;
2607
2608 ProgressBar.Position := 0;
2609 ProgressBar.Max := AWorkCountMax;
2610 FDownloadTitle := AWorkTitle;
2611 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申';
2612 FDownloadMax := AWorkCountMax;
2613 end;
2614
2615 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
2616 begin
2617 if csDestroying in Self.ComponentState then
2618 Exit;
2619 ProgressBar.Position := 0;
2620 if FDownloadMax <> 0 then
2621 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
2622 end;
2623
2624 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
2625 begin
2626 if csDestroying in Self.ComponentState then
2627 Exit;
2628 ProgressBar.Position := AWorkCount;
2629 // SetProgressValue(Number, AWorkCount);
2630 StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
2631 end;
2632
2633 procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
2634 var
2635 ListItem: TListItem;
2636 begin
2637 MessageListView.Items.BeginUpdate;
2638 try
2639 ListItem := MessageListView.Items.Add;
2640 ListItem.Caption := ACaption;
2641 ListItem.Data := AObject;
2642 ListItem.MakeVisible(False);
2643 case Icon of
2644 gmiOK: ListItem.ImageIndex := 0;
2645 gmiSAD: ListItem.ImageIndex := 1;
2646 gmiNG: ListItem.ImageIndex := 2;
2647 gmiWhat: ListItem.ImageIndex := 3;
2648 end;
2649 finally
2650 MessageListView.Items.EndUpdate;
2651 end;
2652 end;
2653
2654 //! 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Browser鐃緒申鐃?鐃緒申
2655 procedure TGikoForm.ReleaseOldestBrowser;
2656 var
2657 i: Integer;
2658 begin
2659 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2660 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2661 TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin
2662 ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i]));
2663 break;
2664 end;
2665 end;
2666 end;
2667
2668 function TGikoForm.InsertBrowserTab(
2669 ThreadItem : TThreadItem;
2670 ActiveTab : Boolean = True
2671 ) : TBrowserRecord;
2672 var
2673 i, j, idx : Integer;
2674 favItem : TFavoriteThreadItem;
2675 newBrowser : TBrowserRecord;
2676 ins : Integer;
2677 begin
2678
2679 Result := nil;
2680 if Threaditem = nil then Exit;
2681
2682 if ThreadItem.IsLogFile then begin
2683 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申browser鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2684 //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申Active鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2685 if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) and
2686 (FActiveContent.Browser <> BrowserNullTab.Browser)then begin
2687 j := FBrowsers.IndexOf(FActiveContent.Browser);
2688 if j = BROWSER_COUNT - 1 then
2689 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2690 end;
2691 favItem := TFavoriteThreadItem.Create(ThreadItem.URL, ThreadItem.Title );
2692 if not FHistoryList.AddHistory( favItem, TreeView, FTreeType ) then
2693 favItem.Free;
2694
2695 for i := 0 to BrowserTab.Tabs.Count - 1 do begin
2696 if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin
2697 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin
2698 Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] );
2699 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin
2700 //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2701 ReleaseOldestBrowser;
2702 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2703 TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true;
2704 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2705 end;
2706 if ActiveTab then begin
2707 BrowserTab.TabIndex := i;
2708 BrowserTab.OnChange(nil);
2709 BrowserTab.Repaint;
2710 end;
2711 Exit;
2712 end;
2713 end;
2714 end;
2715 idx := BrowserTab.TabIndex;
2716 newBrowser := TBrowserRecord.Create;
2717 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2718 ReleaseOldestBrowser;
2719 newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2720 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2721 newBrowser.thread := ThreadItem;
2722 newBrowser.Repaint := true;
2723
2724 if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin
2725 BrowserTab.Tabs.InsertObject(0, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2726 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2727 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2728 end;// else begin
2729 //end;
2730 BrowserTab.Repaint;
2731 if ActiveTab then begin
2732 BrowserTab.TabIndex := 0;
2733 end;
2734 end else if GikoSys.Setting.BrowserTabAppend = gtaLast then begin
2735 i := BrowserTab.Tabs.AddObject(GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2736 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2737 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2738 end;
2739 //end;
2740 BrowserTab.Repaint;
2741 if ActiveTab then begin
2742 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2743 BrowserTab.TabIndex := 0
2744 else
2745 BrowserTab.TabIndex := i;
2746 end;
2747 end else begin
2748 // 鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2749 ins := -1;
2750 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
2751 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser =
2752 TWebBrowser(FBrowsers[1]) then begin
2753 ins := i;
2754 break;
2755 end;
2756 end;
2757 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2758 Inc(ins);
2759 end;
2760 // 鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
2761 if (ins < 0) then begin
2762 ins := 0;
2763 end;
2764 BrowserTab.Tabs.InsertObject(ins, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser);
2765 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin
2766 if GikoSys.Setting.BrowserTabAppend = gtaRight then begin
2767 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) );
2768 end else begin
2769 DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) );
2770 end;
2771 end;
2772 //end;
2773 BrowserTab.Repaint;
2774 if ActiveTab then begin
2775 if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then
2776 BrowserTab.TabIndex := 0
2777 else
2778 BrowserTab.TabIndex := ins;
2779 end;
2780 end;
2781 Result := newBrowser;
2782 if(ActiveTab) or (idx = -1) then begin
2783 BrowserTab.OnChange(nil);
2784 end;
2785 end else begin
2786 if BrowserNullTab = nil then begin
2787 BrowserNullTab := TBrowserRecord.Create;
2788 BrowserNullTab.Browser := Browser;
2789 end;
2790 // if BrowserNullTab.thread <> ThreadItem then begin
2791 // BrowserNullTab.Movement := '';
2792 // end;
2793 BrowserNullTab.thread := ThreadItem;
2794 Result := BrowserNullTab;
2795 BrowserTab.TabIndex := -1;
2796 SetContent(BrowserNullTab);
2797 end;
2798
2799 if GikoSys.Setting.URLDisplay then
2800 AddressComboBox.Text := ThreadItem.URL;
2801
2802 end;
2803
2804 procedure TGikoForm.SetContent(inThread : TBrowserRecord);
2805 var
2806 BBSID: string;
2807 FileName: string;
2808 sTitle: string;
2809 doc: Variant;
2810 s: string;
2811 idx: Integer;
2812 ThreadItem: TThreadItem;
2813 Thread: TBrowserRecord;
2814 ThreadTitle, ThreadPTitle: string;
2815 ThreadIsLog, {ThreadUnRead,} ThreadNewArraical: boolean;
2816 begin
2817 Thread := inThread;
2818 idx := BrowserTab.TabIndex;
2819 if (not FStartUp) and
2820 (FActiveContent <> nil) and
2821 (FActiveContent.Thread <> Thread.Thread) and
2822 (FActiveContent.Browser <> nil) and
2823 (Assigned(FActiveContent.Browser.Document)) then begin
2824 try
2825 try
2826 FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document).Body).ScrollTop;
2827 except
2828 on E: Exception do
2829 MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0);
2830 end;
2831 finally
2832 end;
2833 end;
2834 if not (Assigned(Thread)) or (Thread.Thread = nil) then begin
2835 Thread.Browser.Navigate(BLANK_HTML);
2836 BrowserBoardNameLabel.Caption := '';
2837 ItemBoardImage.Picture := nil;
2838 BrowserNameLabel.Caption := '';
2839 ItemImage.Picture := nil;
2840 BrowserNullTab.Thread := nil;
2841 //TOleControl(BrowserNullTab.Browser).Visible := true;
2842 ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
2843 FActiveContent := nil;
2844 Exit;
2845 end else if Thread.Browser = nil then begin
2846 if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then
2847 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2848 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
2849 ReleaseOldestBrowser;
2850 Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]);
2851 FBrowsers.Move(BROWSER_COUNT - 1, 0);
2852 end;
2853
2854 ThreadTitle := Thread.Thread.Title;
2855 ThreadPTitle := Thread.Thread.ParentBoard.Title;
2856 //ThreadScrollTop := Thread.Thread.ScrollTop;
2857 if Thread.Thread.IsLogFile then begin
2858 if not FileExists(Thread.Thread.GetThreadFileName) then begin
2859 Thread.Thread.DeleteLogFile;
2860 end;
2861 end;
2862
2863 ThreadIsLog := Thread.Thread.IsLogFile;
2864 ThreadItem := Thread.Thread;
2865 ThreadNewArraical := Thread.Thread.NewArrival;
2866 //ThreadUnRead := Thread.Thread.UnRead;
2867 BBSID := ThreadItem.ParentBoard.BBSID;
2868 FileName := ThreadItem.FileName;
2869
2870 if GetCapture = ListView.Handle then
2871 ReleaseCapture;
2872
2873 Screen.Cursor := crHourGlass;
2874
2875
2876 try
2877 if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin
2878 if (FActiveContent.Browser <> BrowserNullTab.Browser) then
2879 ShowWindow(FActiveContent.Browser.Handle, SW_HIDE);
2880 end;
2881 ShowWindow(Thread.Browser.Handle, SW_SHOW);
2882 if (not Assigned(Thread.Browser.Document)) then begin
2883 Thread.Browser.Navigate('about:blank');
2884 end;
2885 while (Thread.Browser.ReadyState <> READYSTATE_COMPLETE) and
2886 (Thread.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
2887 Application.ProcessMessages;
2888 if idx <> BrowserTab.TabIndex then begin
2889 Exit;
2890 end;
2891 end;
2892
2893 if (Thread <> nil) and (ThreadItem <>nil) then begin
2894 BrowserBoardNameLabel.Caption := ThreadPTitle;
2895 ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap);
2896 BrowserNameLabel.Caption := ThreadTitle;
2897 ItemImage.Picture := nil;
2898 if ThreadIsLog then
2899 if ThreadNewArraical then
2900 ItemImageList.GetBitmap(2, ItemImage.Picture.Bitmap)
2901 else
2902 ItemImageList.GetBitmap(0, ItemImage.Picture.Bitmap)
2903 else
2904 ItemImageList.GetBitmap(1, ItemImage.Picture.Bitmap);
2905
2906 ItemImage.Left := BrowserBoardNameLabel.Left + BrowserBoardNameLabel.Width + 8;
2907 BrowserNameLabel.Left := ItemImage.Left + 20;
2908
2909 end;
2910 //ActiveContent鐃?鐃緒申鐃?鐃?
2911 FActiveContent := Thread;
2912
2913 if not ThreadIsLog then begin
2914 Self.Caption := GikoDataModule.CAPTION_NAME ;
2915 //鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申