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.593 - (show annotations) (download) (as text)
Wed Feb 22 18:29:18 2006 UTC (18 years, 1 month ago) by h677
Branch: MAIN
CVS Tags: v1_52_0_648
Changes since 1.592: +5 -11 lines
File MIME type: text/x-pascal
登録していないジェスチャーを実行するとAccessViolationが発生する不具合の修正

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