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