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.601 - (show annotations) (download) (as text)
Tue May 30 16:06:46 2006 UTC (17 years, 10 months ago) by h677
Branch: MAIN
CVS Tags: v1_52_1_658, v1_52_1_657, v1_52_0_655, v1_52_0_656
Branch point for: Bb52
Changes since 1.600: +2 -2 lines
File MIME type: text/x-pascal
過去ログ取得に必要な、DownloadHostの設定が、2ちゃんねる以外のBBSの
時になっていたのを修正。

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