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.635.2.9 - (show annotations) (download) (as text)
Tue May 15 16:38:20 2007 UTC (16 years, 11 months ago) by h677
Branch: bRESPOPUP
CVS Tags: v1_56_0_707
Changes since 1.635.2.8: +25 -23 lines
File MIME type: text/x-pascal
スレポップアップ中でクリックすると、レスポップアップしなくなる不具合対応

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