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.640 - (show annotations) (download) (as text)
Wed Aug 1 15:02:42 2007 UTC (16 years, 8 months ago) by h677
Branch: MAIN
CVS Tags: v1_57_0_719
Changes since 1.639: +11 -6 lines
File MIME type: text/x-pascal
Folder.idxファイル読み込み時にdatファイルをチェックしないオプションを追加
最小化時にブラウザがスクロールしそうな部分に手を入れてみた。

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