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.596 - (show annotations) (download) (as text)
Sun Feb 26 04:05:52 2006 UTC (18 years, 1 month ago) by h677
Branch: MAIN
CVS Tags: v1_52_0_649
Changes since 1.595: +16 -11 lines
File MIME type: text/x-pascal
スレッド一覧の更新を関数化

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