Develop and Download Open Source Software

Browse CVS Repository

Annotation of /gikonavigoeson/gikonavi/Giko.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.558 - (hide annotations) (download) (as text)
Sat Dec 10 06:54:32 2005 UTC (18 years, 4 months ago) by h677
Branch: MAIN
Changes since 1.557: +37 -52 lines
File MIME type: text/x-pascal
リファクタリング中

1 hi_ 1.1 unit Giko;
2    
3     interface
4    
5     uses
6     Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7 h677 1.536 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils,
8 hi_ 1.4 {$IF Defined(DELPRO) }
9 yoffy 1.138 SHDocVw,
10 hi_ 1.4 MSHTML,
11     {$ELSE}
12     SHDocVw_TLB,
13     MSHTML_TLB,
14     {$IFEND}
15 h677 1.183 IdHTTP, ActiveX, ActnList, ImgList,
16 h677 1.536 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 h677 1.551 IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord;
22 hi_ 1.1
23     type
24 yoffy 1.138 TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite);
25 yoffy 1.258 TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
26 yoffy 1.280 TMinimizeType = (mtNone, mtMinimizing, mtMinimized);
27 yoffy 1.424 TResizeType = (rtNone, rtResizing);
28 hi_ 1.1
29 h677 1.551 // TBrowserRecord = class;
30 h677 1.299
31 hi_ 1.1 TGikoForm = class(TForm)
32     StatusBar: TStatusBar;
33     MainPanel: TPanel;
34     ClientPanel: TPanel;
35     TreeSplitter: TSplitter;
36     CabinetPanel: TPanel;
37     TreeView: TTreeView;
38     ThreadMainPanel: TPanel;
39     ListSplitter: TSplitter;
40     ViewPanel: TPanel;
41 yoffy 1.51 ListView: TGikoListView;
42 hi_ 1.1 ThreadPanel: TPanel;
43     MessagePanel: TPanel;
44     MessageBar: TPanel;
45     MessageHideButton: TSpeedButton;
46     MessageListView: TListView;
47     MessageSplitter: TSplitter;
48     Panel3: TPanel;
49 h677 1.541 CabinetCloseSpeedButton: TSpeedButton;
50 hi_ 1.1 ToolBar1: TToolBar;
51     CabinetSelectToolButton: TToolButton;
52     HistoryToolBar: TToolBar;
53 h677 1.541 HistoryShowToolButton: TToolButton;
54     HistoryAllClearToolButton: TToolButton;
55 hi_ 1.1 ItemIcon16: TImageList;
56     ItemIcon32: TImageList;
57 yoffy 1.2 HotToobarImageList: TImageList;
58 hi_ 1.1 ItemImageList: TImageList;
59     MainMenu: TMainMenu;
60     FileMenu: TMenuItem;
61 yoffy 1.51 DeleteMenu: TMenuItem;
62     ExitMenu: TMenuItem;
63     KidokuMenu: TMenuItem;
64 hi_ 1.1 MidokuMenu: TMenuItem;
65 yoffy 1.51 AllSelectMenu: TMenuItem;
66 hi_ 1.1 ViewMenu: TMenuItem;
67     StdToolBarMenu: TMenuItem;
68     CabinetMenu: TMenuItem;
69 yoffy 1.51 H1: TMenuItem;
70 hi_ 1.1 N4: TMenuItem;
71 yoffy 1.51 CabinetVisibleMenu: TMenuItem;
72 hi_ 1.1 MessageMenu: TMenuItem;
73     StatusBarMenu: TMenuItem;
74     MMSep03: TMenuItem;
75 yoffy 1.51 LargeIconMenu: TMenuItem;
76 hi_ 1.1 SmallIconMenu: TMenuItem;
77     ListMenu: TMenuItem;
78     DetailMenu: TMenuItem;
79 yoffy 1.51 ToolMenu: TMenuItem;
80 hi_ 1.1 Find1: TMenuItem;
81     RoundMenu: TMenuItem;
82     MMSep04: TMenuItem;
83     OptionMenu: TMenuItem;
84     HelpMenu: TMenuItem;
85     G1: TMenuItem;
86 yoffy 1.51 N1: TMenuItem;
87 hi_ 1.1 AboutMenu: TMenuItem;
88     BrowserPopupMenu: TPopupMenu;
89 yoffy 1.51 ShowThreadMenu: TMenuItem;
90 yoffy 1.2 ShowBoardMenu: TMenuItem;
91 hi_ 1.1 ListIconPopupMenu: TPopupMenu;
92     LargeIconPMenu: TMenuItem;
93     SmallIconPMenu: TMenuItem;
94     ListPMenu: TMenuItem;
95 yoffy 1.51 DetailPMenu: TMenuItem;
96 hi_ 1.1 ClosePopupMenu: TPopupMenu;
97 yoffy 1.51 CloseMenu: TMenuItem;
98 hi_ 1.1 U1: TMenuItem;
99     N3: TMenuItem;
100     B1: TMenuItem;
101     S1: TMenuItem;
102     N2: TMenuItem;
103     A1: TMenuItem;
104     L1: TMenuItem;
105     N5: TMenuItem;
106     S2: TMenuItem;
107     ListPopupMenu: TPopupMenu;
108 yoffy 1.51 ListRoundPMenu: TMenuItem;
109 hi_ 1.1 ListReservPMenu: TMenuItem;
110     LPMSep01: TMenuItem;
111 yoffy 1.51 ItemRoundPMenu: TMenuItem;
112 hi_ 1.1 LPMSep02: TMenuItem;
113 yoffy 1.2 KidokuPMenu: TMenuItem;
114 hi_ 1.1 MidokuPMenu: TMenuItem;
115     AllSelectPMenu: TMenuItem;
116     UrlCopyPMenu: TMenuItem;
117     LPMSep05: TMenuItem;
118     DeletePMenu: TMenuItem;
119     LPMSep06: TMenuItem;
120     ViewPMenu: TMenuItem;
121     LargeIconLPMenu: TMenuItem;
122     SmallIconLPMenu: TMenuItem;
123     ListLPMenu: TMenuItem;
124     DetailLPMenu: TMenuItem;
125     T1: TMenuItem;
126     B2: TMenuItem;
127     N8: TMenuItem;
128 yoffy 1.51 URLC1: TMenuItem;
129     N9: TMenuItem;
130 hi_ 1.1 N10: TMenuItem;
131     G2: TMenuItem;
132     N11: TMenuItem;
133     T3: TMenuItem;
134     L2: TMenuItem;
135     N12: TMenuItem;
136     K1: TMenuItem;
137     N13: TMenuItem;
138     N14: TMenuItem;
139     R1: TMenuItem;
140     A2: TMenuItem;
141     N15: TMenuItem;
142     KokoPopupMenu: TPopupMenu;
143     KokomadePMenu: TMenuItem;
144 yoffy 1.2 AllPMenu: TMenuItem;
145 hi_ 1.1 MenuItem1: TMenuItem;
146     MenuItem2: TMenuItem;
147     BrowserTabPopupMenu: TPopupMenu;
148 yoffy 1.51 Close1: TMenuItem;
149 hi_ 1.1 A3: TMenuItem;
150 yoffy 1.51 N16: TMenuItem;
151 hi_ 1.1 A4: TMenuItem;
152     TreePopupMenu: TPopupMenu;
153     TreeSelectThreadPupupMenu: TMenuItem;
154 yoffy 1.51 TreeSelectBoardPupupMenu: TMenuItem;
155 hi_ 1.1 TPMSep01: TMenuItem;
156     TreeSelectURLPupupMenu: TMenuItem;
157     T2: TMenuItem;
158 yoffy 1.2 L3: TMenuItem;
159 hi_ 1.1 B3: TMenuItem;
160     BrowserBottomPanel: TGikoPanel;
161     CabinetSelectPopupMenu: TPopupMenu;
162     H2: TMenuItem;
163 yoffy 1.51 ItemReservPMenu: TMenuItem;
164     RoundNamePopupMenu: TPopupMenu;
165 yoffy 1.2 N7: TMenuItem;
166 hi_ 1.1 B4: TMenuItem;
167     L4: TMenuItem;
168     K2: TMenuItem;
169 yoffy 1.51 A5: TMenuItem;
170 hi_ 1.1 A6: TMenuItem;
171 yoffy 1.51 C1: TMenuItem;
172     V1: TMenuItem;
173     N19: TMenuItem;
174 hi_ 1.1 D1: TMenuItem;
175 yoffy 1.51 D2: TMenuItem;
176     MessageImageList: TImageList;
177     ProgressBar: TProgressBar;
178     URL1: TMenuItem;
179 hi_ 1.1 NameUrlCopyPMenu: TMenuItem;
180     URLC2: TMenuItem;
181 yoffy 1.51 URLN1: TMenuItem;
182     N21: TMenuItem;
183     URLC3: TMenuItem;
184 yoffy 1.2 URLN2: TMenuItem;
185 yoffy 1.51 N23: TMenuItem;
186 yoffy 1.2 ListCoolBar: TGikoCoolBar;
187 hi_ 1.1 ListToolBar: TToolBar;
188 yoffy 1.2 BrowserCoolBar: TGikoCoolBar;
189 hi_ 1.1 BrowserToolBar: TToolBar;
190     ToolButton3: TToolButton;
191 yoffy 1.51 ToolButton9: TToolButton;
192 hi_ 1.1 ToolButton11: TToolButton;
193 yoffy 1.51 ToolButton5: TToolButton;
194 hi_ 1.1 ListNameToolBar: TToolBar;
195 yoffy 1.51 ListNameLabel: TLabel;
196 hi_ 1.1 FolderImage: TImage;
197     BrowserNameToolBar: TToolBar;
198     ItemBoardImage: TImage;
199     BrowserBoardNameLabel: TLabel;
200 yoffy 1.51 ItemImage: TImage;
201     BrowserNameLabel: TLabel;
202     D3: TMenuItem;
203     N25: TMenuItem;
204 hi_ 1.1 N26: TMenuItem;
205     D4: TMenuItem;
206     S3: TMenuItem;
207 yoffy 1.51 R2: TMenuItem;
208     TreeSelectNameURLPupupMenu: TMenuItem;
209     N27: TMenuItem;
210 hi_ 1.1 H3: TMenuItem;
211 yoffy 1.51 I1: TMenuItem;
212     BrowserTabToolBar: TToolBar;
213     BrowserTab: TTabControl;
214     About1: TMenuItem;
215     N28: TMenuItem;
216     S4: TMenuItem;
217 yoffy 1.2 N29: TMenuItem;
218     N30: TMenuItem;
219     N31: TMenuItem;
220 hi_ 1.1 L5: TMenuItem;
221 yoffy 1.51 L6: TMenuItem;
222 hi_ 1.1 A7: TMenuItem;
223 yoffy 1.51 R3: TMenuItem;
224 hi_ 1.1 FavoriteMenu: TMenuItem;
225 yoffy 1.51 N32: TMenuItem;
226 hi_ 1.1 BoardFavoriteAddMenu: TMenuItem;
227     ThreadFavoriteAddMenu: TMenuItem;
228 yoffy 1.2 N33: TMenuItem;
229 hi_ 1.1 TreeSelectFavoriteAddPupupMenu: TMenuItem;
230     FavoriteTreeView: TTreeView;
231 yoffy 1.51 StateIconImageList: TImageList;
232     TopPanel: TPanel;
233     TopRightPanel: TPanel;
234     AnimePanel: TPanel;
235 hi_ 1.1 Animate: TAnimate;
236     TopCoolPanel: TPanel;
237 yoffy 1.51 MainCoolBar: TGikoCoolBar;
238     MenuToolBar: TToolBar;
239     StdToolBar: TToolBar;
240     AddressToolBar: TToolBar;
241     AddressComboBox: TComboBox;
242     MoveToToolButton: TToolButton;
243     AddressImageList: TImageList;
244     AddressToolBarMenu: TMenuItem;
245     T4: TMenuItem;
246     Show1: TMenuItem;
247     N34: TMenuItem;
248 hi_ 1.1 T5: TMenuItem;
249     B5: TMenuItem;
250 yoffy 1.51 N35: TMenuItem;
251     A8: TMenuItem;
252     U2: TMenuItem;
253 hi_ 1.1 F1: TMenuItem;
254     PreviewTimer: TTimer;
255 yoffy 1.51 MonazillaWebPageAction1: TMenuItem;
256     N36: TMenuItem;
257     H4: TMenuItem;
258     K3: TMenuItem;
259     L7: TMenuItem;
260     N37: TMenuItem;
261     A9: TMenuItem;
262 yoffy 1.2 ChevronPopupMenu: TPopupMenu;
263     N2N1: TMenuItem;
264 hi_ 1.1 N38: TMenuItem;
265 yoffy 1.2 F2: TMenuItem;
266 yoffy 1.51 LinkToolBar: TToolBar;
267     a10: TMenuItem;
268     N39: TMenuItem;
269     T6: TMenuItem;
270     N40: TMenuItem;
271 yoffy 1.2 LinkBarPopupMenu: TPopupMenu;
272 yoffy 1.51 T7: TMenuItem;
273     ThreadPopupMenu: TPopupMenu;
274     MenuItem4: TMenuItem;
275     MenuItem5: TMenuItem;
276     MenuItem6: TMenuItem;
277 yoffy 1.2 T8: TMenuItem;
278 yoffy 1.51 URLN3: TMenuItem;
279 yoffy 1.2 SelectItemNameCopyAction1: TMenuItem;
280 yoffy 1.51 B6: TMenuItem;
281     T9: TMenuItem;
282     C2: TMenuItem;
283     SelectComboBox: TComboBox;
284     MainCoolBarPopupMenu: TPopupMenu;
285     StdToolBarVisiblePMenu: TMenuItem;
286     AddressToolBarVisiblePMenu: TMenuItem;
287     LinkToolBarVisiblePMenu: TMenuItem;
288     NG1: TMenuItem;
289     NG2: TMenuItem;
290     N43: TMenuItem;
291     N44: TMenuItem;
292     L9: TMenuItem;
293     I3: TMenuItem;
294     N45: TMenuItem;
295     B9: TMenuItem;
296     R5: TMenuItem;
297     T12: TMenuItem;
298     Show3: TMenuItem;
299     N46: TMenuItem;
300     T13: TMenuItem;
301     B10: TMenuItem;
302     N47: TMenuItem;
303     A12: TMenuItem;
304     U4: TMenuItem;
305     F4: TMenuItem;
306     N48: TMenuItem;
307     T14: TMenuItem;
308     ToolButton16: TToolButton;
309     N50: TMenuItem;
310     A11: TMenuItem;
311     S5: TMenuItem;
312     Reload: TMenuItem;
313     GoBack: TMenuItem;
314     GoFoward: TMenuItem;
315     IndividualAbon1: TMenuItem;
316     N41: TMenuItem;
317     IndividualAbon2: TMenuItem;
318 h677 1.543 AntiIndivAbonMenuItem: TMenuItem;
319 yoffy 1.51 AntiIndividualAbon: TMenuItem;
320     N49: TMenuItem;
321     N51: TMenuItem;
322     N52: TMenuItem;
323     SearchBoardName: TMenuItem;
324 yoffy 1.205 TreeSelectLogDeleteSeparator: TMenuItem;
325 yoffy 1.100 N54: TMenuItem;
326     A13: TMenuItem;
327     FavoriteTreePopupMenu: TPopupMenu;
328     FavoriteTreeRenamePopupMenu: TMenuItem;
329     FavoriteTreeNewFolderPopupMenu: TMenuItem;
330     N56: TMenuItem;
331     FavoriteTreeDeletePopupMenu: TMenuItem;
332     FavoriteToolBar: TToolBar;
333 h677 1.541 FavoriteAddToolButton: TToolButton;
334     FavoriteArrangeToolButton: TToolButton;
335 yoffy 1.100 FavoriteTreeBrowseFolderPopupMenu: TMenuItem;
336     N57: TMenuItem;
337     FavoriteTreeReloadPopupMenu: TMenuItem;
338     N58: TMenuItem;
339     FavoriteTreeURLCopyPopupMenu: TMenuItem;
340     FavoriteTreeNameCopyPopupMenu: TMenuItem;
341     FavoriteTreeLogDeletePopupMenu: TMenuItem;
342     N59: TMenuItem;
343     FavoriteTreeNameURLCopyPopupMenu: TMenuItem;
344     ToolButton20: TToolButton;
345     N60: TMenuItem;
346 yoffy 1.107 ExportFavoriteFileAction1: TMenuItem;
347 yoffy 1.142 N6: TMenuItem;
348     N17: TMenuItem;
349 h677 1.174 N18: TMenuItem;
350     N20: TMenuItem;
351 h677 1.532 N24: TMenuItem;
352 h677 1.174 N62: TMenuItem;
353 h677 1.514 N61: TMenuItem;
354 h677 1.478 N63: TMenuItem;
355 h677 1.183 N64: TMenuItem;
356 h677 1.187 dummy1: TMenuItem;
357 yoffy 1.205 TreeSelectLogDeletePopupMenu: TMenuItem;
358 h677 1.485 N65: TMenuItem;
359 yoffy 1.209 BBSSelectPopupMenu: TPopupMenu;
360 yoffy 1.218 PlugInMenu: TMenuItem;
361 h677 1.542 TreeSelectNamePupupMenu: TMenuItem;
362 h677 1.299 BrowserPanel: TPanel;
363 h677 1.514 SelectTimer: TTimer;
364 h677 1.340 SelectThreadSave: TMenuItem;
365 h677 1.342 N55: TMenuItem;
366 h677 1.343 N66: TMenuItem;
367     dat1: TMenuItem;
368 yoffy 1.397 OpenLogFolder: TMenuItem;
369 h677 1.346 Browser: TWebBrowser;
370 genyakun 1.353 TabSave: TMenuItem;
371 h677 1.407 TabOpen: TMenuItem;
372 yoffy 1.375 ResRangePopupMenu: TPopupMenu;
373 h677 1.547 ResRangeHundPMenuItem: TMenuItem;
374     ResRangeKokoPMenuItem: TMenuItem;
375     ResRangeNewPMenuItem: TMenuItem;
376     ResRangeAllPMenuItem: TMenuItem;
377 h677 1.386 BrowsBoradHeadAction1: TMenuItem;
378 yoffy 1.390 ThreadRangePopupMenu: TPopupMenu;
379     A15: TMenuItem;
380     L8: TMenuItem;
381 h677 1.542 N67: TMenuItem;
382 yoffy 1.390 N68: TMenuItem;
383     S6: TMenuItem;
384     N69: TMenuItem;
385 h677 1.547 ResRangeSelectPMenuItem: TMenuItem;
386 yoffy 1.415 ListColumnPopupMenu: TPopupMenu;
387 h677 1.485 N70: TMenuItem;
388     ID1: TMenuItem;
389     ID2: TMenuItem;
390     N53: TMenuItem;
391     ID3: TMenuItem;
392     N71: TMenuItem;
393 h677 1.487 N72: TMenuItem;
394     N73: TMenuItem;
395 h677 1.517 SelectComboBoxPanel: TPanel;
396     SelectComboBoxSplitter: TImage;
397     ToolButton1: TToolButton;
398     N74: TMenuItem;
399 genyakun 1.527 WikiFAQ: TMenuItem;
400 h677 1.542 GikoApplicationEvents: TApplicationEvents;
401 yoffy 1.251 procedure FormCreate(Sender: TObject);
402 hi_ 1.1 procedure FormDestroy(Sender: TObject);
403     procedure BrowserStatusTextChange(Sender: TObject;
404     const Text: WideString);
405     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
406     procedure TreeViewChanging(Sender: TObject; Node: TTreeNode;
407     var AllowChange: Boolean);
408     procedure ListViewKeyDown(Sender: TObject; var Key: Word;
409     Shift: TShiftState);
410     procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
411     procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
412     Button: TToolButton; State: TCustomDrawState;
413     var DefaultDraw: Boolean);
414     procedure BrowserBeforeNavigate2(Sender: TObject;
415     const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
416     Headers: OleVariant; var Cancel: WordBool);
417     procedure TreeViewCustomDraw(Sender: TCustomTreeView;
418     const ARect: TRect; var DefaultDraw: Boolean);
419     procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
420     Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
421     procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
422     procedure TreeViewDblClick(Sender: TObject);
423     procedure ListViewCustomDraw(Sender: TCustomListView;
424     const ARect: TRect; var DefaultDraw: Boolean);
425     procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
426     Shift: TShiftState; X, Y: Integer);
427     procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
428     procedure MessageListViewResize(Sender: TObject);
429 yoffy 1.138 procedure CabinetVisible( isVisible : Boolean );
430 hi_ 1.1 procedure FormResize(Sender: TObject);
431     procedure ListPopupMenuPopup(Sender: TObject);
432     procedure TreePopupMenuPopup(Sender: TObject);
433     procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
434     var Cancel: WordBool);
435     procedure ListSplitterMoved(Sender: TObject);
436     procedure BrowserTabChange(Sender: TObject);
437     procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
438     Shift: TShiftState; X, Y: Integer);
439     procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer;
440     State: TDragState; var Accept: Boolean);
441     procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer);
442     procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X,
443     Y: Integer);
444     procedure BrowserDocumentComplete(Sender: TObject;
445     const pDisp: IDispatch; var URL: OleVariant);
446     procedure RoundNamePopupMenuPopup(Sender: TObject);
447     procedure FormShow(Sender: TObject);
448     procedure BrowserTabToolBarResize(Sender: TObject);
449     procedure FavoriteMenuClick(Sender: TObject);
450 yoffy 1.2 procedure MainCoolBarResize(Sender: TObject);
451     procedure AddressToolBarResize(Sender: TObject);
452 hi_ 1.1 procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
453     Shift: TShiftState);
454 yoffy 1.2 procedure BrowserEnter(Sender: TObject);
455 hi_ 1.1 procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
456     procedure PreviewTimerTimer(Sender: TObject);
457     procedure MessageHideButtonClick(Sender: TObject);
458 h677 1.541 procedure HistoryAllClearToolButtonClick(Sender: TObject);
459 yoffy 1.2 procedure MainCoolBarBandInfo(Sender: TObject;
460     var BandInfo: PReBarBandInfoA);
461     procedure MainCoolBarChevronClick(Sender: TObject;
462 yoffy 1.51 RebarChevron: PNMRebarChevron);
463     procedure ListCoolBarBandInfo(Sender: TObject;
464     var BandInfo: PReBarBandInfoA);
465     procedure ListCoolBarChevronClick(Sender: TObject;
466     RebarChevron: PNMRebarChevron);
467     procedure BrowserCoolBarBandInfo(Sender: TObject;
468     var BandInfo: PReBarBandInfoA);
469 yoffy 1.2 procedure BrowserCoolBarChevronClick(Sender: TObject;
470 yoffy 1.51 RebarChevron: PNMRebarChevron);
471     procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
472     procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
473     WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
474     procedure SelectComboBoxChange(Sender: TObject);
475     procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
476     Shift: TShiftState);
477     procedure SelectComboBoxExit(Sender: TObject);
478     procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
479     Shift: TShiftState; X, Y: Integer);
480     procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
481     Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
482     procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
483     Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
484     procedure StatusBarResize(Sender: TObject);
485     procedure SelectComboBoxEnter(Sender: TObject);
486 yoffy 1.100 procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X,
487     Y: Integer);
488 yoffy 1.71 procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
489 yoffy 1.100 procedure FavoriteTreeViewEdited(Sender: TObject; Node: TTreeNode;
490     var S: String);
491     procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
492     Shift: TShiftState);
493     procedure FavoriteTreePopupMenuPopup(Sender: TObject);
494     procedure FavoriteTreeViewDblClick(Sender: TObject);
495     procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer);
496     procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton;
497     Shift: TShiftState; X, Y: Integer);
498     procedure LinkToolBarDragOver(Sender, Source: TObject; X, Y: Integer;
499     State: TDragState; var Accept: Boolean);
500     procedure FavoriteTreeViewEndDrag(Sender, Target: TObject; X,
501     Y: Integer);
502     procedure ListCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
503     var Handled: Boolean);
504     procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
505     var Handled: Boolean);
506     procedure BrowserCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
507     var Handled: Boolean);
508 yoffy 1.142 procedure FavoriteTreeBrowseBoardPopupMenuClick(Sender: TObject);
509 h677 1.174 procedure BrowserTabContextPopup(Sender: TObject; MousePos: TPoint;
510     var Handled: Boolean);
511 h677 1.187 procedure BrowserTabPopupMenuPopup(Sender: TObject);
512 yoffy 1.216 procedure BrowserTabResize(Sender: TObject);
513 h677 1.318 procedure TreeViewClick(Sender: TObject);
514 yoffy 1.236 procedure TreeViewKeyDown(Sender: TObject; var Key: Word;
515     Shift: TShiftState);
516 yoffy 1.246 procedure FavoriteTreeViewMouseDown(Sender: TObject;
517 yoffy 1.248 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
518 yoffy 1.250 procedure MessagePanelResize(Sender: TObject);
519 yoffy 1.276 procedure OnResized;
520 yoffy 1.260 procedure FavoriteTreeViewMouseUp(Sender: TObject;
521 h677 1.532 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
522 h677 1.539 procedure SelectTimerTimer(Sender: TObject);
523 yoffy 1.425 procedure ListViewColumnRightClick(Sender: TObject;
524 yoffy 1.415 Column: TListColumn; Point: TPoint);
525 h677 1.478 procedure ListViewCustomDrawItem(Sender: TCustomListView;
526 h677 1.463 Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
527     procedure FormActivate(Sender: TObject);
528 h677 1.472 procedure BrowserPanelResize(Sender: TObject);
529 h677 1.482 procedure MenuToolBarResize(Sender: TObject);
530     procedure ListToolBarResize(Sender: TObject);
531     procedure BrowserToolBarResize(Sender: TObject);
532 h677 1.539 procedure KokoPopupMenuPopup(Sender: TObject);
533 h677 1.517 procedure ListViewKeyUp(Sender: TObject; var Key: Word;
534     Shift: TShiftState);
535     procedure FavoriteTreeViewEditing(Sender: TObject; Node: TTreeNode;
536     var AllowEdit: Boolean);
537 h677 1.541 procedure CabinetCloseSpeedButtonClick(Sender: TObject);
538     procedure FavoriteArrangeToolButtonClick(Sender: TObject);
539 h677 1.542 procedure GikoApplicationEventsMessage(var Msg: tagMSG;
540     var Handled: Boolean);
541     procedure GikoApplicationEventsDeactivate(Sender: TObject);
542     procedure GikoApplicationEventsException(Sender: TObject; E: Exception);
543 h677 1.548 procedure FavoriteTreeViewClick(Sender: TObject);
544     procedure FavoriteTreeViewCollapsing(Sender: TObject; Node: TTreeNode;
545     var AllowCollapse: Boolean);
546     procedure FavoriteTreeViewExpanding(Sender: TObject; Node: TTreeNode;
547     var AllowExpansion: Boolean);
548     procedure TreeViewCollapsing(Sender: TObject; Node: TTreeNode;
549     var AllowCollapse: Boolean);
550     procedure TreeViewExpanding(Sender: TObject; Node: TTreeNode;
551     var AllowExpansion: Boolean);
552     procedure TreeViewMouseUp(Sender: TObject; Button: TMouseButton;
553     Shift: TShiftState; X, Y: Integer);
554 hi_ 1.1 private
555     { Private 鐃緒申鐃緒申 }
556     FSortIndex: Integer;
557     FSortOrder: Boolean;
558     FEnabledCloseButton: Boolean;
559     FClickNode: TTreeNode;
560     FHttpState: Boolean;
561     FHint: TResPopup;
562 h677 1.453 FPreviewBrowser: TWebBrowser;
563 hi_ 1.1 FPreviewURL: string;
564     FBrowserSizeHeight: Integer;
565     FBrowserSizeWidth: Integer;
566     FTabHintIndex: Integer;
567     FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
568     FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?
569     FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?
570 h677 1.517 FActiveList: TObject;
571 h677 1.299 FActiveContent: TBrowserRecord; //
572 yoffy 1.133 FActiveBBS : TBBS;
573 hi_ 1.1 FHistoryList: TList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
574     FTreeType: TGikoTreeType;
575     FWorkCount: Integer;
576     FNameCookie: string;
577     FMailCookie: string;
578     FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
579     FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?
580     FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?
581 yoffy 1.51 IsDraggingSelectComboBox : Boolean;
582     DraggingSelectComboBoxPosition : TPoint;
583 yoffy 1.54 FSearchDialog: TSearchDialog;
584 yoffy 1.100 FDropSpaceNode: TTreeNode;
585 yoffy 1.424 FDragTime : Cardinal; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?
586     FDragButton : TToolButton; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?鐃緒申Drag鐃緒申鐃緒申鐃緒申Button鐃緒申鐃緒申
587     FDragWFirst : Boolean; ///< WebTab鐃緒申D&D鐃?
588     FListViewBackGroundColor : TColor; ///< ListView鐃緒申BackGroundColor
589     FUseOddResOddColor : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申
590     FOddColor : TColor; ///< 鐃緒申鐃緒申鐃?
591     FSelectResWord : string; ///< 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
592     FIsIgnoreResize : TResizeType; ///< 鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
593     FIsMinimize : TMinimizeType; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
594     FOldFormWidth : Integer; ///< 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
595     FToolBarSettingSender : TToolBarSettingSenderType; ///< 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
596     FMouseDownPos : TPoint; ///< 鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
597 h677 1.303 FBrowsers: TList;
598 yoffy 1.424 FResRangeMenuSelect : Longint; ///< ResRangeButton 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 (鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申 ResRange 鐃緒申鐃緒申)
599 h677 1.423 FStartUp : Boolean;
600 yoffy 1.427 FIsHandledWheel : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 WM_MOUSEWHEEL 鐃緒申鐃緒申鐃緒申鐃緒申
601 h677 1.517 DiffComp: Boolean; //Add by Genyakun 鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申True鐃緒申鐃緒申鐃緒申
602 h677 1.548 FOrigenCaption: String; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
603 hi_ 1.1 procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
604     procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
605 q9_ 1.233 procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
606 hi_ 1.1 procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
607     procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
608     procedure ListClick;
609 h677 1.295 procedure ListDoubleClick(Shift: TShiftState);
610 hi_ 1.1 function Hook(var Message: TMessage): Boolean;
611     procedure AddRoundNameMenu(MenuItem: TMenuItem);
612     procedure SetMenuFont;
613     procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
614 yoffy 1.62 procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload;
615     procedure FavoriteClick(Sender: TObject); overload;
616 yoffy 1.100 procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
617 hi_ 1.1 function OnDocumentContextMenu(Sender: TObject): WordBool;
618     procedure ShowTextPopup;
619     function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
620 yoffy 1.2 procedure MenuBarChevronMenu;
621     procedure LinkBarChevronMenu;
622     procedure ToolBarChevronMenu(ToolBar: TToolBar);
623 yoffy 1.100 procedure LinkToolButtonDragDrop(Sender, Source: TObject; X, Y: Integer);
624     procedure LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
625     procedure LinkToolButtonOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
626     procedure LinkToolButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
627 yoffy 1.85 procedure LinkToolButtonStartDrag(Sender: TObject; var DragObject: TDragObject);
628 yoffy 1.72 function TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode;
629 yoffy 1.100 procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );
630     procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject );
631 yoffy 1.72 procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject );
632 yoffy 1.236 //
633 yoffy 1.143 procedure SetListViewBackGroundColor(value: TColor);
634 yoffy 1.123 procedure BBSMenuItemOnClick( Sender : TObject );
635 yoffy 1.424 /// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
636 yoffy 1.216 procedure SaveCoolBarSettings;
637 h677 1.471 procedure SaveMainCoolBarSettings;
638     procedure SaveBoardCoolBarSettings;
639     procedure SaveBrowserCoolBarSettings;
640 yoffy 1.424 /// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
641 yoffy 1.216 procedure LoadCoolBarSettings;
642 yoffy 1.424 /// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
643 yoffy 1.276 procedure OnMinimize;
644 yoffy 1.424 /// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
645 yoffy 1.248 procedure OnMinimized;
646 yoffy 1.424 /// TreeView 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
647 yoffy 1.236 procedure TreeClick( Node : TTreeNode );
648 yoffy 1.424 /// TreeView 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
649 yoffy 1.236 procedure TreeDoubleClick( Node : TTreeNode );
650 yoffy 1.424 /// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
651 yoffy 1.289 procedure SetBBSMenu;
652 yoffy 1.424 /// 鐃?鐃?鐃緒申鐃緒申
653 yoffy 1.397 function GetTabURLs(AStringList: TStringList) : Boolean;
654 yoffy 1.415 /// ListColumnPopupMenu 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
655     procedure ListColumnPopupMenuOnClick( Sender : TObject );
656 yoffy 1.480 //! 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
657     procedure SetSelectWord( const text : string );
658 h677 1.535 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
659     function GetScreenCursor(): TCursor;
660     //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
661     procedure SetScreenCursor(Cursor : TCursor);
662 h677 1.547 //! 鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
663     procedure InitActionChecked();
664 h677 1.550 //! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
665     procedure CreateControlThread();
666     //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
667     procedure CreateBrowsers(count: Integer);
668 hi_ 1.1 protected
669     procedure CreateParams(var Params: TCreateParams); override;
670 yoffy 1.2 procedure WndProc(var Message: TMessage); override;
671 hi_ 1.1 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
672     procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
673     procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
674 yoffy 1.216
675 hi_ 1.1 public
676     { Public 鐃緒申鐃緒申 }
677 h677 1.533 LastRoundTime: TDateTime;
678     BrowserNullTab: TBrowserRecord;
679 hi_ 1.1 FControlThread: TThreadControl;
680 yoffy 1.444 procedure MoveToURL(const inURL: string);
681 h677 1.530 function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
682 hi_ 1.1 procedure ReloadBBS;
683     function GetHttpState: Boolean;
684     procedure SetEnabledCloseButton(Enabled: Boolean);
685     function GetTreeNode(Data: TObject): TTreeNode;
686     procedure ListViewAllSelect;
687     property ListStyle: TViewStyle read FListStyle write FListStyle;
688     property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
689     property ViewType: TGikoViewType read FViewType write FViewType;
690     property NameCookie: string read FNameCookie write FNameCookie;
691     property MailCookie: string read FMailCookie write FMailCookie;
692 h677 1.532 property ClickNode: TTreeNode read FClickNode write FClickNode;
693 h677 1.538 property TreeType: TGikoTreeType read FTreeType write FTreeType;
694 h677 1.534 property ActiveContent: TBrowserRecord read FActiveContent write FActiveContent;
695 h677 1.533 property ResRangeMenuSelect: Longint read FResRangeMenuSelect write FResRangeMenuSelect;
696 h677 1.534 property SelectResWord : string read FSelectResWord write FSelectResWord;
697     property BrowserSizeWidth: Integer read FBrowserSizeWidth write FBrowserSizeWidth;
698     property BrowserSizeHeight: Integer read FBrowserSizeHeight write FBrowserSizeHeight;
699     property SearchDialog: TSearchDialog read FSearchDialog write FSearchDialog;
700     property ToolBarSettingSender : TToolBarSettingSenderType
701     read FToolBarSettingSender write FToolBarSettingSender;
702 h677 1.535 property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
703 h677 1.537 property SortIndex: Integer read FSortIndex write FSortIndex;
704     property SortOrder: Boolean read FSortOrder write FSortOrder;
705 h677 1.538 property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
706     property WorkCount: Integer read FWorkCount write FWorkCount;
707 h677 1.299 procedure SetContent(inThread: TBrowserRecord);
708 hi_ 1.1 function GetActiveContent: TThreadItem;
709     function GetActiveList: TObject;
710 h677 1.533
711 hi_ 1.1 procedure SetListViewType(AViewType: TGikoViewType); overload;
712     procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
713     procedure PlaySound(SoundEventName: string);
714 yoffy 1.136 function AddHistory( FavItem: TFavoriteThreadItem ): Boolean;
715 hi_ 1.1 procedure ClearHistory;
716 yoffy 1.135 procedure SaveHistory;
717     procedure LoadHistory;
718 yoffy 1.123 procedure ShowBBSTree( inBBS : TBBS );
719 yoffy 1.248 procedure ShowBBSTreeOld( inBBS : TBBS );
720 hi_ 1.1 procedure ShowHistoryTree;
721     procedure SetHistoryTreeNode;
722     procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
723     procedure SetBrowserTabState;
724 yoffy 1.2 procedure SetToolBarPopup;
725 yoffy 1.100 procedure ShowFavoriteAddDialog( Item : TObject );
726 h677 1.433 procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList);
727     procedure RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList);
728 yoffy 1.143 property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
729     property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
730     property OddColor : TColor read FOddColor write FOddColor;
731 yoffy 1.209 function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
732 yoffy 1.218 procedure OnPlugInMenuItem( Sender : TObject );
733 h677 1.433 procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
734     /// ListView 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申 KuroutSetting鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
735     procedure ActiveListColumnSave;
736     procedure SetActiveList(Obj: TObject);
737     property ActiveList: TObject read GetActiveList write SetActiveList;
738 h677 1.482 /// CoolBar 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
739     procedure CoolBarResized(Sender: TObject; CoolBar: TCoolBar);
740 h677 1.485 //鐃緒申鐃緒申ID鐃緒申鐃緒申鐃緒申鐃?鐃緒申
741     procedure IndividualAbonID(Atype : Integer);
742     //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申
743     procedure IndividualAbon(Atag, Atype : Integer);
744 h677 1.532 //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申 true:鐃?鐃緒申鐃緒申鐃?鐃? false:鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
745     procedure RepaintAllTabsBrowser();
746     //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
747     procedure SetLinkBar;
748     procedure FavoriteBrowseFolder( node: TTreeNode );
749     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
750     procedure DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False);
751     //鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?
752     procedure DownloadList(Board: TBoard; ForceDownload: Boolean = False);
753     //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
754     procedure DeleteHistory( threadItem: TThreadItem );
755     //鐃?鐃?鐃緒申鐃緒申鐃緒申
756     procedure DeleteTab(ThreadItem: TThreadItem); overload;
757 h677 1.533 procedure DeleteTab(BrowserRecord: TBrowserRecord); overload;
758     //鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
759 h677 1.552 procedure BrowserMovement(const AName: string);
760 h677 1.533 //Application鐃緒申MainForm鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
761 h677 1.534 function GetMainForm(): TComponent;
762 h677 1.533 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
763 h677 1.534 //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?
764     procedure OnGestureStart(Sender: TObject);
765     //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申
766     procedure OnGestureMove(Sender: TObject);
767     //! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
768     procedure OnGestureEnd(Sender: TObject);
769     /// 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
770     procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar );
771 h677 1.535 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃緒申
772     function EditorFormExists(): boolean;
773     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
774     procedure AllEditroFormNameTextClearClear();
775     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
776     procedure AllEditroFormMailTextClearClear();
777     //ListView鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
778     procedure SelectListItem(List: TList);
779     /// 鐃?鐃?鐃緒申鐃緒申
780     function SaveTabURLs : Boolean;
781     /// 鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申
782     function LoadTabURLs : Boolean;
783 h677 1.536 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
784     procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean);
785 h677 1.537 //
786     procedure ModifySelectList;
787     //
788     procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload;
789     //
790     procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload;
791 h677 1.538 //
792 h677 1.537 procedure SetSelectRoundName(Sender: TObject);
793 h677 1.538 //
794     function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
795     //
796     function WebBrowserClick(Sender: TObject): WordBool;
797 h677 1.550 //! 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
798     procedure SetSelectComboBox();
799 hi_ 1.1 published
800     property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
801     end;
802    
803     TFavoriteMenuItem = class(TMenuItem)
804     private
805     FData : Pointer;
806     public
807     property Data: Pointer read FData write FData;
808     end;
809    
810 yoffy 1.123 TBBSMenuItem = class(TMenuItem)
811     private
812     FData : Pointer;
813     public
814     property Data: Pointer read FData write FData;
815     end;
816    
817 hi_ 1.1 TLinkToolButton = class(TToolButton)
818     private
819     FData : Pointer;
820     public
821     property Data: Pointer read FData write FData;
822     end;
823    
824     var
825     GikoForm: TGikoForm;
826    
827     implementation
828    
829     uses
830 h677 1.536 GikoUtil, IndividualAbon, Math, Kotehan, KeySetting,
831     YofUtils, ShellAPI, ToolBarUtil, ToolBarSetting,
832     GikoXMLDoc, RoundName, IniFiles, FavoriteAdd,
833 h677 1.542 FavoriteArrange, AddressHistory, Preview, Gesture,
834 yoffy 1.480 About, Option, Round, Splash, Sort, ListSelect, Imm,
835 h677 1.521 NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter,
836 h677 1.532 HTMLCreate, ListViewUtils, GikoDataModule;
837 hi_ 1.1
838     const
839     BLANK_HTML: string = 'about:blank';
840 h677 1.542 BROWSER_COUNT = 5; //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申
841     //D&D鐃緒申鐃?
842     DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel)
843     //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
844     HTML_FILE_NAME = 'temp_preview.html';
845     ITEM_ICON_THREADLOG1 = 6; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
846     ITEM_ICON_THREADLOG2 = 7; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
847     //鐃緒申鐃?鐃?鐃?鐃?ID
848 yoffy 1.278 USER_TREECLICK = WM_USER + 2000;
849     USER_RESIZED = WM_USER + 2001;
850     USER_MINIMIZED = WM_USER + 2002;
851     USER_SETLINKBAR = WM_USER + 2003;
852 yoffy 1.434 USER_DOCUMENTCOMPLETE = WM_USER + 2004; ///< wParam : TWebBrowser
853 hi_ 1.1 {$R *.DFM}
854    
855     procedure TGikoForm.CreateParams(var Params: TCreateParams);
856     begin
857     inherited;
858     if FormStyle in [fsNormal, fsStayOnTop] then begin
859     if BorderStyle in [bsSingle, bsSizeable] then begin
860     Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
861     Params.WndParent := 0;
862     end;
863     end;
864     end;
865    
866     procedure TGikoForm.FormCreate(Sender: TObject);
867     const
868     TVS_NOTOOLTIPS = $0080;
869     var
870     FileName: string;
871     Style: DWORD;
872     msg: string;
873     i: Integer;
874     wp: TWindowPlacement;
875 hi_ 1.32 s: string;
876 hi_ 1.1 begin
877     {$IFDEF DEBUG}
878     AllocConsole;
879     Writeln('============================================================');
880     Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
881     Writeln('');
882     Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
883     Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
884     Writeln('============================================================');
885     {$ENDIF}
886 h677 1.514 FTreeType := gttNone;
887     // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
888 h677 1.471 FStartUp := true;
889 hi_ 1.1 Application.HookMainWindow(Hook);
890 h677 1.514 FIsIgnoreResize := rtResizing;
891 hi_ 1.1
892 yoffy 1.51 FSearchDialog := nil;
893 h677 1.550 CreateBrowsers(BROWSER_COUNT);
894 h677 1.303
895 h677 1.514 //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
896     SetMenuFont;
897 yoffy 1.216
898 hi_ 1.1 //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
899     Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
900    
901     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
902 h677 1.513 //AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
903     AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
904 hi_ 1.1
905     EnabledCloseButton := True;
906 h677 1.176
907 hi_ 1.1 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
908     ListView.ViewStyle := GikoSys.Setting.ListStyle;
909    
910     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
911     AnimePanel.Top := 0;
912     AnimePanel.Left := 0;
913    
914     //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
915    
916     //鐃?鐃緒申鐃?鐃?鐃?鐃?
917     CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
918    
919     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
920 h677 1.539 GikoDM.MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
921     GikoDM.MsgBarVisibleActionExecute(nil);
922 hi_ 1.1 MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
923    
924     //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
925 h677 1.539 GikoDM.StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
926     GikoDM.StatusBarVisibleActionExecute(nil);
927 hi_ 1.1
928     //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
929     TreeView.Items.BeginUpdate;
930 yoffy 1.100 FavoriteTreeView.Items.BeginUpdate;
931 hi_ 1.1 ListView.Items.BeginUpdate;
932     try
933     TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
934     TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
935     TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
936     TreeView.Color := GikoSys.Setting.CabinetBackColor;
937 h677 1.473 FavoriteTreeView.Font.Assign(TreeView.Font);
938 yoffy 1.67 FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
939    
940 hi_ 1.1 ListView.Font.Name := GikoSys.Setting.ListFontName;
941     ListView.Font.Size := GikoSys.Setting.ListFontSize;
942     ListView.Font.Color := GikoSys.Setting.ListFontColor;
943 h677 1.473 ListView.Font.Style := [];
944     if GikoSys.Setting.ListFontBold then
945     ListView.Font.Style := [fsbold];
946     if GikoSys.Setting.ListFontItalic then
947     ListView.Font.Style := ListView.Font.Style + [fsitalic];
948    
949 yoffy 1.418 ListViewBackGroundColor := clWhite; // 鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
950     ListViewBackGroundColor := GikoSys.Setting.ListBackColor; // 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
951 yoffy 1.236 FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
952     FOddColor := GikoSys.Setting.OddColor;
953 h677 1.109
954 hi_ 1.1 finally
955     TreeView.Items.EndUpdate;
956 yoffy 1.100 FavoriteTreeView.Items.EndUpdate;
957 hi_ 1.1 ListView.Items.EndUpdate;
958     end;
959     //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
960 h677 1.539 GikoDM.ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
961 hi_ 1.1
962     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
963     BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
964     BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
965 h677 1.473 BrowserTab.Font.Style := [];
966     if GikoSys.Setting.BrowserTabFontBold then
967     BrowserTab.Font.Style := [fsBold];
968     if GikoSys.Setting.BrowserTabFontItalic then
969     BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic];
970 yoffy 1.133 FDragWFirst := false;
971 h677 1.299 SetContent(BrowserNullTab); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
972    
973 h677 1.514 //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
974     ProgressBar.Parent := StatusBar;
975     ProgressBar.Top := 2;
976     ProgressBar.Left := 0;
977     ProgressBar.Width := StatusBar.Panels[0].Width;
978     ProgressBar.Height := StatusBar.Height - 2;
979     ProgressBar.Position := 0;
980    
981     // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
982     InitializeBoardPlugIns;
983    
984     // 鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申(ReadFavorite 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
985     GikoSys.ListBoardFile;
986    
987     // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
988     SplashWindow.ProgressBar.Max := Length(BBSs) * 20;
989    
990     // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
991     for i := Length(BBSs) - 1 downto 0 do begin
992     if not BBSs[i].IsBoardFileRead then
993     GikoSys.ReadBoardFile(BBSs[i]);
994    
995     if SplashWindow <> nil then begin
996     SplashWindow.ProgressBar.StepBy(20);
997     SplashWindow.Update;
998     end;
999     end;
1000     //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1001     RoundList := TRoundList.Create;
1002     RoundList.LoadRoundBoardFile;
1003     RoundList.LoadRoundThreadFile;
1004    
1005     //TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申
1006     Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
1007     Style := Style or TVS_NOTOOLTIPS;
1008     SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
1009    
1010     // 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1011     TreeView.Align := alClient;
1012     FavoriteTreeView.Align := alClient;
1013     FavoriteTreeView.Visible := False;
1014    
1015     // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1016     SetBBSMenu;
1017 hi_ 1.1
1018     //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1019     wp.length := sizeof(wp);
1020     wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1021     wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1022     wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1023     wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1024     wp.showCmd := SW_HIDE;
1025     SetWindowPlacement(Handle, @wp);
1026 h677 1.514 //Self.Update;
1027 hi_ 1.1
1028     if GikoSys.Setting.WindowMax then
1029 h677 1.514 WindowState := wsMaximized;
1030 hi_ 1.1
1031     //鐃?鐃?鐃?鐃?鐃緒申
1032     try
1033     FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1034     if FileExists(FileName) then
1035     Animate.FileName := FileName;
1036     except
1037     end;
1038    
1039     //鐃?鐃?鐃?鐃?
1040     FNameCookie := '';
1041     FMailCookie := '';
1042    
1043     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1044     FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1045     FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1046    
1047 yoffy 1.420
1048     // 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?(LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1049     FHistoryList := TList.Create;
1050    
1051     // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1052     LoadHistory;
1053    
1054     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1055     FavoriteDM.SetFavTreeView(FavoriteTreeView);
1056     FavoriteDM.ReadFavorite;
1057    
1058 h677 1.539 GikoDM.ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1059     GikoDM.ArrangeAction.Execute;
1060 hi_ 1.1
1061     if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1062     case GikoSys.Setting.ListWidthState of
1063     glsMax: begin
1064     ViewPanel.Width := 1;
1065 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1066     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1067 hi_ 1.1 end;
1068     glsMin: begin
1069     ViewPanel.Width := GikoSys.Setting.ListWidth;
1070 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1071     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1072 hi_ 1.1 end;
1073     else begin
1074     ViewPanel.Width := GikoSys.Setting.ListWidth;
1075 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1076     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1077 hi_ 1.1 end;
1078     end;
1079     end else begin
1080     case GikoSys.Setting.ListHeightState of
1081     glsMax: begin
1082     ViewPanel.Height := 1;
1083 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1084     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1085 hi_ 1.1 end;
1086     glsMin: begin
1087     ViewPanel.Height := GikoSys.Setting.ListHeight;
1088 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1089     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1090 hi_ 1.1 end;
1091     else begin
1092     ViewPanel.Height := GikoSys.Setting.ListHeight;
1093 h677 1.558 GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1094     GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1095 hi_ 1.1 end;
1096     end;
1097     end;
1098    
1099     //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1100 h677 1.550 CreateControlThread();
1101 hi_ 1.1
1102 yoffy 1.51 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1103     SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1104 yoffy 1.2
1105 hi_ 1.1 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1106     SetBrowserTabState;
1107    
1108     BrowserBoardNameLabel.Caption := '';
1109     BrowserNameLabel.Caption := '';
1110     FWorkCount := 0;
1111    
1112     FTabHintIndex := -1;
1113    
1114     //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1115     ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1116     BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1117    
1118 yoffy 1.236 MakeDefaultINIFile();
1119 yoffy 1.2 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1120 h677 1.539 ReadToolBarSetting(GikoDM.GikoFormActionList, StdToolBar);
1121     ReadToolBarSetting(GikoDM.GikoFormActionList, ListToolBar);
1122     ReadToolBarSetting(GikoDM.GikoFormActionList, BrowserToolBar);
1123 yoffy 1.2 SetToolBarPopup;
1124 yoffy 1.375
1125 h677 1.517 //ListToolBar鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申ComboBox鐃緒申鐃?鐃?
1126 h677 1.550 SetSelectComboBox();
1127 h677 1.514
1128     //鐃?鐃?鐃緒申鐃?鐃?鐃?
1129     AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1130    
1131     //鐃緒申鐃緒申鐃?鐃?鐃?
1132     SetLinkBar;
1133 yoffy 1.2 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1134    
1135     //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1136     if not FileExists(GikoSys.GetBoardFileName) then begin
1137     msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1138     + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1139     + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1140     MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1141 h677 1.539 GikoDM.NewBoardAction.Execute;
1142 yoffy 1.2 end;
1143    
1144     //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1145 h677 1.539 GikoSys.LoadKeySetting(GikoDM.GikoFormActionList);
1146 yoffy 1.2
1147     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1148     // FLastRoundTime := 0;
1149    
1150     //ResHint
1151     FHint := TResPopup.Create(Self);
1152    
1153 h677 1.547 ListView.OnData := TListViewUtils.ListViewData;
1154 h677 1.529
1155 yoffy 1.100 // 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1156 h677 1.299 CabinetVisible( False );
1157 yoffy 1.141 if GikoSys.Setting.CabinetVisible then begin
1158     i := CabinetSelectPopupMenu.Items.Count - 1;
1159     if GikoSys.Setting.CabinetIndex = i - 1 then
1160 h677 1.539 GikoDM.CabinetHistoryAction.Execute
1161 yoffy 1.141 else if GikoSys.Setting.CabinetIndex = i then
1162 h677 1.539 GikoDM.CabinetFavoriteAction.Execute
1163 yoffy 1.141 else begin
1164     if GikoSys.Setting.CabinetIndex < Length( BBSs ) then
1165     ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] );
1166 yoffy 1.265 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 2
1167 yoffy 1.424 FIsIgnoreResize := rtResizing;
1168 h677 1.539 GikoDM.CabinetBBSAction.Execute;
1169 yoffy 1.141 end;
1170     end else begin
1171 yoffy 1.248 ShowBBSTreeOld( BBSs[ 0 ] );
1172     PostMessage( Handle, USER_TREECLICK, 0, 0 );
1173 yoffy 1.141 end;
1174 yoffy 1.67
1175 yoffy 1.2 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1176     for i := 1 to ParamCount do begin
1177     MoveToURL(ParamStr(i));
1178     end;
1179 h677 1.22
1180 hi_ 1.32 s := GikoSys.FAbon.NGwordname;
1181     StatusBar.Panels[2].Text := s;
1182     StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
1183     StatusBarResize(Sender);
1184 h677 1.187
1185 yoffy 1.236 dummy1.Caption := ItemReservPMenu.Caption;
1186     dummy1.Hint := ItemReservPMenu.Hint;
1187 yoffy 1.216
1188 yoffy 1.236 //Samba24鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?
1189     GikoSys.SambaFileExists();
1190 h677 1.299
1191 yoffy 1.500 {$IFDEF SPAM_FILTER_ENABLED}
1192 yoffy 1.468 // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1193     GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
1194 yoffy 1.500 {$ENDIF}
1195 yoffy 1.468
1196 yoffy 1.456 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1197     MouseGesture := TMouseGesture.Create;
1198     GikoSys.Setting.Gestures.LoadGesture(
1199 h677 1.539 GikoSys.Setting.GetGestureFileName, GikoDM.GikoFormActionList );
1200 yoffy 1.456 MouseGesture.Margin := GikoSys.Setting.Gestures.Margin;
1201     MouseGesture.OnGestureStart := OnGestureStart;
1202     MouseGesture.OnGestureMove := OnGestureMove;
1203     MouseGesture.OnGestureEnd := OnGestureEnd;
1204 yoffy 1.457 if GikoSys.Setting.GestureEnabled then
1205     MouseGesture.SetHook( Handle );
1206 genyakun 1.458
1207 h677 1.483 //2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1208 h677 1.514 GikoSys.Setting.SetMessages;
1209    
1210 genyakun 1.497 //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1211     if GikoSys.Setting.AutoLogin then
1212 h677 1.539 GikoDM.LoginAction.Execute;
1213 genyakun 1.497
1214 h677 1.514 GikoSys.Setting.BeLogin := GikoSys.Setting.BeAutoLogin;
1215 h677 1.541
1216     //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1217     FavoriteAddToolButton.Caption := '鐃緒申鐃緒申...';
1218 h677 1.547 AntiIndivAbonMenuItem.Caption := '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申';
1219 h677 1.541
1220 yoffy 1.2 end;
1221    
1222 yoffy 1.216 // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1223     procedure TGikoForm.SaveCoolBarSettings;
1224 yoffy 1.2 begin
1225    
1226 yoffy 1.424 if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then
1227 yoffy 1.216 Exit;
1228 h677 1.471 SaveMainCoolBarSettings;
1229     SaveBoardCoolBarSettings;
1230     SaveBrowserCoolBarSettings;
1231 yoffy 1.2
1232 h677 1.471 end;
1233     procedure TGikoForm.SaveMainCoolBarSettings;
1234     var
1235     i : Integer;
1236     CoolSet : TCoolSet;
1237     begin
1238 yoffy 1.216 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1239     for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1240     CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1241     CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1242     CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1243     GikoSys.Setting.MainCoolSet[i] := CoolSet;
1244     end;
1245 h677 1.471 end;
1246     procedure TGikoForm.SaveBoardCoolBarSettings;
1247     var
1248     i : Integer;
1249     CoolSet : TCoolSet;
1250     begin
1251 yoffy 1.216 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1252     for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1253     CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1254     CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1255     CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1256     GikoSys.Setting.ListCoolSet[i] := CoolSet;
1257     end;
1258 h677 1.471 end;
1259     procedure TGikoForm.SaveBrowserCoolBarSettings;
1260     var
1261     i : Integer;
1262     CoolSet : TCoolSet;
1263     begin
1264 yoffy 1.216 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1265     for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1266     CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1267     CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1268     CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1269     GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1270 yoffy 1.2 end;
1271 yoffy 1.216 end;
1272     // CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1273     procedure TGikoForm.LoadCoolBarSettings;
1274     var
1275     i : Integer;
1276     CoolSet : TCoolSet;
1277     begin
1278 yoffy 1.2
1279 hi_ 1.1 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1280     MainCoolBar.Bands.BeginUpdate;
1281     try
1282 yoffy 1.216 // for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1283     for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin
1284 hi_ 1.1 CoolSet := GikoSys.Setting.MainCoolSet[i];
1285 yoffy 1.263 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1286 yoffy 1.424 FIsIgnoreResize := rtNone;
1287 yoffy 1.263 SaveCoolBarSettings;
1288     Exit;
1289     end;
1290 hi_ 1.1 MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1291     MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1292 yoffy 1.264 MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1293 hi_ 1.1 end;
1294     finally
1295     MainCoolBar.Bands.EndUpdate;
1296     end;
1297    
1298     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1299     ListCoolBar.Bands.BeginUpdate;
1300     try
1301 yoffy 1.216 // for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1302     for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin
1303 hi_ 1.1 CoolSet := GikoSys.Setting.ListCoolSet[i];
1304 yoffy 1.263 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1305 yoffy 1.424 FIsIgnoreResize := rtNone;
1306 yoffy 1.263 SaveCoolBarSettings;
1307     Exit;
1308     end;
1309 hi_ 1.1 ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1310     ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1311     ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1312     end;
1313     finally
1314     ListCoolBar.Bands.EndUpdate;
1315     end;
1316    
1317     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1318     BrowserCoolBar.Bands.BeginUpdate;
1319     try
1320 yoffy 1.216 // for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1321 h677 1.514 for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin
1322 hi_ 1.1 CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1323 yoffy 1.263 if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin
1324 yoffy 1.424 FIsIgnoreResize := rtNone;
1325 yoffy 1.263 SaveCoolBarSettings;
1326     Exit;
1327     end;
1328 hi_ 1.1 BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1329     BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1330     BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1331     end;
1332     finally
1333     BrowserCoolBar.Bands.EndUpdate;
1334     end;
1335    
1336     end;
1337 yoffy 1.216 //
1338     procedure TGikoForm.FormShow(Sender: TObject);
1339     begin
1340 h677 1.471 if FStartUp then begin
1341 h677 1.423 ShowWindow(Application.Handle, SW_HIDE);
1342    
1343     //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1344     //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1345 h677 1.539 GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1346     GikoDM.StdToolBarVisibleActionExecute( nil );
1347     GikoDM.AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1348     GikoDM.AddressBarVisibleActionExecute( nil );
1349     GikoDM.LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1350     GikoDM.LinkBarVisibleActionExecute( nil );
1351     GikoDM.ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1352     GikoDM.ListToolBarVisibleActionExecute( nil );
1353     GikoDM.ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1354     GikoDM.ListNameBarVisibleActionExecute( nil );
1355     GikoDM.BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1356     GikoDM.BrowserToolBarVisibleActionExecute( nil );
1357     GikoDM.BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1358     GikoDM.BrowserNameBarVisibleActionExecute( nil );
1359 h677 1.423
1360     //鐃?鐃緒申鐃?鐃?鐃?鐃?
1361 h677 1.539 GikoDM.BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1362     GikoDM.BrowserTabVisibleActionExecute(nil);
1363 yoffy 1.216
1364 h677 1.423 if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1365 h677 1.539 GikoDM.BrowserTabTopAction.Checked := True;
1366     GikoDM.BrowserTabTopActionExecute(nil);
1367 h677 1.423 end else begin
1368 h677 1.539 GikoDM.BrowserTabBottomAction.Checked := True;
1369     GikoDM.BrowserTabBottomActionExecute(nil);
1370 h677 1.423 end;
1371    
1372     if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1373 h677 1.539 GikoDM.BrowserTabTabStyleAction.Checked := True;
1374     GikoDM.BrowserTabTabStyleActionExecute(nil);
1375 h677 1.423 end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1376 h677 1.539 GikoDM.BrowserTabButtonStyleAction.Checked := True;
1377     GikoDM.BrowserTabButtonStyleActionExecute(nil);
1378 h677 1.423 end else begin
1379 h677 1.539 GikoDM.BrowserTabFlatStyleAction.Checked := True;
1380     GikoDM.BrowserTabFlatStyleActionExecute(nil);
1381 h677 1.423 end;
1382 yoffy 1.216
1383 h677 1.423 // ListView 鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?
1384 yoffy 1.425 // ListView.FullDrag := True;
1385 yoffy 1.408
1386 h677 1.423 // CoolBar 鐃緒申鐃緒申
1387     LoadCoolBarSettings;
1388 yoffy 1.265
1389 h677 1.514 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1390 h677 1.517 // ResetBandInfo( ListCoolBar, ListToolBar );
1391 yoffy 1.424 FIsIgnoreResize := rtNone;
1392 h677 1.547 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1393     //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1394     InitActionChecked();
1395 genyakun 1.382
1396 h677 1.423 //FormCrete鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1397     if GikoSys.Setting.TabAutoLoadSave then begin
1398 h677 1.539 GikoDM.TabAutoLoadAction.Execute;
1399 h677 1.423 end;
1400 h677 1.547 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1401     if GikoSys.Setting.GengoSupport then begin
1402     //鐃?鐃緒申鐃?
1403     //Test鐃緒申鐃緒申
1404     end;
1405    
1406 h677 1.471 FStartUp := false;
1407 yoffy 1.397 end;
1408 yoffy 1.239 end;
1409 yoffy 1.216
1410 hi_ 1.1 procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1411     begin
1412 yoffy 1.331 // if GikoForm.WindowState <> wsMinimized then
1413     // SaveCoolBarSettings;
1414 yoffy 1.236 if ( GikoSys.Setting.ShowDialogForEnd ) and
1415     (MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin
1416     CanClose := false;
1417     Exit;
1418     end else begin
1419     CanClose := True;
1420 yoffy 1.398 if GikoSys.Setting.TabAutoLoadSave then begin
1421 h677 1.539 GikoDM.TabAutoSaveAction.Execute;
1422 yoffy 1.398 end;
1423 yoffy 1.236 end;
1424 h677 1.498 { //2ch鐃緒申鐃緒申鐃緒申鐃緒申Free
1425 h677 1.462 if GikoSys.Setting.Gengo <> nil then begin
1426     GikoSys.Setting.Gengo.Free;
1427 genyakun 1.458 end;
1428 h677 1.498 }
1429 h677 1.241 Application.UnhookMainWindow(Hook);
1430     Application.Terminate;
1431     end;
1432    
1433     procedure TGikoForm.FormDestroy(Sender: TObject);
1434     var
1435 yoffy 1.376 i : Integer;
1436 h677 1.241 // CoolSet: TCoolSet;
1437 yoffy 1.376 wp : TWindowPlacement;
1438     tmpBool : Boolean;
1439 h677 1.241 begin
1440 yoffy 1.460 // 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1441 yoffy 1.456 try
1442     MouseGesture.UnHook;
1443     except
1444     end;
1445 yoffy 1.236 try
1446 yoffy 1.410 ActiveListColumnSave;
1447 yoffy 1.236 except
1448     end;
1449     try
1450 h677 1.234 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1451     wp.length := sizeof(wp);
1452     GetWindowPlacement(Handle, @wp);
1453     GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1454     GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1455     GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1456     GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1457     GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1458    
1459     GikoSys.Setting.ListStyle := ListView.ViewStyle;
1460 h677 1.539 GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked;
1461 h677 1.234 GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1462     GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1463     GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1464 h677 1.539 if GikoDM.ArrangeAction.Checked then
1465 h677 1.234 GikoSys.Setting.ListOrientation := gloVertical
1466     else
1467     GikoSys.Setting.ListOrientation := gloHorizontal;
1468     GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1469 yoffy 1.236 except
1470 yoffy 1.2 end;
1471 yoffy 1.378
1472     try
1473     // 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1474     if not GikoSys.Setting.ResRangeHold then
1475 yoffy 1.380 GikoSys.Setting.ResRange := FResRangeMenuSelect;
1476 yoffy 1.378 except
1477     end;
1478 h677 1.483 if WindowState <> wsNormal then
1479     WindowState := wsNormal;
1480     SaveCoolBarSettings;
1481     try
1482     GikoSys.Setting.WriteWindowSettingFile;
1483     GikoSys.Setting.WriteNameMailSettingFile;
1484     except
1485     end;
1486 yoffy 1.378 // 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申 CoolBar 鐃緒申鐃緒申
1487 yoffy 1.216 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1488 h677 1.482
1489 yoffy 1.263 // 鐃緒申FormDestroy鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?2004/04/09鐃?
1490 yoffy 1.216 // CoolBar 鐃緒申鐃緒申
1491 h677 1.482 //if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then
1492 h677 1.483
1493 yoffy 1.2
1494     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1495 hi_ 1.1 try
1496 yoffy 1.236 //FavoriteDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1497 yoffy 1.2 FavoriteDM.WriteFavorite;
1498 yoffy 1.236 FavoriteDM.Clear;
1499 hi_ 1.1 except
1500     end;
1501 h677 1.483 LockWindowUpdate(Self.Handle);
1502 hi_ 1.1 try
1503     //鐃?鐃?鐃?鐃緒申鐃?鐃?
1504 h677 1.321 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1505     GikoSys.Setting.ShowDialogForAllTabClose := false;
1506 h677 1.539 GikoDM.AllTabCloseAction.Execute;
1507 h677 1.483 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1508 h677 1.299 except
1509     end;
1510 h677 1.321 try
1511     for i := FBrowsers.Count - 1 downto 0 do begin
1512     TWebBrowser(FBrowsers[i]).Free;
1513     end;
1514     FBrowsers.Clear;
1515     FBrowsers.Capacity := 0;
1516     finally
1517     FBrowsers.Free;
1518 h677 1.303 end;
1519 h677 1.299 try
1520     if BrowserNullTab <> nil then begin
1521     BrowserNullTab.Browser := nil; {*BrowserNullTab鐃緒申Browser鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?
1522     *鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Free鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1523     *}
1524     BrowserNullTab.Free;
1525 hi_ 1.1 end;
1526     except
1527     end;
1528 h677 1.483
1529 h677 1.224 try
1530 yoffy 1.236 TreeView.Items.BeginUpdate;
1531 yoffy 1.380 TreeView.Items.GetFirstNode.Free;
1532 yoffy 1.236 TreeView.Items.Clear;
1533     TreeView.Items.EndUpdate;
1534 h677 1.224 except
1535     end;
1536 h677 1.230
1537 hi_ 1.1 //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1538     try
1539 yoffy 1.236 //AddressHistoryDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1540 h677 1.513 //AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1541     AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
1542 hi_ 1.1 except
1543     end;
1544    
1545 h677 1.234 //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1546 hi_ 1.1 try
1547 h677 1.234 SaveHistory;
1548 hi_ 1.1 except
1549     end;
1550 yoffy 1.236 try
1551     try
1552     ClearHistory;
1553     except
1554     end;
1555     finally
1556     FHistoryList.Free;
1557     end;
1558 h677 1.221
1559 h677 1.182 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1560     try
1561     RoundList.SaveRoundFile;
1562     except
1563     end;
1564 yoffy 1.236 try
1565 h677 1.234 try
1566 yoffy 1.236 RoundList.Clear;
1567 h677 1.234 except
1568     end;
1569 yoffy 1.236 finally
1570     RoundList.Free;
1571     end;
1572 h677 1.182
1573 yoffy 1.236 try
1574 h677 1.234 try
1575     FControlThread.Terminate;
1576 yoffy 1.236 FControlThread.WaitFor;
1577 h677 1.234 except
1578 h677 1.219 end;
1579 yoffy 1.236 finally
1580     FControlThread.Free;
1581     end;
1582 h677 1.230
1583 yoffy 1.155 // TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1584     // TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1585     // BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1586 h677 1.550 for i := Length(BoardGroups) - 1 downto 0 do begin
1587 h677 1.517 //BoardGroups[i].Clear;
1588     BoardGroups[i].Free;
1589 h677 1.550 end;
1590 h677 1.514
1591 yoffy 1.126 try
1592 h677 1.220 for i := Length( BBSs ) - 1 downto 0 do begin
1593 h677 1.153 if BBSs[ i ] <> nil then
1594     BBSs[ i ].Free;
1595     BBSs[ i ] := nil;
1596     end;
1597     except
1598     end;
1599 yoffy 1.155
1600 h677 1.234 try
1601 yoffy 1.236 if FEvent <> nil then
1602     FEvent.Free;
1603 h677 1.181
1604 yoffy 1.2 //Hint鐃?鐃緒申
1605     if FHint <> nil then begin
1606     FHint.ReleaseHandle;
1607     FHint.Free;
1608     FHint := nil;
1609     end;
1610     //Preview鐃?鐃緒申
1611     if TPreviewBrowser <> nil then begin
1612     FPreviewBrowser.Free;
1613     FPreviewBrowser := nil;
1614     end;
1615     except
1616     end;
1617 h677 1.550 LockWindowUpdate(0);
1618 hi_ 1.1 end;
1619    
1620 yoffy 1.289 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
1621     procedure TGikoForm.SetBBSMenu;
1622 yoffy 1.123 var
1623     i : Integer;
1624 yoffy 1.149 item : TBBSMenuItem;
1625 hi_ 1.1 begin
1626    
1627 yoffy 1.148 // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1628     for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin
1629     try
1630     if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin
1631 yoffy 1.155 CabinetSelectPopupMenu.Items[ i ].Free;
1632     CabinetMenu.Items[ i ].Free;
1633 yoffy 1.289 BBSSelectPopupMenu.Items[ i ].Free;
1634 yoffy 1.148 end;
1635     except
1636     end;
1637     end;
1638 yoffy 1.289
1639     // 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1640 yoffy 1.148 for i := Length( BBSs ) - 1 downto 0 do begin
1641     try
1642     item := TBBSMenuItem.Create( PopupMenu );
1643     item.Caption := BBSs[ i ].Title;
1644     item.Data := BBSs[ i ];
1645     item.OnClick := BBSMenuItemOnClick;
1646     CabinetSelectPopupMenu.Items.Insert( 0, item );
1647     item := TBBSMenuItem.Create( PopupMenu );
1648     item.Caption := BBSs[ i ].Title;
1649     item.Data := BBSs[ i ];
1650     item.OnClick := BBSMenuItemOnClick;
1651     CabinetMenu.Insert( 0, item );
1652 yoffy 1.289 item := TBBSMenuItem.Create( PopupMenu );
1653     item.Caption := BBSs[ i ].Title;
1654     item.Data := BBSs[ i ];
1655     item.OnClick := BBSMenuItemOnClick;
1656     BBSSelectPopupMenu.Items.Insert( 0, Item );
1657 yoffy 1.148 except
1658     end;
1659     end;
1660 yoffy 1.289
1661     end;
1662    
1663     procedure TGikoForm.ReloadBBS;
1664     var
1665     i : Integer;
1666 h677 1.321 tmpBool: Boolean;
1667 yoffy 1.289 begin
1668 h677 1.517 LockWindowUpdate(Self.Handle);
1669    
1670 yoffy 1.289 //鐃?鐃?鐃?鐃緒申鐃?鐃?
1671 h677 1.321 tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
1672     GikoSys.Setting.ShowDialogForAllTabClose := false;
1673 h677 1.539 GikoDM.AllTabCloseAction.Execute;
1674 h677 1.321 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1675    
1676 h677 1.320 SetContent(BrowserNullTab);
1677 yoffy 1.289 //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1678     TreeView.Items.Clear;
1679    
1680 h677 1.515 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申
1681     try
1682     RoundList.SaveRoundFile;
1683     except
1684     end;
1685     //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1686     try
1687     RoundList.Clear;
1688     except
1689     end;
1690    
1691     //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1692 h677 1.517 try
1693     SaveHistory;
1694     ClearHistory;
1695     except
1696     end;
1697 h677 1.515
1698     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1699 h677 1.517 try
1700     FavoriteDM.WriteFavorite;
1701     FavoriteDM.Clear;
1702     except
1703     end;
1704 h677 1.515
1705 h677 1.516 //鐃緒申鐃?鐃?鐃緒申鐃?PLUGIN鐃緒申鐃?鐃緒申
1706     for i := Length(BoardGroups) - 1 downto 0 do begin
1707 h677 1.517 try
1708     BoardGroups[i].Free;
1709     except
1710     end;
1711 h677 1.516 end;
1712 yoffy 1.289 //BBS鐃?鐃緒申
1713     try
1714     for i := Length( BBSs ) - 1 downto 0 do begin
1715     if BBSs[ i ] <> nil then
1716     BBSs[ i ].Free;
1717     BBSs[ i ] := nil;
1718     end;
1719     except
1720     end;
1721    
1722     ActiveList := nil;
1723    
1724     FTreeType := gttNone;
1725 h677 1.516
1726     //============鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申================================//
1727    
1728     // 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申)
1729     InitializeBoardPlugIns;
1730    
1731 yoffy 1.289 GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1732    
1733 h677 1.515 // 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1734     for i := Length(BBSs) - 1 downto 0 do begin
1735     if not BBSs[i].IsBoardFileRead then
1736     GikoSys.ReadBoardFile(BBSs[i]);
1737     end;
1738    
1739 yoffy 1.289 // BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1740     SetBBSMenu;
1741    
1742 yoffy 1.123 ShowBBSTree( BBSs[ 0 ] );
1743 yoffy 1.143
1744     // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1745     LoadHistory;
1746    
1747     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1748     FavoriteDM.ReadFavorite;
1749 yoffy 1.279
1750 yoffy 1.143 SetLinkBar;
1751    
1752 h677 1.515 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1753 h677 1.514 RoundList.LoadRoundBoardFile;
1754     RoundList.LoadRoundThreadFile;
1755    
1756 h677 1.517 LockWindowUpdate(0);
1757 h677 1.476 //
1758 h677 1.539 GikoDM.TabsOpenAction.Execute;
1759 hi_ 1.1 end;
1760    
1761    
1762     procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
1763     var
1764     p: TPoint;
1765     s: string;
1766     tmp2: string;
1767     URL: string;
1768     ATitle: Boolean;
1769    
1770 yoffy 1.130 threadItem : TThreadItem;
1771     board : TBoard;
1772 yoffy 1.163 Protocol, Host, Path, Document, Port, Bookmark: string;
1773 yoffy 1.130
1774 h677 1.333 wkInt: Integer;
1775 hi_ 1.1 wkIntSt: Integer;
1776     wkIntTo: Integer;
1777     ActiveFileName: string;
1778     e: IHTMLElement;
1779     Ext: string;
1780     PathRec: TPathRec;
1781     begin
1782 h677 1.316 if not( TObject(Sender) is TWebBrowser )then
1783     Exit;
1784 hi_ 1.1 try
1785     try
1786 h677 1.316 if (TWebBrowser(Sender) <> nil) and (not TWebBrowser(Sender).Busy) and (Assigned(TWebBrowser(Sender).Document)) then begin
1787     if LowerCase(OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset) <> 'shift_jis' then begin
1788     OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset := 'shift_jis';
1789 h677 1.306 end;
1790 hi_ 1.1 end;
1791     except
1792     end;
1793     finally
1794     end;
1795     if PreviewTimer.Enabled then
1796     PreviewTimer.Enabled := False;
1797     Application.CancelHint;
1798 h677 1.333 try
1799     if GetActiveContent <> nil then
1800     ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
1801     else
1802     ActiveFileName := '';
1803     except
1804     FActiveContent := nil;
1805     Exit;
1806     end;
1807 hi_ 1.1
1808     StatusBar.Panels[1].Text := Text;
1809    
1810     if FHint <> nil then begin
1811     FHint.ReleaseHandle;
1812     FHint.ClearAllRes;
1813     end;
1814     if FPreviewBrowser <> nil then
1815     ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
1816    
1817     if not GikoSys.Setting.UnActivePopup then
1818     if not GikoForm.Active then
1819     Exit;
1820    
1821     //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
1822     //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
1823    
1824     s := '';
1825     Ext := AnsiLowerCase(ExtractFileExt(Text));
1826     if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
1827     ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
1828     if FPreviewBrowser = nil then begin
1829     FPreviewBrowser := TPreviewBrowser.Create(Self);
1830     ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
1831     TOleControl(FPreviewBrowser).Parent := nil;
1832     end;
1833 h677 1.316 FPreviewBrowser.Navigate(BLANK_HTML);//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1834 hi_ 1.1 FPreviewURL := Text;
1835     PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
1836     PreviewTimer.Enabled := True;
1837     end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
1838     if Pos('mailto:', Text) = 1 then begin
1839     s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
1840     //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
1841     GetCursorPos(p);
1842     p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
1843     p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
1844     e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
1845     if (Assigned(e)) then begin
1846 h677 1.297 tmp2 := ZenToHan(e.Get_outerText);
1847 hi_ 1.1 if (GikoSys.IsNumeric(tmp2)) then begin
1848     //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1849     wkIntSt := StrToInt(tmp2);
1850     wkIntTo := StrToInt(tmp2);
1851     //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
1852     FHint.PopupType := gptThread;
1853 h677 1.530 HTMLCreater.SetResPopupText(FHint, GetActiveContent, wkIntSt, wkIntTo, False, False);
1854 hi_ 1.1 end else begin
1855     FHint.PopupType := gptRaw;
1856     FHint.Caption := s;
1857     end;
1858     end;
1859     end else begin
1860 h677 1.319 threadItem := GetActiveContent;
1861 h677 1.530 URL := THTMLCreate.GetRespopupURL(Text, threadItem.URL);
1862 yoffy 1.274 PathRec := Gikosys.Parse2chURL2(URL);
1863 q9_ 1.354 if (PathRec.FNoParam) then begin
1864     PathRec.FSt := 1;
1865     PathRec.FTo := 1;
1866 h677 1.447 end else begin
1867 q9_ 1.352 Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo);
1868 h677 1.447 end;
1869 yoffy 1.163 GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark );
1870 hi_ 1.1
1871 h677 1.168 if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin
1872 yoffy 1.162
1873 yoffy 1.163 URL := GikoSys.GetBrowsableThreadURL( URL );
1874 yoffy 1.274 wkIntSt := PathRec.FSt;
1875     wkIntTo := PathRec.FTo;
1876 hi_ 1.1
1877     if (wkIntSt = 0) and (wkIntTo = 0) then begin
1878     wkIntSt := 1;
1879     wkIntTo := 1;
1880     end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
1881     wkIntSt := wkIntTo;
1882     end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
1883     wkIntTo := wkIntSt;
1884     end else if wkIntSt > wkIntTo then begin
1885 h677 1.333 wkInt := wkIntTo;
1886 hi_ 1.1 wkIntTo := wkIntSt;
1887 h677 1.333 wkIntSt := wkInt;
1888 hi_ 1.1 end;
1889 h677 1.299 if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then
1890 yoffy 1.274 ATitle := false
1891     else
1892     ATitle := true;
1893 hi_ 1.1
1894 yoffy 1.160 threadItem := BBSsFindThreadFromURL( URL );
1895 h677 1.170
1896 yoffy 1.163 if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin
1897     board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
1898 yoffy 1.274 if board <> nil then begin
1899     if not board.IsThreadDatRead then
1900     GikoSys.ReadSubjectFile( board );
1901 yoffy 1.270 threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' );
1902 yoffy 1.274 end;
1903 yoffy 1.130 end;
1904 h677 1.319
1905 yoffy 1.130 if threadItem <> nil then begin
1906 yoffy 1.127 //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
1907 h677 1.512 //URL鐃緒申鐃緒申鐃緒申鐃緒申/鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
1908     if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin
1909     wkIntSt := 1;
1910     wkIntTo := 1;
1911     end;
1912 yoffy 1.127 FHint.PopupType := gptThread;
1913 h677 1.530 HTMLCreater.SetResPopupText(FHint, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst );
1914 yoffy 1.127 end;
1915 hi_ 1.1 end;
1916 h677 1.168 end;
1917 hi_ 1.1
1918     if FHint.PopupType = gptRaw then begin
1919     if FHint.Caption <> '' then
1920     ShowTextPopup;
1921     end else begin
1922 yoffy 1.2 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
1923 hi_ 1.1 ShowTextPopup;
1924     end;
1925     end;
1926     end;
1927    
1928     procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
1929     var
1930     SysMenu: HMenu;
1931     begin
1932     FEnabledCloseButton := Enabled;
1933     SysMenu := GetSystemMenu(Handle, False);
1934    
1935     if Enabled then begin
1936     EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
1937     end else begin
1938     EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
1939     end;
1940    
1941     DrawMenuBar(Handle);
1942     end;
1943    
1944     procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
1945     var AllowChange: Boolean);
1946     begin
1947 q9_ 1.369 //鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1948     // if FTreeType = gtt2ch then
1949     // FSortIndex := -1;
1950 hi_ 1.1 end;
1951    
1952     procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
1953     Shift: TShiftState);
1954 yoffy 1.428 var
1955     pos : TPoint;
1956 hi_ 1.1 begin
1957 yoffy 1.236 if GetActiveList is TBoard then begin
1958 yoffy 1.428 case Key of
1959     VK_BACK:; // UpFolderButtonClick(Sender);
1960     VK_SPACE: ListDoubleClick(Shift);
1961     VK_RETURN: ListClick;
1962     VK_APPS:
1963     begin
1964     if ListView.Selected <> nil then begin
1965     pos.X := ListView.Column[ 0 ].Width;
1966     pos.Y := ListView.Selected.Top;
1967     end else begin
1968     pos.X := ListView.Left;
1969     pos.Y := ListView.Top;
1970     end;
1971     Windows.ClientToScreen( ListView.Handle, pos );
1972     ListPopupMenu.Popup( pos.X, pos.Y );
1973     end;
1974 yoffy 1.236 end;
1975     end else begin // TBBS, TCategory
1976 yoffy 1.428 case Key of
1977     VK_BACK:; // UpFolderButtonClick(Sender);
1978     VK_SPACE: ListClick;
1979     VK_RETURN: ListDoubleClick(Shift);
1980     VK_APPS:
1981     begin
1982     if ListView.Selected <> nil then begin
1983     pos.X := ListView.Column[ 0 ].Width;
1984     pos.Y := ListView.Selected.Top;
1985     end else begin
1986     pos.X := ListView.Left;
1987     pos.Y := ListView.Top;
1988     end;
1989     Windows.ClientToScreen( ListView.Handle, pos );
1990     ListPopupMenu.Popup( pos.X, pos.Y );
1991     end;
1992 yoffy 1.236 end;
1993 hi_ 1.1 end;
1994     end;
1995    
1996     function TGikoForm.GetHttpState: Boolean;
1997     begin
1998     Result := FHttpState;
1999     end;
2000    
2001     procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2002     Column: TListColumn);
2003 yoffy 1.413 var
2004     id, idx : Integer;
2005     orderList : TList;
2006 hi_ 1.1 begin
2007 h677 1.530 idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
2008 yoffy 1.413
2009     if TObject( FActiveList ) is TBBS then
2010     orderList := GikoSys.Setting.BBSColumnOrder
2011     else if TObject( FActiveList ) is TCategory then
2012     orderList := GikoSys.Setting.CategoryColumnOrder
2013     else if TObject( FActiveList ) is TBoard then
2014     orderList := GikoSys.Setting.BoardColumnOrder
2015     else
2016     Exit;
2017    
2018     id := Integer( orderList[ idx ] );
2019    
2020     if FSortIndex = id then
2021 hi_ 1.1 FSortOrder := not FSortOrder
2022 h677 1.464 else begin
2023     FSortOrder := id = 0;
2024     end;
2025 yoffy 1.413
2026 h677 1.539 TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, FSortOrder, FSortIndex );
2027 hi_ 1.1 end;
2028    
2029     procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2030     Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2031     var
2032     ARect: TRect;
2033     begin
2034 yoffy 1.2 DefaultDraw := True;
2035     Exit;
2036 hi_ 1.1 DefaultDraw := False;
2037     if (cdsSelected in State) or (cdsHot in State) then begin
2038     Sender.Canvas.Brush.Color := clHighlight;
2039     Sender.Canvas.Font.Color := clHighlightText;
2040     end else begin
2041     Sender.Canvas.Brush.Color := clBtnFace;
2042     Sender.Canvas.Font.Color := clBtnText;
2043     end;
2044     ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2045     Sender.Canvas.FillRect(ARect);
2046     DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2047     end;
2048    
2049     function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2050     var
2051     Nodes: TTreeNodes;
2052     i: integer;
2053     begin
2054     Nodes := TreeView.Items;
2055    
2056     for i := 0 to Nodes.Count - 1 do begin
2057     if Nodes.Item[i].Data = Data then begin
2058     Result := Nodes.Item[i];
2059     Exit;
2060     end;
2061     end;
2062     Result := nil;
2063     end;
2064    
2065     procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2066     const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2067     Headers: OleVariant; var Cancel: WordBool);
2068     var
2069     sNo: string;
2070     p: TPoint;
2071 yoffy 1.56 const
2072     kMenuName: string = 'menu:';
2073 hi_ 1.1 begin
2074 yoffy 1.56
2075     if Pos(kMenuName, URL) <> 0 then begin
2076 yoffy 1.100 sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
2077    
2078 hi_ 1.1 if not GikoSys.IsNumeric(sNo) then Exit;
2079    
2080     Cancel := True;
2081     GetCursorpos(p);
2082     KokoPopupMenu.Tag := StrToInt(sNo);
2083     KokoPopupMenu.Popup(p.x, p.y);
2084     end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
2085     Cancel := not GikoSys.Setting.OpenMailer;
2086     end;
2087 yoffy 1.56
2088 hi_ 1.1 end;
2089    
2090     procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView;
2091     const ARect: TRect; var DefaultDraw: Boolean);
2092     var
2093     NodeRect: TRect;
2094     i, j: Integer;
2095     IsBoardNode: Boolean;
2096     Cnt: Integer;
2097     CntText: string;
2098     TextWidth: Integer;
2099     TextRect: TRect;
2100     Board: TBoard;
2101     Category: TCategory;
2102     Bitmap: TBitmap;
2103     NodeWidth: Integer;
2104     begin
2105     DefaultDraw := True;
2106    
2107     if FTreeType = gttHistory then Exit;
2108    
2109     TreeView.Canvas.Font.Color := clBlue;
2110     IsBoardNode := False;
2111 h677 1.95 for i := 0 to TreeView.Items.Count - 1 do begin
2112 yoffy 1.51 Cnt := 0;
2113 hi_ 1.1 if not TreeView.Items[i].IsVisible then
2114     continue;
2115    
2116     if TObject(TreeView.Items[i].Data) is TCategory then begin
2117     if TreeView.Items[i].Expanded then
2118     continue;
2119    
2120     IsBoardNode := False;
2121     Category := TCategory(TreeView.Items[i].Data);
2122     for j := 0 to Category.Count - 1 do begin
2123     Board := Category.Items[j];
2124     if Board <> nil then begin
2125     if Board.UnRead > 0 then begin
2126     Cnt := 1;
2127     Break;
2128     end;
2129     end;
2130     end;
2131     if Cnt <> 1 then
2132     continue;
2133     end else if TObject(TreeView.Items[i].Data) is TBoard then begin
2134     IsBoardNode := True;
2135     Board := TBoard(TreeView.Items[i].Data);
2136 h677 1.514
2137 hi_ 1.1 Cnt := Board.UnRead;
2138     if Cnt <= 0 then
2139     continue;
2140     end else
2141     continue;
2142    
2143     Bitmap := TBitmap.Create;
2144     try
2145     Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font);
2146     Bitmap.Canvas.Font.Style := [fsBold];
2147     NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text);
2148     finally
2149     Bitmap.Free;
2150     end;
2151    
2152     NodeRect := TreeView.Items[i].DisplayRect(True);
2153    
2154     if IsBoardNode then
2155     CntText := '(' + IntToStr(Cnt) + ')'
2156 h677 1.95 else if Cnt = 1 then
2157 hi_ 1.1 CntText := '(+)';
2158 h677 1.95
2159 hi_ 1.1
2160     TextWidth := TreeView.Canvas.TextWidth(CntText);
2161    
2162     TextRect := Rect(NodeRect.Left + NodeWidth + 8,
2163     NodeRect.Top,
2164     NodeRect.Left + NodeWidth + TextWidth + 8,
2165     NodeRect.Bottom);
2166     DrawText(TreeView.Canvas.Handle,
2167     PChar(CntText),
2168     -1,
2169     TextRect,
2170     DT_SINGLELINE or DT_VCENTER);
2171     end;
2172     TreeViewCustomDrawItem(nil, nil, [], DefaultDraw);
2173     end;
2174    
2175     procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
2176     Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
2177     var
2178     Board: TBoard;
2179     Category: TCategory;
2180     i: Integer;
2181     begin
2182     DefaultDraw := True;
2183    
2184     if FTreeType = gttHistory then Exit;
2185    
2186     TreeView.Canvas.Font.Style := [];
2187     if Node <> nil then begin
2188     if TObject(Node.Data) is TCategory then begin
2189     Category := TCategory(Node.Data);
2190     for i := 0 to Category.Count - 1 do begin
2191     Board := Category.Items[i];
2192     if Board <> nil then begin
2193     if Board.UnRead > 0 then begin
2194     TreeView.Canvas.Font.Style := [fsBold];
2195     Break;
2196     end;
2197     end;
2198     end;
2199     end else if TObject(Node.Data) is TBoard then begin
2200     Board := TBoard(Node.Data);
2201     if Board.UnRead > 0 then
2202     TreeView.Canvas.Font.Style := [fsBold];
2203     end;
2204     end;
2205     end;
2206    
2207     procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode);
2208     begin
2209     TreeView.Invalidate;
2210    
2211 yoffy 1.123 if TObject(Node.Data) is TBBS then begin
2212     TBBS(Node.Data).NodeExpand := True;
2213 hi_ 1.1 end else if TObject(Node.Data) is TCategory then begin
2214     TCategory(Node.Data).NodeExpand := True;
2215     end else if TObject(Node.Data) is TBoard then begin
2216     TBoard(Node.Data).NodeExpand := True;
2217     end;
2218     end;
2219    
2220     procedure TGikoForm.ListViewAllSelect;
2221     begin
2222     ListView.SetFocus;
2223     ListView.SelectAll;
2224     end;
2225 h677 1.548 // *************************************************************************
2226     //! 鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
2227     // *************************************************************************
2228 hi_ 1.1 procedure TGikoForm.TreeViewDblClick(Sender: TObject);
2229 h677 1.553 var
2230     pos : TPoint;
2231     rect: TRect;
2232 hi_ 1.1 begin
2233 h677 1.553 pos := FMouseDownPos;
2234 h677 1.554 if (FClickNode <> nil) and (FClickNode = TreeView.GetNodeAt(pos.