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.598 - (show annotations) (download) (as text)
Sat Mar 4 12:31:45 2006 UTC (18 years, 1 month ago) by h677
Branch: MAIN
CVS Tags: v1_52_0_651
Changes since 1.597: +27 -23 lines
File MIME type: text/x-pascal
スレ一覧の絞込みで、生前スレ&DAT落ちスレの解除がしない不具合の修正

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