Develop and Download Open Source Software

Browse CVS Repository

Contents of /gikonavigoeson/gikonavi/Giko.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.635.2.5 - (show annotations) (download) (as text)
Sat May 12 02:46:10 2007 UTC (16 years, 11 months ago) by h677
Branch: bRESPOPUP
CVS Tags: v1_56_0_704
Changes since 1.635.2.4: +25 -86 lines
File MIME type: text/x-pascal
以前のヒントを使ったポップアップを廃止
タイトルしか出ないときに、スクロールバーが出ないように変更
画面サイズをワークエリアで設定するように変更

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