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.29 - (hide annotations) (download) (as text)
Wed Aug 27 17:25:09 2003 UTC (20 years, 7 months ago) by yoffy
Branch: MAIN
Changes since 1.28: +128 -47 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 hi_ 1.4 OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem,
8     {$IF Defined(DELPRO) }
9     SHDocVw,
10     MSHTML,
11     {$ELSE}
12     SHDocVw_TLB,
13     MSHTML_TLB,
14     {$IFEND}
15 yoffy 1.2 IdHTTP, ActiveX, Clipbrd, Buttons, ToolWin, {HTTPApp,} YofUtils, IdComponent,
16 hi_ 1.4 ShellAPI, ImgList, ActnList, UrlMon, Tabs, IdGlobal, StrUtils,
17 yoffy 1.2 CommCtrl, IniFiles,
18 hi_ 1.1 GikoSystem, GikoUtil, Setting, BoardGroup, ThreadControl, ItemDownload,
19     Editor, RoundData, RoundName, KeySetting, GikoPanel, Favorite, FavoriteAdd,
20     FavoriteArrange, AddressHistory, Preview, HTMLDocumentEvent, Kotehan,
21 h677 1.11 HintWindow, GikoCoolBar, GikoListView, ToolBarSetting, ToolBarUtil;
22 hi_ 1.1
23     type
24     TGikoTreeType = (gttNone, gtt2ch, gttHistory);
25    
26     TGikoForm = class(TForm)
27     StatusBar: TStatusBar;
28     MainPanel: TPanel;
29     ClientPanel: TPanel;
30     TreeSplitter: TSplitter;
31     CabinetPanel: TPanel;
32     TreeView: TTreeView;
33     ThreadMainPanel: TPanel;
34     ListSplitter: TSplitter;
35     ViewPanel: TPanel;
36 yoffy 1.2 ListView: TGikoListView;
37 hi_ 1.1 ThreadPanel: TPanel;
38     Browser: TWebBrowser;
39     MessagePanel: TPanel;
40     MessageBar: TPanel;
41     MessageHideButton: TSpeedButton;
42     MessageListView: TListView;
43     MessageSplitter: TSplitter;
44     Panel3: TPanel;
45     SpeedButton1: TSpeedButton;
46     ToolBar1: TToolBar;
47     CabinetSelectToolButton: TToolButton;
48     HistoryToolBar: TToolBar;
49     ToolButton15: TToolButton;
50     ToolButton18: TToolButton;
51     ItemIcon16: TImageList;
52     ItemIcon32: TImageList;
53 yoffy 1.2 HotToobarImageList: TImageList;
54 hi_ 1.1 ToobarImageList: TImageList;
55     ItemImageList: TImageList;
56 yoffy 1.2 ActionList: TActionList;
57 hi_ 1.1 LogDeleteAction: TAction;
58     KidokuAction: TAction;
59     StdToolBarVisibleAction: TAction;
60     SearchAction: TAction;
61     GikoNaviWebPageAction: TAction;
62     AboutAction: TAction;
63     ExitAction: TAction;
64     MsgBarVisibleAction: TAction;
65     StatusBarVisibleAction: TAction;
66     LargeIconAction: TAction;
67     SmallIconAction: TAction;
68     ListIconAction: TAction;
69     DetailIconAction: TAction;
70     Cabinet2chAction: TAction;
71     CabinetHistoryAction: TAction;
72     CabinetVisibleAction: TAction;
73     MidokuAction: TAction;
74     AllSelectAction: TAction;
75     UpFolderAction: TAction;
76     ListNumberVisibleAction: TAction;
77     AllItemAction: TAction;
78     LogItemAction: TAction;
79     NewItemAction: TAction;
80     SelectItemAction: TAction;
81     ShowThreadAction: TAction;
82     StopAction: TAction;
83     MainMenu: TMainMenu;
84     FileMenu: TMenuItem;
85     DeleteMenu: TMenuItem;
86     ExitMenu: TMenuItem;
87     KidokuMenu: TMenuItem;
88     MidokuMenu: TMenuItem;
89     AllSelectMenu: TMenuItem;
90     ViewMenu: TMenuItem;
91     StdToolBarMenu: TMenuItem;
92     CabinetMenu: TMenuItem;
93     N6: TMenuItem;
94     H1: TMenuItem;
95     N4: TMenuItem;
96     CabinetVisibleMenu: TMenuItem;
97     MessageMenu: TMenuItem;
98     StatusBarMenu: TMenuItem;
99     MMSep03: TMenuItem;
100     LargeIconMenu: TMenuItem;
101     SmallIconMenu: TMenuItem;
102     ListMenu: TMenuItem;
103     DetailMenu: TMenuItem;
104     ToolMenu: TMenuItem;
105     Find1: TMenuItem;
106     RoundMenu: TMenuItem;
107     MMSep04: TMenuItem;
108     OptionMenu: TMenuItem;
109     HelpMenu: TMenuItem;
110     G1: TMenuItem;
111     N1: TMenuItem;
112     AboutMenu: TMenuItem;
113     IconStyle: TAction;
114     BrowserPopupMenu: TPopupMenu;
115     ShowThreadMenu: TMenuItem;
116 yoffy 1.2 ShowBoardMenu: TMenuItem;
117 hi_ 1.1 ShowBoardAction: TAction;
118     ListIconPopupMenu: TPopupMenu;
119     LargeIconPMenu: TMenuItem;
120     SmallIconPMenu: TMenuItem;
121     ListPMenu: TMenuItem;
122     DetailPMenu: TMenuItem;
123     CabinetCloseAction: TAction;
124     ClosePopupMenu: TPopupMenu;
125     CloseMenu: TMenuItem;
126     OptionAction: TAction;
127     U1: TMenuItem;
128     N3: TMenuItem;
129     B1: TMenuItem;
130     S1: TMenuItem;
131     N2: TMenuItem;
132     A1: TMenuItem;
133     L1: TMenuItem;
134     N5: TMenuItem;
135     S2: TMenuItem;
136     RoundAction: TAction;
137     ListPopupMenu: TPopupMenu;
138     ListRoundPMenu: TMenuItem;
139     ListReservPMenu: TMenuItem;
140     LPMSep01: TMenuItem;
141     ItemRoundPMenu: TMenuItem;
142     LPMSep02: TMenuItem;
143 yoffy 1.2 KidokuPMenu: TMenuItem;
144 hi_ 1.1 MidokuPMenu: TMenuItem;
145     AllSelectPMenu: TMenuItem;
146     UrlCopyPMenu: TMenuItem;
147     LPMSep05: TMenuItem;
148     DeletePMenu: TMenuItem;
149     LPMSep06: TMenuItem;
150     ViewPMenu: TMenuItem;
151     LargeIconLPMenu: TMenuItem;
152     SmallIconLPMenu: TMenuItem;
153     ListLPMenu: TMenuItem;
154     DetailLPMenu: TMenuItem;
155     T1: TMenuItem;
156     B2: TMenuItem;
157     N8: TMenuItem;
158     URLCopyAction: TAction;
159     URLC1: TMenuItem;
160     N9: TMenuItem;
161     N10: TMenuItem;
162     MsgBarCloseAction: TAction;
163     ScrollTopAction: TAction;
164     ScrollLastAction: TAction;
165     ScrollNewAction: TAction;
166     ScrollKokoAction: TAction;
167     EditorAction: TAction;
168     IEAction: TAction;
169     ItemReloadAction: TAction;
170     BrowserMaxAction: TAction;
171     G2: TMenuItem;
172     N11: TMenuItem;
173     T3: TMenuItem;
174     L2: TMenuItem;
175     N12: TMenuItem;
176     K1: TMenuItem;
177     N13: TMenuItem;
178     N14: TMenuItem;
179     R1: TMenuItem;
180     A2: TMenuItem;
181     N15: TMenuItem;
182     SelectListReloadAction: TAction;
183     SelectThreadReloadAction: TAction;
184     SelectTimer: TTimer;
185     KokoPopupMenu: TPopupMenu;
186     KokomadePMenu: TMenuItem;
187 yoffy 1.2 AllPMenu: TMenuItem;
188 hi_ 1.1 MenuItem1: TMenuItem;
189     MenuItem2: TMenuItem;
190     BrowserTabCloseAction: TAction;
191     BrowserTabPopupMenu: TPopupMenu;
192     Close1: TMenuItem;
193     KokomadeAction: TAction;
194     ZenbuAction: TAction;
195     KokoResAction: TAction;
196     SelectItemURLCopyAction: TAction;
197     SelectReservAction: TAction;
198     NotSelectTabCloseAction: TAction;
199     A3: TMenuItem;
200     N16: TMenuItem;
201     A4: TMenuItem;
202     TreePopupMenu: TPopupMenu;
203     TreeSelectThreadPupupMenu: TMenuItem;
204     TreeSelectBoardPupupMenu: TMenuItem;
205     TPMSep01: TMenuItem;
206     TreeSelectURLPupupMenu: TMenuItem;
207     TreeSelectBoradReload: TAction;
208     TreeSelectThreadReload: TAction;
209     TreeSelectURLCopy: TAction;
210     ListToolBarVisibleAction: TAction;
211     BrowserToolBarVisibleAction: TAction;
212     T2: TMenuItem;
213 yoffy 1.2 L3: TMenuItem;
214 hi_ 1.1 B3: TMenuItem;
215     BrowserBottomPanel: TGikoPanel;
216     CabinetSelectPopupMenu: TPopupMenu;
217     N17: TMenuItem;
218     H2: TMenuItem;
219     ItemReservPMenu: TMenuItem;
220     RoundNamePopupMenu: TPopupMenu;
221     SelectNewRoundName: TAction;
222     SelectDeleteRound: TAction;
223     NewBoardAction: TAction;
224 yoffy 1.2 N7: TMenuItem;
225 hi_ 1.1 B4: TMenuItem;
226     LoginAction: TAction;
227     L4: TMenuItem;
228     KeySettingAction: TAction;
229     K2: TMenuItem;
230     AllTabCloseAction: TAction;
231     A5: TMenuItem;
232     N18: TMenuItem;
233     A6: TMenuItem;
234     C1: TMenuItem;
235     V1: TMenuItem;
236     N19: TMenuItem;
237     D1: TMenuItem;
238     D2: TMenuItem;
239     N20: TMenuItem;
240     MessageImageList: TImageList;
241     ProgressBar: TProgressBar;
242     ArrangeAction: TAction;
243     URL1: TMenuItem;
244     NameURLCopyAction: TAction;
245     SelectItemNameURLCopyAction: TAction;
246     NameUrlCopyPMenu: TMenuItem;
247     URLC2: TMenuItem;
248     URLN1: TMenuItem;
249     N21: TMenuItem;
250     URLC3: TMenuItem;
251 yoffy 1.2 URLN2: TMenuItem;
252 hi_ 1.1 N22: TMenuItem;
253     N23: TMenuItem;
254 yoffy 1.2 ListCoolBar: TGikoCoolBar;
255 hi_ 1.1 ListToolBar: TToolBar;
256     ViewNoButton: TToolButton;
257     IconToolButton: TToolButton;
258     UpFolderButton: TToolButton;
259     Sepa01ToolButton: TToolButton;
260 yoffy 1.2 AllItemToolButton: TToolButton;
261 hi_ 1.1 LogItemToolButton: TToolButton;
262     NewItemToolButton: TToolButton;
263     ListDownloadToolButton: TToolButton;
264     ListThreadDownloadToolButton: TToolButton;
265     ToolButton2: TToolButton;
266     ToolButton1: TToolButton;
267 yoffy 1.2 BrowserCoolBar: TGikoCoolBar;
268 hi_ 1.1 BrowserToolBar: TToolBar;
269     BrowserSizeButton: TToolButton;
270     ToolButton3: TToolButton;
271     TopButton: TToolButton;
272 yoffy 1.2 LastBotton: TToolButton;
273     NewButton: TToolButton;
274 hi_ 1.1 KokoButton: TToolButton;
275     ToolButton9: TToolButton;
276 yoffy 1.2 EditorButton: TToolButton;
277 hi_ 1.1 ToolButton11: TToolButton;
278     IEButton: TToolButton;
279     ToolButton5: TToolButton;
280     ItemReloadButton: TToolButton;
281     ListNameToolBar: TToolBar;
282     ListNameLabel: TLabel;
283     FolderImage: TImage;
284     BrowserNameToolBar: TToolBar;
285     ItemBoardImage: TImage;
286     BrowserBoardNameLabel: TLabel;
287     ItemImage: TImage;
288     BrowserNameLabel: TLabel;
289     ActiveLogDeleteAction: TAction;
290     N24: TMenuItem;
291     D3: TMenuItem;
292     N25: TMenuItem;
293     N26: TMenuItem;
294     ListNameBarVisibleAction: TAction;
295     D4: TMenuItem;
296     BrowserNameBarVisibleAction: TAction;
297     S3: TMenuItem;
298     R2: TMenuItem;
299     TreeSelectNameURLCopy: TAction;
300     TreeSelectNameURLPupupMenu: TMenuItem;
301     N27: TMenuItem;
302     H3: TMenuItem;
303     PaneInitAction: TAction;
304     I1: TMenuItem;
305     BrowserTabToolBar: TToolBar;
306     BrowserTab: TTabControl;
307     ToolButton7: TToolButton;
308 yoffy 1.2 BrowserMinAction: TAction;
309 hi_ 1.1 About1: TMenuItem;
310     N28: TMenuItem;
311     SelectTextClearAction: TAction;
312     MailTextClearAction: TAction;
313     NameTextClearAction: TAction;
314     S4: TMenuItem;
315 yoffy 1.2 N29: TMenuItem;
316     N30: TMenuItem;
317 hi_ 1.1 LeftmostTabSelectAction: TAction;
318     LeftTabSelectAction: TAction;
319     RightTabSelectAction: TAction;
320     RightmostTabSelectAction: TAction;
321 yoffy 1.2 N31: TMenuItem;
322 hi_ 1.1 L5: TMenuItem;
323     L6: TMenuItem;
324     A7: TMenuItem;
325     R3: TMenuItem;
326     FavoriteMenu: TMenuItem;
327     FavoriteAddAction: TAction;
328     N32: TMenuItem;
329     BoardFavoriteAddMenu: TMenuItem;
330 yoffy 1.2 BoardFavoriteAddAction: TAction;
331 hi_ 1.1 ThreadFavoriteAddAction: TAction;
332     ThreadFavoriteAddMenu: TMenuItem;
333     TreeSelectFavoriteAddAction: TAction;
334 yoffy 1.2 N33: TMenuItem;
335 hi_ 1.1 TreeSelectFavoriteAddPupupMenu: TMenuItem;
336     FavoriteArrangeAction: TAction;
337     FavoriteTreeView: TTreeView;
338     StateIconImageList: TImageList;
339     TopPanel: TPanel;
340     TopRightPanel: TPanel;
341     AnimePanel: TPanel;
342     Animate: TAnimate;
343     TopCoolPanel: TPanel;
344 yoffy 1.2 MainCoolBar: TGikoCoolBar;
345 hi_ 1.1 MenuToolBar: TToolBar;
346     StdToolBar: TToolBar;
347 yoffy 1.2 RoundToolButton: TToolButton;
348 hi_ 1.1 ToolButton6: TToolButton;
349 yoffy 1.2 CabinetToolButton: TToolButton;
350 hi_ 1.1 ToolButton4: TToolButton;
351     ToolButton13: TToolButton;
352     AbortToolButton: TToolButton;
353     LoginToolButton: TToolButton;
354     AddressToolBar: TToolBar;
355     AddressComboBox: TComboBox;
356     MoveToToolButton: TToolButton;
357 yoffy 1.2 MoveToAction: TAction;
358 hi_ 1.1 AddressImageList: TImageList;
359     AddressBarVisibleAction: TAction;
360     AddressToolBarMenu: TMenuItem;
361     T4: TMenuItem;
362     BrowserTabVisibleAction: TAction;
363     Show1: TMenuItem;
364     N34: TMenuItem;
365     BrowserTabTopAction: TAction;
366 yoffy 1.2 BrowserTabBottomAction: TAction;
367 hi_ 1.1 T5: TMenuItem;
368     B5: TMenuItem;
369     N35: TMenuItem;
370     BrowserTabTabStyleAction: TAction;
371     BrowserTabButtonStyleAction: TAction;
372     BrowserTabFlatStyleAction: TAction;
373     A8: TMenuItem;
374     U2: TMenuItem;
375     F1: TMenuItem;
376     PreviewTimer: TTimer;
377     MonazillaWebPageAction: TAction;
378     MonazillaWebPageAction1: TMenuItem;
379     GikoHelpAction: TAction;
380     N36: TMenuItem;
381     H4: TMenuItem;
382     KotehanAction: TAction;
383     K3: TMenuItem;
384     LinkBarVisibleAction: TAction;
385     L7: TMenuItem;
386     N37: TMenuItem;
387     A9: TMenuItem;
388 yoffy 1.2 ChevronPopupMenu: TPopupMenu;
389 hi_ 1.1 BBS2chWebPageAction: TAction;
390 yoffy 1.2 N2N1: TMenuItem;
391 hi_ 1.1 N38: TMenuItem;
392     GikoFolderOpenAction: TAction;
393 yoffy 1.2 F2: TMenuItem;
394     LinkToolBar: TToolBar;
395     a10: TMenuItem;
396     ToolButton8: TToolButton;
397     ToolButton10: TToolButton;
398     ThreadEditorAction: TAction;
399     N39: TMenuItem;
400     T6: TMenuItem;
401     N40: TMenuItem;
402     LinkBarPopupMenu: TPopupMenu;
403     ToolBarSettingAction: TAction;
404     T7: TMenuItem;
405     ToolButton12: TToolButton;
406     ToolButton14: TToolButton;
407     ThreadPopupMenu: TPopupMenu;
408     MenuItem4: TMenuItem;
409     MenuItem5: TMenuItem;
410     MenuItem6: TMenuItem;
411     T8: TMenuItem;
412     NameCopyAction: TAction;
413     BoardIEAction: TAction;
414     URLN3: TMenuItem;
415     SelectItemNameCopyAction: TAction;
416     SelectItemNameCopyAction1: TMenuItem;
417     B6: TMenuItem;
418     T9: TMenuItem;
419     C2: TMenuItem;
420     SelectComboBox: TComboBox;
421     MainCoolBarPopupMenu: TPopupMenu;
422     StdToolBarVisiblePMenu: TMenuItem;
423     AddressToolBarVisiblePMenu: TMenuItem;
424     LinkToolBarVisiblePMenu: TMenuItem;
425 h677 1.6 NG1: TMenuItem;
426     NG2: TMenuItem;
427     N43: TMenuItem;
428 yoffy 1.9 N44: TMenuItem;
429     L9: TMenuItem;
430     I3: TMenuItem;
431     N45: TMenuItem;
432     B9: TMenuItem;
433     R5: TMenuItem;
434     T12: TMenuItem;
435     Show3: TMenuItem;
436     N46: TMenuItem;
437     T13: TMenuItem;
438     B10: TMenuItem;
439     N47: TMenuItem;
440     A12: TMenuItem;
441     U4: TMenuItem;
442     F4: TMenuItem;
443     N48: TMenuItem;
444     T14: TMenuItem;
445 yoffy 1.12 SelectItemToolButton: TToolButton;
446     SelectResToolButton: TToolButton;
447     SelectResAction: TAction;
448 yoffy 1.13 ToolButton16: TToolButton;
449 yoffy 1.18 AllResAction: TAction;
450     AllResToolButton: TToolButton;
451 yoffy 1.25 N50: TMenuItem;
452     A11: TMenuItem;
453     S5: TMenuItem;
454 h677 1.24 Reload: TMenuItem;
455     GoBack: TMenuItem;
456     GoFoward: TMenuItem;
457     EditAction: TAction;
458     ReloadAction: TAction;
459     GoFowardAction: TAction;
460     GoBackAction: TAction;
461 yoffy 1.29 SelectComboBoxSplitter: TImage;
462 hi_ 1.1 procedure FormCreate(Sender: TObject);
463     procedure FormDestroy(Sender: TObject);
464     procedure CabinetPanelHide(Sender: TObject);
465     procedure FormClose(Sender: TObject; var Action: TCloseAction);
466     procedure TreeViewChange(Sender: TObject; Node: TTreeNode);
467     procedure ListViewData(Sender: TObject; Item: TListItem);
468     procedure ListViewDataFind(Sender: TObject; Find: TItemFind;
469     const FindString: String; const FindPosition: TPoint;
470     FindData: Pointer; StartIndex: Integer; Direction: TSearchDirection;
471     Wrap: Boolean; var Index: Integer);
472     procedure ListViewDataHint(Sender: TObject; StartIndex,
473     EndIndex: Integer);
474     procedure ListViewDataStateChange(Sender: TObject; StartIndex,
475     EndIndex: Integer; OldState, NewState: TItemStates);
476     procedure BrowserStatusTextChange(Sender: TObject;
477     const Text: WideString);
478     procedure BrowserTitleChange(Sender: TObject; const Text: WideString);
479     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
480     procedure TreeViewChanging(Sender: TObject; Node: TTreeNode;
481     var AllowChange: Boolean);
482     procedure ListViewKeyDown(Sender: TObject; var Key: Word;
483     Shift: TShiftState);
484     procedure ListViewColumnClick(Sender: TObject; Column: TListColumn);
485     procedure MenuToolBarCustomDrawButton(Sender: TToolBar;
486     Button: TToolButton; State: TCustomDrawState;
487     var DefaultDraw: Boolean);
488     procedure BrowserBeforeNavigate2(Sender: TObject;
489     const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
490     Headers: OleVariant; var Cancel: WordBool);
491     procedure ListViewAdvancedCustomDrawItem(Sender: TCustomListView;
492     Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
493     var DefaultDraw: Boolean);
494     procedure TreeViewCustomDraw(Sender: TCustomTreeView;
495     const ARect: TRect; var DefaultDraw: Boolean);
496     procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
497     Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
498     procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
499     procedure TreeViewDblClick(Sender: TObject);
500     procedure ListViewCustomDraw(Sender: TCustomListView;
501     const ARect: TRect; var DefaultDraw: Boolean);
502     procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
503     Shift: TShiftState; X, Y: Integer);
504     procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode);
505     procedure MessageListViewResize(Sender: TObject);
506     procedure ExitActionExecute(Sender: TObject);
507     procedure AllSelectActionExecute(Sender: TObject);
508     procedure StdToolBarVisibleActionExecute(Sender: TObject);
509     procedure MsgBarVisibleActionExecute(Sender: TObject);
510     procedure StatusBarVisibleActionExecute(Sender: TObject);
511     procedure LargeIconActionExecute(Sender: TObject);
512     procedure SmallIconActionExecute(Sender: TObject);
513     procedure ListIconActionExecute(Sender: TObject);
514     procedure DetailIconActionExecute(Sender: TObject);
515     procedure SearchActionExecute(Sender: TObject);
516     procedure OptionActionExecute(Sender: TObject);
517     procedure GikoNaviWebPageActionExecute(Sender: TObject);
518     procedure AboutActionExecute(Sender: TObject);
519     procedure Cabinet2chActionExecute(Sender: TObject);
520     procedure CabinetHistoryActionExecute(Sender: TObject);
521     procedure CabinetVisibleActionExecute(Sender: TObject);
522     procedure AllItemActionExecute(Sender: TObject);
523     procedure LogItemActionExecute(Sender: TObject);
524     procedure NewItemActionExecute(Sender: TObject);
525     procedure SelectItemActionExecute(Sender: TObject);
526     procedure ListNumberVisibleActionExecute(Sender: TObject);
527     procedure UpFolderActionExecute(Sender: TObject);
528     procedure IconStyleExecute(Sender: TObject);
529     procedure RoundActionExecute(Sender: TObject);
530     procedure StopActionExecute(Sender: TObject);
531     procedure MsgBarCloseActionExecute(Sender: TObject);
532     procedure BrowserMaxActionExecute(Sender: TObject);
533     procedure ScrollTopActionExecute(Sender: TObject);
534     procedure ScrollLastActionExecute(Sender: TObject);
535     procedure ScrollNewActionExecute(Sender: TObject);
536     procedure ScrollKokoActionExecute(Sender: TObject);
537     procedure EditorActionExecute(Sender: TObject);
538     procedure IEActionExecute(Sender: TObject);
539     procedure ShowThreadActionExecute(Sender: TObject);
540     procedure ShowBoardActionExecute(Sender: TObject);
541     procedure URLCopyActionExecute(Sender: TObject);
542     procedure ItemReloadActionExecute(Sender: TObject);
543     procedure SelectListReloadActionExecute(Sender: TObject);
544     procedure SelectThreadReloadActionExecute(Sender: TObject);
545     procedure SelectListReloadActionUpdate(Sender: TObject);
546     procedure AllItemActionUpdate(Sender: TObject);
547     procedure LogItemActionUpdate(Sender: TObject);
548     procedure NewItemActionUpdate(Sender: TObject);
549     procedure SelectItemActionUpdate(Sender: TObject);
550     procedure UpFolderActionUpdate(Sender: TObject);
551     procedure FormResize(Sender: TObject);
552     procedure ScrollTopActionUpdate(Sender: TObject);
553     procedure ScrollLastActionUpdate(Sender: TObject);
554     procedure ScrollNewActionUpdate(Sender: TObject);
555     procedure ScrollKokoActionUpdate(Sender: TObject);
556     procedure EditorActionUpdate(Sender: TObject);
557     procedure IEActionUpdate(Sender: TObject);
558     procedure ShowThreadActionUpdate(Sender: TObject);
559     procedure ShowBoardActionUpdate(Sender: TObject);
560     procedure SelectThreadReloadActionUpdate(Sender: TObject);
561     procedure ListViewSelectItem(Sender: TObject; Item: TListItem;
562     Selected: Boolean);
563     procedure SelectTimerTimer(Sender: TObject);
564     procedure ItemReloadActionUpdate(Sender: TObject);
565     procedure ListViewDblClick(Sender: TObject);
566     procedure LogDeleteActionExecute(Sender: TObject);
567     procedure KokomadeActionExecute(Sender: TObject);
568     procedure ZenbuActionExecute(Sender: TObject);
569     procedure KokoResActionExecute(Sender: TObject);
570     procedure ListPopupMenuPopup(Sender: TObject);
571     procedure SelectItemURLCopyActionExecute(Sender: TObject);
572     procedure SelectItemURLCopyActionUpdate(Sender: TObject);
573     procedure AllSelectActionUpdate(Sender: TObject);
574     procedure LogDeleteActionUpdate(Sender: TObject);
575     procedure BrowserTabCloseActionExecute(Sender: TObject);
576     procedure NotSelectTabCloseActionExecute(Sender: TObject);
577     procedure TreeSelectBoradReloadExecute(Sender: TObject);
578     procedure TreeSelectThreadReloadExecute(Sender: TObject);
579     procedure TreeSelectURLCopyExecute(Sender: TObject);
580     procedure TreePopupMenuPopup(Sender: TObject);
581     procedure ListToolBarVisibleActionExecute(Sender: TObject);
582     procedure BrowserToolBarVisibleActionExecute(Sender: TObject);
583     procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch;
584     var Cancel: WordBool);
585     procedure ListSplitterCanResize(Sender: TObject; var NewSize: Integer;
586     var Accept: Boolean);
587     procedure ListSplitterMoved(Sender: TObject);
588     procedure BrowserTabChange(Sender: TObject);
589     procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton;
590     Shift: TShiftState; X, Y: Integer);
591     procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer;
592     State: TDragState; var Accept: Boolean);
593     procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer);
594     procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X,
595     Y: Integer);
596     procedure BrowserDocumentComplete(Sender: TObject;
597     const pDisp: IDispatch; var URL: OleVariant);
598     procedure SelectReservActionUpdate(Sender: TObject);
599     procedure RoundNamePopupMenuPopup(Sender: TObject);
600     procedure SelectNewRoundNameExecute(Sender: TObject);
601     procedure SelectDeleteRoundExecute(Sender: TObject);
602     procedure SelectReservActionExecute(Sender: TObject);
603     procedure NewBoardActionExecute(Sender: TObject);
604     procedure LoginActionExecute(Sender: TObject);
605     procedure KeySettingActionExecute(Sender: TObject);
606     procedure AllTabCloseActionExecute(Sender: TObject);
607     procedure ArrangeActionExecute(Sender: TObject);
608     procedure NameURLCopyActionExecute(Sender: TObject);
609     procedure SelectItemNameURLCopyActionExecute(Sender: TObject);
610     procedure URLCopyActionUpdate(Sender: TObject);
611 yoffy 1.2 procedure NameURLCopyActionUpdate(Sender: TObject);
612 hi_ 1.1 procedure BrowserTabCloseActionUpdate(Sender: TObject);
613     procedure NotSelectTabCloseActionUpdate(Sender: TObject);
614     procedure AllTabCloseActionUpdate(Sender: TObject);
615     procedure SelectItemNameURLCopyActionUpdate(Sender: TObject);
616     procedure ActiveLogDeleteActionExecute(Sender: TObject);
617     procedure ActiveLogDeleteActionUpdate(Sender: TObject);
618     procedure ListNameBarVisibleActionExecute(Sender: TObject);
619     procedure BrowserNameBarVisibleActionExecute(Sender: TObject);
620     procedure TreeSelectNameURLCopyExecute(Sender: TObject);
621     procedure PaneInitActionExecute(Sender: TObject);
622     procedure FormShow(Sender: TObject);
623     procedure BrowserTabToolBarResize(Sender: TObject);
624     procedure BrowserMinActionExecute(Sender: TObject);
625     procedure SelectTextClearActionExecute(Sender: TObject);
626     procedure NameTextClearActionExecute(Sender: TObject);
627     procedure MailTextClearActionExecute(Sender: TObject);
628     procedure LeftmostTabSelectActionExecute(Sender: TObject);
629     procedure LeftTabSelectActionExecute(Sender: TObject);
630     procedure RightTabSelectActionExecute(Sender: TObject);
631     procedure RightmostTabSelectActionExecute(Sender: TObject);
632     procedure LeftmostTabSelectActionUpdate(Sender: TObject);
633     procedure LeftTabSelectActionUpdate(Sender: TObject);
634     procedure RightTabSelectActionUpdate(Sender: TObject);
635     procedure RightmostTabSelectActionUpdate(Sender: TObject);
636     procedure FavoriteMenuClick(Sender: TObject);
637     procedure FavoriteAddActionExecute(Sender: TObject);
638     procedure FavoriteAddActionUpdate(Sender: TObject);
639     procedure BoardFavoriteAddActionExecute(Sender: TObject);
640     procedure BoardFavoriteAddActionUpdate(Sender: TObject);
641     procedure ThreadFavoriteAddActionExecute(Sender: TObject);
642     procedure ThreadFavoriteAddActionUpdate(Sender: TObject);
643     procedure TreeSelectFavoriteAddActionExecute(Sender: TObject);
644 yoffy 1.2 procedure FavoriteArrangeActionExecute(Sender: TObject);
645     procedure MainCoolBarResize(Sender: TObject);
646 hi_ 1.1 procedure MoveToActionExecute(Sender: TObject);
647 yoffy 1.2 procedure AddressToolBarResize(Sender: TObject);
648 hi_ 1.1 procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word;
649     Shift: TShiftState);
650     procedure AddressBarVisibleActionExecute(Sender: TObject);
651 yoffy 1.2 procedure BrowserEnter(Sender: TObject);
652 hi_ 1.1 procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean);
653     procedure BrowserTabVisibleActionExecute(Sender: TObject);
654     procedure BrowserTabTopActionExecute(Sender: TObject);
655     procedure BrowserTabBottomActionExecute(Sender: TObject);
656     procedure BrowserTabTabStyleActionExecute(Sender: TObject);
657     procedure BrowserTabButtonStyleActionExecute(Sender: TObject);
658     procedure BrowserTabFlatStyleActionExecute(Sender: TObject);
659     procedure PreviewTimerTimer(Sender: TObject);
660     procedure MessageHideButtonClick(Sender: TObject);
661     procedure MonazillaWebPageActionExecute(Sender: TObject);
662     procedure GikoHelpActionExecute(Sender: TObject);
663     procedure ToolButton18Click(Sender: TObject);
664     procedure KotehanActionExecute(Sender: TObject);
665     procedure LinkBarVisibleActionExecute(Sender: TObject);
666     procedure BBS2chWebPageActionExecute(Sender: TObject);
667     procedure GikoFolderOpenActionExecute(Sender: TObject);
668 yoffy 1.2 procedure MainCoolBarBandInfo(Sender: TObject;
669     var BandInfo: PReBarBandInfoA);
670     procedure MainCoolBarChevronClick(Sender: TObject;
671     RebarChevron: PNMRebarChevron);
672     procedure ListCoolBarBandInfo(Sender: TObject;
673     var BandInfo: PReBarBandInfoA);
674     procedure ListCoolBarChevronClick(Sender: TObject;
675     RebarChevron: PNMRebarChevron);
676     procedure BrowserCoolBarBandInfo(Sender: TObject;
677     var BandInfo: PReBarBandInfoA);
678     procedure BrowserCoolBarChevronClick(Sender: TObject;
679     RebarChevron: PNMRebarChevron);
680     procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA);
681     procedure ThreadEditorActionExecute(Sender: TObject);
682     procedure ThreadEditorActionUpdate(Sender: TObject);
683     procedure ToolBarSettingActionExecute(Sender: TObject);
684     procedure NameCopyActionExecute(Sender: TObject);
685     procedure BoardIEActionExecute(Sender: TObject);
686     procedure SelectItemNameCopyActionExecute(Sender: TObject);
687     procedure SelectItemNameCopyActionUpdate(Sender: TObject);
688     procedure BoardIEActionUpdate(Sender: TObject);
689     procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
690     WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
691     procedure NameCopyActionUpdate(Sender: TObject);
692     procedure SelectComboBoxChange(Sender: TObject);
693     procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word;
694     Shift: TShiftState);
695     procedure SelectComboBoxExit(Sender: TObject);
696 h677 1.6 procedure NG1Click(Sender: TObject);
697 yoffy 1.12 procedure SelectResActionExecute(Sender: TObject);
698     procedure SelectResActionUpdate(Sender: TObject);
699 h677 1.14 procedure FormKeyDown(Sender: TObject; var Key: Word;
700     Shift: TShiftState);
701     procedure FormKeyUp(Sender: TObject; var Key: Word;
702     Shift: TShiftState);
703 yoffy 1.18 procedure AllResActionExecute(Sender: TObject);
704     procedure AllResActionUpdate(Sender: TObject);
705 h677 1.24 procedure ReloadClick(Sender: TObject);
706     procedure GoBackClick(Sender: TObject);
707     procedure GoFowardClick(Sender: TObject);
708 yoffy 1.27 procedure ListCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
709     var Handled: Boolean);
710     procedure BrowserCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
711     var Handled: Boolean);
712     procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint;
713     var Handled: Boolean);
714 yoffy 1.29 procedure SelectComboBoxSplitterMouseMove(Sender: TObject;
715     Shift: TShiftState; X, Y: Integer);
716     procedure SelectComboBoxSplitterMouseDown(Sender: TObject;
717     Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
718     procedure SelectComboBoxSplitterMouseUp(Sender: TObject;
719     Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
720 hi_ 1.1 private
721     { Private 鐃緒申鐃緒申 }
722    
723     FSortIndex: Integer;
724     FSortOrder: Boolean;
725    
726     FEnabledCloseButton: Boolean;
727     // ThreadCreate: TThreadCreate;
728    
729     FClickNode: TTreeNode;
730     FHttpState: Boolean;
731     FHint: TResPopup;
732     FPreviewBrowser: TPreviewBrowser;
733     FPreviewURL: string;
734    
735     FBrowserSizeHeight: Integer;
736     FBrowserSizeWidth: Integer;
737    
738     // FFavorite: TFavorite;
739     FBrowserComplete: Boolean;
740     FTabHintIndex: Integer;
741     FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
742     FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?
743     FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?
744     FActiveList: TObject;
745     FActiveContent: TThreadItem; //
746     FHistoryList: TList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
747     FTreeType: TGikoTreeType;
748     FWorkCount: Integer;
749     FNameCookie: string;
750     FMailCookie: string;
751     // FLastRoundTime: TDateTime;
752     BrowserNullTab: TThreadItem;
753     // DoubleClickOccurred: array [TMouseButton] of Boolean;
754     FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
755     FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?
756     FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?
757 h677 1.14
758 yoffy 1.29 Fkeynum : Integer; //鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
759    
760     IsDraggingSelectComboBox : Boolean;
761     DraggingSelectComboBoxPosition : TPoint;
762    
763 hi_ 1.1 procedure SetBoardTreeNode;
764     function SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
765     function SetBoardListItem(Category: TCategory): Integer;
766     function SetThreadListItem(Board: TBoard): Integer;
767     // function GetRoundName(index: integer): string;
768    
769     procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
770     procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
771     procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer);
772     procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
773     procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
774    
775     procedure SetActiveList(Obj: TObject);
776     procedure ListClick;
777     procedure ListDoubleClick;
778     procedure BrowserMovement(AName: string);
779     procedure SelectListItem(List: TList);
780     // procedure SetProgressValue(Number: Integer; Value: Integer; Max: Integer = -1);
781     procedure InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True);
782     procedure DeleteTab(ThreadItem: TThreadItem);
783     function Hook(var Message: TMessage): Boolean;
784     procedure AddRoundNameMenu(MenuItem: TMenuItem);
785     procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string);
786     procedure SetSelectRoundName(Sender: TObject);
787     function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand;
788    
789     procedure SetMenuFont;
790     // procedure CreateFavMenu(Folder: TFavoriteFolder);
791     procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
792     procedure FavoriteClick(Sender: TObject);
793 yoffy 1.2 procedure SelectTreeNode(Item: TObject; CallEvent: Boolean);
794 hi_ 1.1 procedure MoveToURL(URL: string);
795     function OnDocumentContextMenu(Sender: TObject): WordBool;
796     // function GetThreadText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean): string;
797     procedure SetResPopupText(sBoard: string; sThread: string; StNum, ToNum: Integer; Title, First: Boolean);
798     procedure ShowTextPopup;
799     //procedure ShowTextPopup(HintData: THintData);
800 yoffy 1.2 // procedure SetStdToolBar;
801     // function GetAction(ActionName: string): TContainedAction;
802 hi_ 1.1 procedure SetLinkBar;
803     function GetWidthAllToolButton(ToolBar: TToolBar): Integer;
804 yoffy 1.2 procedure MenuBarChevronMenu;
805     procedure LinkBarChevronMenu;
806     procedure ToolBarChevronMenu(ToolBar: TToolBar);
807 yoffy 1.28 procedure ModifySelectList;
808 hi_ 1.1 protected
809     procedure CreateParams(var Params: TCreateParams); override;
810 yoffy 1.2 procedure WndProc(var Message: TMessage); override;
811 hi_ 1.1 procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR;
812     procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE;
813     procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
814     public
815     { Public 鐃緒申鐃緒申 }
816     // FDownload: TDownload;
817     FControlThread: TThreadControl;
818     procedure ReloadBBS;
819     function GetHttpState: Boolean;
820     procedure SetEnabledCloseButton(Enabled: Boolean);
821     function GetTreeNode(Data: TObject): TTreeNode;
822     procedure AppFormDeactivate(Sender: TObject);
823     // procedure CabinetPanelVisible(PanelVisible: Boolean);
824     procedure ListViewAllSelect;
825    
826     property ListStyle: TViewStyle read FListStyle write FListStyle;
827     property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible;
828     property ViewType: TGikoViewType read FViewType write FViewType;
829    
830     property NameCookie: string read FNameCookie write FNameCookie;
831     property MailCookie: string read FMailCookie write FMailCookie;
832    
833     procedure SetContent(ThreadItem: TThreadItem);
834     function GetActiveContent: TThreadItem;
835     function GetActiveList: TObject;
836    
837     property ActiveList: TObject read GetActiveList write SetActiveList;
838     // property LastRoundTime: TDateTime read FLastRoundTime write FLastRoundTime;
839    
840     procedure SetListViewType(AViewType: TGikoViewType); overload;
841     procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload;
842     procedure DownloadContent(ThreadItem: TThreadItem);
843     procedure DownloadList(Board: TBoard);
844     procedure PlaySound(SoundEventName: string);
845    
846     function AddHistory(ThreadItem: TThreadItem): Boolean;
847     procedure DeleteHistory(ThreadItem: TThreadItem);
848     procedure ClearHistory;
849     procedure Show2chTree;
850     procedure ShowHistoryTree;
851     procedure SetHistoryTreeNode;
852     // procedure SelectTreeNode(Item: TObject);
853     procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon);
854     procedure SetBrowserTabState;
855     // property Favorite: TFavorite read FFavorite write FFavorite;
856 yoffy 1.2 procedure SetToolBarPopup;
857 hi_ 1.1 published
858     property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton;
859     end;
860    
861     TFavoriteMenuItem = class(TMenuItem)
862     private
863     FData : Pointer;
864     public
865     property Data: Pointer read FData write FData;
866     end;
867    
868     TLinkToolButton = class(TToolButton)
869     private
870     FData : Pointer;
871     public
872     property Data: Pointer read FData write FData;
873     end;
874    
875     var
876     GikoForm: TGikoForm;
877    
878     implementation
879    
880     uses
881     About, Option, Round, Splash, Sort, ListSelect,
882     Search, NewBoard;
883    
884     const
885     CAPTION_NAME: string = '鐃?鐃?鐃?鐃?';
886     BLANK_HTML: string = 'about:blank';
887    
888 yoffy 1.2 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
889     ITEM_ICON_2CH1 = 0; //2ch鐃?鐃?鐃?鐃緒申
890     ITEM_ICON_2CH2 = 1; //2ch鐃?鐃?鐃?鐃緒申
891     ITEM_ICON_CATEGORY1 = 2; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
892     ITEM_ICON_CATEGORY2 = 3; //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
893     ITEM_ICON_BOARD1 = 4; //鐃緒申鐃?鐃?鐃?鐃緒申
894     ITEM_ICON_BOARD2 = 5; //鐃緒申鐃?鐃?鐃?鐃緒申
895     ITEM_ICON_THREADLOG1 = 6; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
896     ITEM_ICON_THREADLOG2 = 7; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
897     ITEM_ICON_THREAD1 = 8; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
898     ITEM_ICON_THREAD2 = 9; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?
899     ITEM_ICON_THREADNEW1 = 10; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
900     ITEM_ICON_THREADNEW2 = 11; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
901     ITEM_ICON_SORT1 = 12; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
902     ITEM_ICON_SORT2 = 13; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
903    
904     //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
905     TOOL_ICON_HEIGHT_MAX = 18; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
906     TOOL_ICON_HEIGHT_MIN = 19; //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
907     TOOL_ICON_HEIGHT_NORMAL = 20; //鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
908     TOOL_ICON_WIDTH_MAX = 21; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
909     TOOL_ICON_WIDTH_MIN = 22; //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
910     TOOL_ICON_WIDTH_NORMAL = 23; //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
911    
912     TOOL_ICON_FAV_FOLDER = 32; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申
913     TOOL_ICON_FAV_BOARD = 33; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
914     TOOL_ICON_FAV_THREAD = 34; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
915 hi_ 1.1
916     HTML_FILE_NAME = 'temp_preview.html';
917    
918     {$R *.DFM}
919    
920     procedure TGikoForm.CreateParams(var Params: TCreateParams);
921     begin
922     inherited;
923     if FormStyle in [fsNormal, fsStayOnTop] then begin
924     if BorderStyle in [bsSingle, bsSizeable] then begin
925     Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
926     Params.WndParent := 0;
927     end;
928     end;
929     end;
930    
931     procedure TGikoForm.FormCreate(Sender: TObject);
932     const
933     TVS_NOTOOLTIPS = $0080;
934     var
935     FileName: string;
936     Style: DWORD;
937     msg: string;
938     i: Integer;
939 yoffy 1.2 // CoolSet: TCoolSet;
940 hi_ 1.1 wp: TWindowPlacement;
941     begin
942     {$IFDEF DEBUG}
943     AllocConsole;
944     Writeln('============================================================');
945     Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申');
946     Writeln('');
947     Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?');
948     Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申');
949     Writeln('============================================================');
950     {$ENDIF}
951     Application.OnDeactivate := AppFormDeactivate;
952     Self.OnDeactivate := AppFormDeactivate;
953     Application.HookMainWindow(Hook);
954    
955     FTreeType := gttNone;
956    
957     //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申
958     Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
959    
960     //鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
961     RoundList := TRoundList.Create;
962     RoundList.LoadRoundFile;
963    
964     //BBS鐃緒申鐃緒申
965     BBS2ch := TBBS2ch.Create(GikoSys.Setting.LogFolder);
966    
967     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
968     // FFavorite := TFavorite.Create(FavoriteTreeView);
969     FavoriteDM.SetFavTreeView(FavoriteTreeView);
970     FavoriteDM.ReadFavorite;
971    
972     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
973     AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
974    
975     EnabledCloseButton := True;
976     BoardGroup.BBS2ch.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
977     // SetBoardTreeNode; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
978     Show2chTree;
979    
980     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
981     ListView.ViewStyle := GikoSys.Setting.ListStyle;
982    
983     //鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
984     // MainCoolBar.Top := 0;
985     // MainCoolBar.Left := 0;
986    
987     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?
988     AnimePanel.Top := 0;
989     AnimePanel.Left := 0;
990    
991     //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
992    
993     //鐃?鐃緒申鐃?鐃?鐃?鐃?
994     CabinetVisibleAction.Checked := not GikoSys.Setting.CabinetVisible;
995     CabinetVisibleAction.Execute;
996     CabinetPanel.Width := GikoSys.Setting.CabinetWidth;
997    
998     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?
999     MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible;
1000     MsgBarVisibleActionExecute(nil);
1001     MessagePanel.Height := GikoSys.Setting.MessegeBarHeight;
1002    
1003     //鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1004     StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible;
1005     StatusBarVisibleActionExecute(nil);
1006    
1007     //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申
1008     TreeView.Items.BeginUpdate;
1009     ListView.Items.BeginUpdate;
1010     try
1011     TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1012     TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1013     TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1014     TreeView.Color := GikoSys.Setting.CabinetBackColor;
1015    
1016     ListView.Font.Name := GikoSys.Setting.ListFontName;
1017     ListView.Font.Size := GikoSys.Setting.ListFontSize;
1018     ListView.Font.Color := GikoSys.Setting.ListFontColor;
1019     ListView.Color := GikoSys.Setting.ListBackColor;
1020     finally
1021     TreeView.Items.EndUpdate;
1022     ListView.Items.EndUpdate;
1023     end;
1024     //ViewNoButton.Down := GikoSys.Setting.ListViewNo;
1025     ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo;
1026    
1027     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1028     BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1029     BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1030    
1031    
1032     // TreeView.TopItem.Expanded := True; //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1033     // TreeView.Selected := TreeView.Items[0]; //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1034     SetContent(nil); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1035    
1036     //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1037     wp.length := sizeof(wp);
1038     wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop;
1039     wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft;
1040     wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight;
1041     wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth;
1042     wp.showCmd := SW_HIDE;
1043     SetWindowPlacement(Handle, @wp);
1044    
1045     // SetBounds(GikoSys.Setting.WindowLeft, GikoSys.Setting.WindowTop,
1046     // GikoSys.Setting.WindowWidth, GikoSys.Setting.WindowHeight);
1047     if GikoSys.Setting.WindowMax then
1048     WindowState := wsMaximized;
1049    
1050     //鐃?鐃?鐃?鐃?鐃緒申
1051     try
1052     FileName := GikoSys.GetAppDir + 'gikoNavi.avi';
1053     if FileExists(FileName) then
1054     Animate.FileName := FileName;
1055     except
1056     end;
1057     // AnimePanel.Height := 26;
1058     // AnimePanel.Width := 39;
1059     // AnimePanel.Top := 2;
1060     // AnimePanel.Left := Width - 48;
1061    
1062     //鐃?鐃?鐃?鐃?
1063     FNameCookie := '';
1064     FMailCookie := '';
1065    
1066     //鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1067     AllItemAction.Checked := True;
1068 yoffy 1.18 AllResAction.Checked := True;
1069 hi_ 1.1
1070     //TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申
1071     Style := GetWindowLong(TreeView.Handle, GWL_STYLE);
1072     Style := Style or TVS_NOTOOLTIPS;
1073     SetWindowLong(TreeView.Handle, GWL_STYLE, Style);
1074    
1075     // 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1076     TreeView.Align := alClient;
1077     FavoriteTreeView.Visible := False;
1078    
1079     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1080     // FBrowserSizeFlag := False;
1081     // FBrowserSizeHeight := ViewPanel.Height;
1082    
1083     FBrowserSizeHeight := GikoSys.Setting.ListHeight;
1084     FBrowserSizeWidth := GikoSys.Setting.ListWidth;
1085    
1086     ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical);
1087     ArrangeAction.Execute;
1088    
1089     if GikoSys.Setting.ListOrientation = gloHorizontal then begin
1090     case GikoSys.Setting.ListWidthState of
1091     glsMax: begin
1092     ViewPanel.Width := 1;
1093 yoffy 1.2 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1094     BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1095 hi_ 1.1 end;
1096     glsMin: begin
1097     ViewPanel.Width := GikoSys.Setting.ListWidth;
1098 yoffy 1.2 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1099     BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1100 hi_ 1.1 end;
1101     else begin
1102     ViewPanel.Width := GikoSys.Setting.ListWidth;
1103 yoffy 1.2 BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1104     BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1105 hi_ 1.1 end;
1106     end;
1107     // if GikoSys.Setting.ListWidthMax then begin
1108     // ViewPanel.Width := 1;
1109     // BrowserSizeAction.ImageIndex := ICON_WIDTH_MIN;
1110     // end else begin
1111     // ViewPanel.Width := GikoSys.Setting.ListWidth;
1112     // BrowserSizeAction.ImageIndex := ICON_WIDTH_MAX;
1113     // end;
1114     end else begin
1115     case GikoSys.Setting.ListHeightState of
1116     glsMax: begin
1117     ViewPanel.Height := 1;
1118 yoffy 1.2 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1119     BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1120 hi_ 1.1 end;
1121     glsMin: begin
1122     ViewPanel.Height := GikoSys.Setting.ListHeight;
1123 yoffy 1.2 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1124     BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1125 hi_ 1.1 end;
1126     else begin
1127     ViewPanel.Height := GikoSys.Setting.ListHeight;
1128 yoffy 1.2 BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1129     BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1130 hi_ 1.1 end;
1131     end;
1132     // if GikoSys.Setting.ListHeightState = glsMax then begin
1133     // end else begin
1134     // ViewPanel.Height := GikoSys.Setting.ListHeight;
1135     // BrowserSizeAction.ImageIndex := ICON_HEIGHT_MAX;
1136     // end;
1137     end;
1138    
1139     //鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1140     // ProgressBar.Visible := False;
1141     ProgressBar.Parent := StatusBar;
1142     ProgressBar.Top := 2;
1143     ProgressBar.Left := 0;
1144     ProgressBar.Width := StatusBar.Panels[0].Width;
1145     ProgressBar.Height := StatusBar.Height - 2;
1146     ProgressBar.Position := 0;
1147    
1148     //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1149     //formshow()鐃緒申鐃緒申鐃緒申
1150 yoffy 1.2
1151 hi_ 1.1 //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1152     // FDownload := TDownload.Create;
1153     // FDownload.OnDownloadEnd := OnDonloadEnd;
1154     // FDownload.OnWork := Work;
1155     // FDownload.OnWorkBegin := WorkBegin;
1156     // FDownload.OnWorkEnd := WorkEnd;
1157    
1158     //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?
1159     FControlThread := TThreadControl.Create(True);
1160     FControlThread.MaxThreadCount := 1;
1161     FControlThread.Resume;
1162     FControlThread.OnDownloadEnd := DownloadEnd;
1163     FControlThread.OnDownloadMsg := DownloadMsg;
1164     FControlThread.OnWork := Work;
1165     FControlThread.OnWorkBegin := WorkBegin;
1166     FControlThread.OnWorkEnd := WorkEnd;
1167     // ProgressPanel.Width := FControlThread.MaxThreadCount * 12;
1168    
1169     //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1170     FHistoryList := TList.Create;
1171    
1172 yoffy 1.2 // 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1173     SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList );
1174    
1175 hi_ 1.1 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申
1176     SetBrowserTabState;
1177    
1178     BrowserBoardNameLabel.Caption := '';
1179     BrowserNameLabel.Caption := '';
1180     FWorkCount := 0;
1181    
1182     // DetailIconAction.Execute;
1183    
1184     // FBrowserSizeHeight := ViewPanel.Height;
1185     FTabHintIndex := -1;
1186    
1187     //鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1188     // if not GikoSys.DirectoryExistsEx(BBS2ch.GetLogFolder) then begin
1189     // GikoSys.ForceDirectoriesEx(BBS2ch.GetLogFolder);
1190     // end;
1191     // FormResize(Sender);
1192     // MainCoolBarResize(Sender);
1193     // Application.ProcessMessages;
1194    
1195     //鐃緒申鐃緒申鐃?鐃?鐃?
1196     SetLinkBar;
1197    
1198     //鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?
1199     SetMenuFont;
1200    
1201     //鐃?鐃?鐃緒申鐃?鐃?Wrapable
1202     ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable;
1203     BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable;
1204    
1205 yoffy 1.2 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1206     ReadToolBarSetting(ActionList, StdToolBar);
1207     ReadToolBarSetting(ActionList, ListToolBar);
1208 yoffy 1.29 try
1209     for i := ListToolBar.ControlCount - 1 downto 0 do
1210     begin
1211     if ListToolBar.Controls[ i ].Action = SelectItemAction then
1212     begin
1213     // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申
1214     if (i + 1) < ListToolBar.ControlCount then
1215     if ListToolBar.Controls[ i + 1 ] is TToolButton then
1216     if TToolButton( ListToolBar.Controls[ i + 1 ] ).Style = tbsSeparator then
1217     ListToolBar.Controls[ i + 1 ].Visible := False;
1218    
1219     // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申
1220     ListToolBar.Controls[ i ].Visible := False;
1221     // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申
1222     SelectComboBox.Left := ListToolBar.Controls[ i ].Left;
1223     SelectComboBox.Width := GikoSys.Setting.SelectComboBoxWidth;
1224     SelectComboBox.Parent := ListToolBar;
1225     // 鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申
1226     SelectComboBoxSplitter.Left := SelectComboBox.Left + SelectComboBox.Width;
1227     SelectComboBoxSplitter.Parent := ListToolBar;
1228    
1229     break;
1230     end;
1231     end;
1232     except
1233 yoffy 1.25 end;
1234 yoffy 1.2 ReadToolBarSetting(ActionList, BrowserToolBar);
1235     SetToolBarPopup;
1236    
1237 hi_ 1.1 //鐃?鐃?鐃緒申鐃?鐃?鐃?
1238     AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1239    
1240 yoffy 1.2 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1241    
1242     //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1243     if not FileExists(GikoSys.GetBoardFileName) then begin
1244     msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10
1245     + '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10
1246     + '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
1247     MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION);
1248     NewBoardAction.Execute;
1249     end;
1250    
1251     //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1252     GikoSys.LoadKeySetting(ActionList);
1253    
1254     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1255     // FLastRoundTime := 0;
1256    
1257     //ResHint
1258     FHint := TResPopup.Create(Self);
1259    
1260     //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1261     if GikoSys.Setting.AutoLogin then
1262     LoginAction.Execute;
1263    
1264     //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?
1265     for i := 1 to ParamCount do begin
1266     MoveToURL(ParamStr(i));
1267     end;
1268     // SetStdToolBar;
1269     // SetLinkBar;
1270 h677 1.22
1271     StatusBar.Panels.Items[2].Text := GikoSys.FAbon.NGwordname;
1272 yoffy 1.2 end;
1273    
1274     //
1275     //
1276     //
1277     procedure TGikoForm.FormShow(Sender: TObject);
1278     var
1279     i: Integer;
1280     CoolSet: TCoolSet;
1281     begin
1282     ShowWindow(Application.Handle, SW_HIDE);
1283    
1284     //FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1285     //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1286     StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
1287     StdToolBarVisibleActionExecute( nil );
1288     AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible;
1289     AddressBarVisibleActionExecute( nil );
1290     LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible;
1291     LinkBarVisibleActionExecute( nil );
1292     ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible;
1293     ListToolBarVisibleActionExecute( nil );
1294     ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible;
1295     ListNameBarVisibleActionExecute( nil );
1296     BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible;
1297     BrowserToolBarVisibleActionExecute( nil );
1298     BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible;
1299     BrowserNameBarVisibleActionExecute( nil );
1300    
1301     //鐃?鐃緒申鐃?鐃?鐃?鐃?
1302     BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible;
1303     BrowserTabVisibleActionExecute(nil);
1304    
1305     if GikoSys.Setting.BrowserTabPosition = gtpTop then begin
1306     BrowserTabTopAction.Checked := True;
1307     BrowserTabTopActionExecute(nil);
1308     end else begin
1309     BrowserTabBottomAction.Checked := True;
1310     BrowserTabBottomActionExecute(nil);
1311     end;
1312    
1313     if GikoSys.Setting.BrowserTabStyle = gtsTab then begin
1314     BrowserTabTabStyleAction.Checked := True;
1315     BrowserTabTabStyleActionExecute(nil);
1316     end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin
1317     BrowserTabButtonStyleAction.Checked := True;
1318     BrowserTabButtonStyleActionExecute(nil);
1319     end else begin
1320     BrowserTabFlatStyleAction.Checked := True;
1321     BrowserTabFlatStyleActionExecute(nil);
1322     end;
1323    
1324    
1325 hi_ 1.1 //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1326     MainCoolBar.Bands.BeginUpdate;
1327     try
1328     for i := 0 to MainCoolBar.Bands.Count - 1 do begin
1329     CoolSet := GikoSys.Setting.MainCoolSet[i];
1330     if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1331     Continue;
1332     MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1333     MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1334     MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1335     end;
1336     finally
1337     MainCoolBar.Bands.EndUpdate;
1338     end;
1339    
1340     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1341     ListCoolBar.Bands.BeginUpdate;
1342     try
1343     for i := 0 to ListCoolBar.Bands.Count - 1 do begin
1344     CoolSet := GikoSys.Setting.ListCoolSet[i];
1345     if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1346     Continue;
1347     ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1348     ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1349     ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1350     end;
1351     finally
1352     ListCoolBar.Bands.EndUpdate;
1353     end;
1354    
1355     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1356     BrowserCoolBar.Bands.BeginUpdate;
1357     try
1358     for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin
1359     CoolSet := GikoSys.Setting.BrowserCoolSet[i];
1360     if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then
1361     Continue;
1362     BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i;
1363     BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak;
1364     BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth;
1365     end;
1366     finally
1367     BrowserCoolBar.Bands.EndUpdate;
1368     end;
1369    
1370     end;
1371 yoffy 1.2 {
1372 hi_ 1.1 procedure TGikoForm.SetStdToolBar;
1373     var
1374     i: Integer;
1375     FileName: string;
1376     ini: TMemIniFile;
1377     s: string;
1378     Action: TContainedAction;
1379     ToolButton: TToolButton;
1380     begin
1381     exit;
1382     for i := StdToolBar.ButtonCount - 1 downto 0 do begin
1383     StdToolBar.RemoveControl(StdToolBar.Buttons[i]);
1384     //StdToolBar.Buttons[i].Free;
1385     end;
1386     FileName := GikoSys.GetConfigDir + 'ToolBar.ini';
1387     ini := TMemIniFile.Create(FileName);
1388     i := 0;
1389     while true do begin
1390     s := ini.ReadString('StdToolBar', IntToStr(i), '');
1391     if s = '' then
1392     Break;
1393     if s = '-' then begin
1394     ToolButton := TToolButton.Create(StdToolBar);
1395     ToolButton.Style := tbsSeparator;
1396     ToolButton.Width := 8;
1397     ToolButton.Left := 10000;
1398     StdToolBar.InsertControl(ToolButton);
1399     end else begin
1400     Action := GetAction(s);
1401     if Action <> nil then begin
1402     ToolButton := TToolButton.Create(StdToolBar);
1403     ToolButton.Action := Action;
1404     ToolButton.Left := 10000;
1405     StdToolBar.InsertControl(ToolButton);
1406     end;
1407     end;
1408     Inc(i);
1409     end;
1410     end;
1411 yoffy 1.2 }
1412     {function TGikoForm.GetAction(ActionName: string): TContainedAction;
1413 hi_ 1.1 var
1414     i: Integer;
1415     begin
1416     for i := 0 to ActionList.ActionCount - 1 do begin
1417     if ActionList.Actions[i].Name = ActionName then begin
1418     Result := ActionList.Actions[i];
1419     Exit;
1420     end;
1421     end;
1422     Result := nil;
1423 yoffy 1.2 end;}
1424 hi_ 1.1
1425     procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
1426     var
1427     i: Integer;
1428     CoolSet: TCoolSet;
1429     wp: TWindowPlacement;
1430     begin
1431 yoffy 1.2 // if not EnabledCloseButton then begin
1432     // CanClose := False;
1433     // Exit;
1434     // end;
1435    
1436 hi_ 1.1 CanClose := True;
1437     Application.OnDeactivate := nil;
1438     Self.OnDeactivate := nil;
1439    
1440 yoffy 1.2 //column鐃緒申
1441     if GetActiveList is TBBS2ch then begin
1442     for i := 0 to ListView.Columns.Count - 1 do
1443     GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
1444     end else if GetActiveList is TCategory then begin
1445     for i := 0 to ListView.Columns.Count - 1 do
1446     GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
1447     end else if GetActiveList is TBoard then begin
1448     for i := 0 to ListView.Columns.Count - 1 do
1449     GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1450     end;
1451    
1452     //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1453     wp.length := sizeof(wp);
1454     GetWindowPlacement(Handle, @wp);
1455     GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1456     GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1457     GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1458     GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1459     GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1460    
1461     GikoSys.Setting.ListStyle := ListView.ViewStyle;
1462     GikoSys.Setting.CabinetVisible := CabinetVisibleAction.Checked;
1463     GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1464     GikoSys.Setting.ListHeight := FBrowserSizeHeight;
1465     GikoSys.Setting.ListWidth := FBrowserSizeWidth;
1466     if ArrangeAction.Checked then
1467     GikoSys.Setting.ListOrientation := gloVertical
1468     else
1469     GikoSys.Setting.ListOrientation := gloHorizontal;
1470     GikoSys.Setting.MessegeBarHeight := MessagePanel.Height;
1471    
1472     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main)
1473     for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1474     CoolSet.FCoolID := MainCoolBar.Bands[i].ID;
1475     CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width;
1476     CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break;
1477     GikoSys.Setting.MainCoolSet[i] := CoolSet;
1478     end;
1479     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board)
1480     for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1481     CoolSet.FCoolID := ListCoolBar.Bands[i].ID;
1482     CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width;
1483     CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break;
1484     GikoSys.Setting.ListCoolSet[i] := CoolSet;
1485     end;
1486     //鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser)
1487     for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1488     CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID;
1489     CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width;
1490     CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break;
1491     GikoSys.Setting.BrowserCoolSet[i] := CoolSet;
1492 hi_ 1.1 end;
1493    
1494 yoffy 1.2 GikoSys.Setting.WriteWindowSettingFile;
1495     GikoSys.Setting.WriteNameMailSettingFile;
1496    
1497     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1498 hi_ 1.1 try
1499 yoffy 1.2 FavoriteDM.WriteFavorite;
1500 hi_ 1.1 except
1501     end;
1502 yoffy 1.2 // Favorite.Free;
1503 hi_ 1.1
1504     try
1505     //鐃?鐃?鐃?鐃緒申鐃?鐃?
1506     NotSelectTabCloseAction.Execute;
1507     if BrowserTab.Tabs.Count >= 1 then begin
1508     DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1509     end;
1510     except
1511     end;
1512    
1513     //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申
1514     try
1515     RoundList.SaveRoundFile;
1516     except
1517     end;
1518     try
1519     RoundList.Clear;
1520     except
1521     end;
1522     try
1523     RoundList.Free;
1524     except
1525     end;
1526    
1527     //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1528     try
1529     FHistoryList.Free;
1530     except
1531     end;
1532    
1533     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申
1534     try
1535     AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
1536     except
1537     end;
1538    
1539     try
1540     FControlThread.Terminate;
1541     except
1542     end;
1543    
1544     // FDownload.Free;
1545     try
1546     SetActiveList(nil);
1547     except
1548     end;
1549     //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1550     Sleep(10);
1551     try
1552     TreeView.Items.Clear;
1553     except
1554     end;
1555    
1556     try
1557     if FavoriteDM <> nil then
1558     FavoriteDM.Free;
1559     FavoriteDM := nil;
1560     if AddressHistoryDM <> nil then
1561     AddressHistoryDM.Free;
1562     AddressHistoryDM := nil;
1563     except
1564     end;
1565     try
1566     if BBS2ch <> nil then
1567     BBS2ch.Free;
1568     BBS2ch := nil;
1569     except
1570     end;
1571 yoffy 1.2
1572     try
1573     //Hint鐃?鐃緒申
1574     if FHint <> nil then begin
1575     FHint.ReleaseHandle;
1576     FHint.Free;
1577     FHint := nil;
1578     end;
1579     //Preview鐃?鐃緒申
1580     if TPreviewBrowser <> nil then begin
1581     FPreviewBrowser.Free;
1582     FPreviewBrowser := nil;
1583     end;
1584     except
1585     end;
1586 hi_ 1.1 end;
1587    
1588     procedure TGikoForm.FormDestroy(Sender: TObject);
1589     //var
1590     // wp: TWindowPlacement;
1591     begin
1592     { //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1593     FHistoryList.Free;
1594    
1595     //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1596     wp.length := sizeof(wp);
1597     GetWindowPlacement(Handle, @wp);
1598    
1599     GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top;
1600     GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left;
1601     GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top;
1602     GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left;
1603     GikoSys.Setting.WindowMax := WindowState = wsMaximized;
1604    
1605     GikoSys.Setting.CabinetVisible := CabinetPanel.Visible;
1606     GikoSys.Setting.CabinetWidth := CabinetPanel.Width;
1607    
1608     GikoSys.Setting.WriteWindowSettingFile;
1609     GikoSys.Setting.WriteNameMailSettingFile;
1610     FDownload.Free;
1611     BBS2ch.Free;}
1612     end;
1613    
1614     //鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1615     procedure TGikoForm.FormClose(Sender: TObject; var Action: TCloseAction);
1616     begin
1617     Application.Terminate;
1618     Action := caFree;
1619     end;
1620    
1621     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?
1622     procedure TGikoForm.CabinetPanelHide(Sender: TObject);
1623     begin
1624     CabinetVisibleAction.Execute;
1625     // CabinetPanelVisible(false);
1626     end;
1627    
1628     procedure TGikoForm.ReloadBBS;
1629     begin
1630     //鐃?鐃?鐃?鐃緒申鐃?鐃?
1631     NotSelectTabCloseAction.Execute;
1632     if BrowserTab.Tabs.Count >= 1 then
1633     DeleteTab(TThreadItem(BrowserTab.Tabs.Objects[0]));
1634     //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?
1635     FHistoryList.Clear;
1636     //TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1637     TreeView.Items.Clear;
1638    
1639     //BBS鐃?鐃緒申
1640     BBS2ch.Free;
1641    
1642     SetActiveList(nil);
1643    
1644     FTreeType := gttNone;
1645    
1646     //BBS鐃緒申鐃緒申
1647     BBS2ch := TBBS2ch.Create(GikoSys.Setting.LogFolder);
1648    
1649     BBS2ch.ReadBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1650     Show2chTree;
1651     end;
1652    
1653     //鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申
1654     procedure TGikoForm.SetBoardTreeNode;
1655     var
1656     i, j: integer;
1657     Root: TTreeNode;
1658     CategoryNode: TTreeNode;
1659     BoardNode: TTreeNode;
1660     Category: TCategory;
1661     Board: TBoard;
1662     begin
1663     TreeView.Items.BeginUpdate;
1664     TreeView.Items.Clear;
1665     try
1666     Root := TreeView.Items.Add(nil, BBS2ch.Title);
1667 yoffy 1.2 Root.ImageIndex := ITEM_ICON_2CH1;
1668     Root.SelectedIndex := ITEM_ICON_2CH2;
1669 hi_ 1.1 Root.Data := BBS2ch;
1670     if SplashWindow <> nil then
1671     SplashWindow.ProgressBar.Max := BoardGroup.BBS2ch.Count;
1672    
1673     for i := 0 to BoardGroup.BBS2ch.Count - 1 do begin
1674     Category := TCategory(BoardGroup.BBS2ch.Items[i]);
1675     CategoryNode := TreeView.Items.AddChild(Root, Category.Title);
1676     CategoryNode.Data := Category;
1677 yoffy 1.2 CategoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
1678     CategoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
1679 hi_ 1.1
1680     for j := 0 to Category.Count - 1 do begin
1681     Board := TBoard(Category.Items[j]);
1682     Board.BeginUpdate;
1683     BoardNode := TreeView.Items.AddChild(CategoryNode, Board.Title);
1684     BoardNode.Data := Board;
1685 yoffy 1.2 BoardNode.ImageIndex := ITEM_ICON_BOARD1;
1686     BoardNode.SelectedIndex := ITEM_ICON_BOARD2;
1687 hi_ 1.1 Board.LoadSettings;
1688     Board.EndUpdate;
1689     end;
1690    
1691     CategoryNode.Expanded := Category.NodeExpand;
1692    
1693     if SplashWindow <> nil then begin
1694     SplashWindow.ProgressBar.StepIt;
1695     Application.ProcessMessages;
1696     end;
1697    
1698     end;
1699     finally
1700     TreeView.Items.EndUpdate;
1701     end;
1702     end;
1703    
1704     function TGikoForm.SetCategoryListItem(ABBS2ch: TBBS2ch): Integer;
1705     const
1706     COLUMN: array[0..0] of string = ('鐃?鐃?鐃?鐃緒申鐃緒申');
1707     var
1708     ListColumn: TListColumn;
1709     i: Integer;
1710     begin
1711     ListView.Items.BeginUpdate;
1712     try
1713     Screen.Cursor := crHourGlass;
1714    
1715     ListView.Columns.Clear;
1716     for i := 0 to Length(COLUMN) - 1 do begin
1717     ListColumn := ListView.Columns.Add;
1718     ListColumn.Caption := COLUMN[i];
1719     ListColumn.Width := GikoSys.Setting.BBSColumnWidth[i];
1720     end;
1721    
1722     ListView.Items.Count := 0;
1723     ListView.Items.Clear;
1724     ListView.Items.Count := ABBS2ch.Count;
1725    
1726     // UpFolderAction.Enabled := False;
1727     // AllItemAction.Enabled := False;
1728     // LogItemAction.Enabled := False;
1729     // NewItemAction.Enabled := False;
1730     // SelectItemAction.Enabled := False;
1731     // ListDownloadToolButton.Enabled := False;
1732     // BoardReservToolButton.Enabled := False;
1733     // ListThreadDownloadToolButton.Enabled := False;
1734    
1735     ListNameLabel.Caption := ABBS2ch.Title;
1736     FolderImage.Picture := nil;
1737     ItemIcon16.GetBitmap(1, FolderImage.Picture.Bitmap);
1738    
1739 yoffy 1.2 FSortIndex := 0;
1740     FSortOrder := False;
1741     ListViewColumnClick(nil, ListView.Column[0]);
1742    
1743 hi_ 1.1 Result := ABBS2ch.Count;
1744     finally
1745     Screen.Cursor := crDefault;
1746     ListView.Items.EndUpdate;
1747     end;
1748     end;
1749    
1750     function TGikoForm.SetBoardListItem(Category: TCategory): Integer;
1751     const
1752     COLUMN: array[0..2] of string = ('鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1753     var
1754     ListColumn: TListColumn;
1755     i: Integer;
1756     begin
1757     ListView.Items.BeginUpdate;
1758     try
1759     Screen.Cursor := crHourGlass;
1760    
1761     ListView.Columns.Clear;
1762     for i := 0 to Length(COLUMN) - 1 do begin
1763     ListColumn := ListView.Columns.Add;
1764     ListColumn.Caption := COLUMN[i];
1765     ListColumn.Width := GikoSys.Setting.CategoryColumnWidth[i];
1766     end;
1767    
1768     ListView.Items.Count := 0;
1769     ListView.Items.Clear;
1770     ListView.Items.Count := Category.Count;
1771    
1772     // UpFolderAction.Enabled := True;
1773     // AllItemAction.Enabled := False;
1774     // LogItemAction.Enabled := False;
1775     // NewItemAction.Enabled := False;
1776     // SelectItemAction.Enabled := False;
1777     // ListDownloadToolButton.Enabled := False;
1778     // BoardReservToolButton.Enabled := False;
1779     // ListThreadDownloadToolButton.Enabled := False;
1780    
1781     ListNameLabel.Caption := Category.Title;
1782     FolderImage.Picture := nil;
1783     ItemIcon16.GetBitmap(3, FolderImage.Picture.Bitmap);
1784    
1785 yoffy 1.2 FSortIndex := 0;
1786     FSortOrder := False;
1787     ListViewColumnClick(nil, ListView.Column[0]);
1788    
1789 hi_ 1.1 Result := Category.Count;
1790     finally
1791     Screen.Cursor := crDefault;
1792     ListView.Items.EndUpdate;
1793     end;
1794     end;
1795    
1796     function TGikoForm.SetThreadListItem(Board: TBoard): Integer;
1797     const
1798     COLUMN: array[0..6] of string = ('鐃?鐃緒申鐃?鐃?鐃緒申', '鐃?鐃?鐃緒申鐃?', '鐃緒申鐃緒申', '鐃?鐃緒申',
1799     '鐃緒申鐃緒申', '鐃緒申鐃緒申鐃?鐃緒申', '鐃緒申鐃緒申鐃緒申鐃緒申');
1800     COLUMN_ALIGNMENT: array[0..6] of TAlignment = (taLeftJustify, taRightJustify,
1801     taRightJustify, taRightJustify,
1802     taRightJustify, taLeftJustify,
1803     taLeftJustify);
1804     //No, 鐃?鐃緒申鐃?鐃?鐃緒申, 鐃?鐃?鐃緒申鐃?, 鐃緒申鐃緒申鐃?鐃緒申, 鐃緒申鐃緒申鐃緒申鐃緒申
1805     var
1806     ListColumn: TListColumn;
1807     i: Integer;
1808     begin
1809     ListView.Items.BeginUpdate;
1810     try
1811     Screen.Cursor := crHourGlass;
1812    
1813 yoffy 1.28 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1814     // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1815     if ListView.Columns.Count <> (High( COLUMN ) - Low( COLUMN ) + 1) then
1816     begin
1817     ListView.Columns.Clear;
1818     for i := 0 to Length(COLUMN) - 1 do begin
1819     ListColumn := ListView.Columns.Add;
1820     ListColumn.Caption := COLUMN[i];
1821     ListColumn.Width := GikoSys.Setting.BoardColumnWidth[i];
1822     ListColumn.Alignment := COLUMN_ALIGNMENT[i];
1823     end;
1824     end;
1825 hi_ 1.1
1826     ListView.Items.Count := 0;
1827     ListView.Items.Clear;
1828    
1829     case GikoForm.ViewType of
1830     gvtAll: ListView.Items.Count := Board.Count;
1831     gvtLog: ListView.Items.Count := Board.GetLogThreadCount;
1832     gvtNew: ListView.Items.Count := Board.GetNewThreadCount;
1833     gvtUser: ListView.Items.Count := Board.GetUserThreadCount;
1834     end;
1835    
1836     ListNameLabel.Caption := Board.Title;
1837     FolderImage.Picture := nil;
1838     ItemIcon16.GetBitmap(5, FolderImage.Picture.Bitmap);
1839    
1840 yoffy 1.2 FSortIndex := 0;
1841     FSortOrder := False;
1842     ListViewColumnClick(nil, ListView.Column[0]);
1843 hi_ 1.1
1844     Result := Board.Count;
1845     finally
1846     Screen.Cursor := crDefault;
1847     ListView.Items.EndUpdate;
1848     end;
1849     end;
1850    
1851     procedure TGikoForm.TreeViewChange(Sender: TObject; Node: TTreeNode);
1852     var
1853     i: Integer;
1854     begin
1855     if FTreeType = gttHistory then begin
1856     // SetContent(TThreadItem(Node.Data));
1857     InsertBrowserTab(TThreadItem(Node.Data));
1858     Exit;
1859     end;
1860    
1861     ListView.Selected := nil;
1862     ListView.Items.Count := 0;
1863     ListView.Items.Clear;
1864     // ListView.Columns.Clear;
1865    
1866     Caption := CAPTION_NAME;
1867     //Application.Title := CAPTION_NAME;
1868    
1869    
1870     if GetActiveList is TBBS2ch then begin
1871     for i := 0 to ListView.Columns.Count - 1 do
1872     GikoSys.Setting.BBSColumnWidth[i] := ListView.Column[i].Width;
1873     end else if GetActiveList is TCategory then begin
1874     for i := 0 to ListView.Columns.Count - 1 do
1875     GikoSys.Setting.CategoryColumnWidth[i] := ListView.Column[i].Width;
1876     end else if GetActiveList is TBoard then begin
1877     for i := 0 to ListView.Columns.Count - 1 do
1878     GikoSys.Setting.BoardColumnWidth[i] := ListView.Column[i].Width;
1879     end;
1880    
1881     if TObject(Node.Data) is TBBS2ch then begin
1882     SetActiveList(Node.data);
1883     end else if TObject(Node.Data) is TCategory then begin
1884     SetActiveList(Node.data);
1885     end else if TObject(Node.Data) is TBoard then begin
1886     if not TBoard(Node.Data).IsThreadDatRead then begin
1887     Screen.Cursor := crHourGlass;
1888     try
1889     GikoSys.ReadSubjectFile(TBoard(Node.Data));
1890     finally
1891     Screen.Cursor := crDefault;
1892     end;
1893     end;
1894     SetActiveList(Node.data);
1895     end;
1896     end;
1897    
1898     procedure TGikoForm.ListViewData(Sender: TObject; Item: TListItem);
1899     var
1900     // FileName: string;
1901     // DateTime: TDateTime;
1902     BoardCnt: Integer;
1903     BBS: TBBS2ch;
1904     Category: TCategory;
1905     Board: TBoard;
1906     ThreadItem: TThreadItem;
1907     RepStr: string;
1908     begin
1909     if ActiveList is TBBS2ch then begin
1910     BBS := TBBS2ch(ActiveList);
1911    
1912     ListView.StateImages := nil;
1913    
1914     if BBS = nil then Exit;
1915     if BBS.Count <= 0 then Exit;
1916     if Item = nil then Exit;
1917     if Item.Index > BBS.Count then Exit;
1918     if ListView.Items.Count = 0 then Exit;
1919    
1920     if not (BBS.Items[Item.Index] is TCategory) then Exit;
1921     Category := TCategory(BBS.Items[Item.Index]);
1922    
1923     if Category = nil then Exit;
1924    
1925     if ListNumberVisibleAction.Checked then
1926     Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
1927     else
1928     Item.Caption := Category.Title;
1929    
1930 yoffy 1.2 Item.ImageIndex := ITEM_ICON_CATEGORY1;
1931 hi_ 1.1 Item.Data := Category;
1932     end else if ActiveList is TCategory then begin
1933     Category := TCategory(ActiveList);
1934    
1935     ListView.StateImages := nil;
1936    
1937     if Category = nil then Exit;
1938     if Category.Count <= 0 then Exit;
1939     if Item = nil then Exit;
1940     if Item.Index >= Category.Count then Exit;
1941     if ListView.Items.Count = 0 then Exit;
1942    
1943     if not (Category.Items[Item.Index] is TBoard) then Exit;
1944     Board := TBoard(Category.Items[Item.Index]);
1945    
1946     if Board = nil then Exit;
1947    
1948     if ListNumberVisibleAction.Checked then
1949     Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
1950     else
1951     Item.Caption := Board.Title;
1952    
1953     if Item.SubItems.Count <> 2 then begin
1954     Item.SubItems.Clear;
1955     Item.SubItems.Add('');
1956     Item.SubItems.Add('');
1957     end;
1958    
1959 yoffy 1.2 Item.ImageIndex := ITEM_ICON_BOARD1;
1960 hi_ 1.1
1961     if Board.Round then
1962     Item.SubItems[0] := Board.RoundName // '鐃?鐃緒申'
1963     else
1964     Item.SubItems[0] := '';
1965    
1966     if Board.RoundDate = ZERO_DATE then begin
1967     Item.SubItems[1] := '';
1968     end else
1969     Item.SubItems[1] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
1970     Item.Data := Board;
1971     end else if ActiveList is TBoard then begin
1972     Board := TBoard(ActiveList);
1973    
1974     if GikoSys.Setting.ListIconVisible then
1975     ListView.StateImages := StateIconImageList
1976     else
1977     ListView.StateImages := nil;
1978    
1979     case GikoForm.ViewType of
1980     gvtAll: BoardCnt := Board.Count;
1981     gvtLog: BoardCnt := Board.GetLogThreadCount;
1982     gvtNew: BoardCnt := Board.GetNewThreadCount;
1983     gvtUser: BoardCnt := Board.GetUserThreadCount;
1984 yoffy 1.2 else
1985     BoardCnt := 0;
1986 hi_ 1.1 end;
1987    
1988     // if Board = nil then Exit;
1989     if BoardCnt <= 0 then Exit;
1990     if Item = nil then Exit;
1991     if Item.Index > BoardCnt then Exit;
1992     if ListView.Items.Count = 0 then Exit;
1993    
1994     // if not (Board.Items[Item.Index] is TThreadItem) then Exit;
1995    
1996     ThreadItem := nil;
1997     case GikoForm.ViewType of
1998     gvtAll: ThreadItem := TThreadItem(Board.Items[Item.Index]);
1999     gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
2000     gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
2001     gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
2002     end;
2003    
2004     if ThreadItem = nil then Exit;
2005    
2006     // if ListNumberVisibleAction.Checked then
2007     // RepStr := IntToStr(ThreadItem.No) + ': ' + ThreadItem.Title
2008     // else
2009     RepStr := ThreadItem.Title;
2010 yoffy 1.2 //RepStr := StringReplace(RepStr, '&amp;', '&', [rfReplaceAll]);
2011 hi_ 1.1 RepStr := StringReplace(RepStr, '&lt;', '<', [rfReplaceAll]);
2012     RepStr := StringReplace(RepStr, '&gt;', '>', [rfReplaceAll]);
2013     RepStr := StringReplace(RepStr, '&quot;', '"', [rfReplaceAll]);
2014 yoffy 1.2 RepStr := StringReplace(RepStr, '&amp', '&', [rfReplaceAll]);
2015 hi_ 1.1 //RepStr := StringReplace(RepStr, '鐃緒申鐃?', ',', [rfReplaceAll]);
2016    
2017     if Item.SubItems.Count <> 6 then begin
2018     Item.SubItems.Clear;
2019     Item.SubItems.Add('');
2020     Item.SubItems.Add('');
2021     Item.SubItems.Add('');
2022     Item.SubItems.Add('');
2023     Item.SubItems.Add('');
2024     Item.SubItems.Add('');
2025     end;
2026    
2027     if ListNumberVisibleAction.Checked then
2028     Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
2029     else
2030     Item.Caption := RepStr;
2031    
2032     case ThreadItem.AgeSage of
2033     gasNone: Item.StateIndex := -1;
2034     gasNew: Item.StateIndex := 0;
2035     gasAge: Item.StateIndex := 1;
2036     gasSage: Item.StateIndex := 2;
2037     end;
2038    
2039     if ThreadItem.IsLogFile then begin
2040 yoffy 1.2 Item.ImageIndex := ITEM_ICON_THREADLOG1;
2041 hi_ 1.1 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2042     Item.SubItems[1] := IntToStr(ThreadItem.Count);
2043     if ThreadItem.NewResCount = 0 then
2044     Item.SubItems[2] := ''
2045     else
2046     Item.SubItems[2] := IntToStr(ThreadItem.NewResCount);
2047     Item.SubItems[3] := '';
2048     if ThreadItem.Round then
2049     Item.SubItems[4] := ThreadItem.RoundName
2050     else
2051     Item.SubItems[4] := '';
2052     if ThreadItem.RoundDate = ZERO_DATE then begin
2053     Item.SubItems[5] := '';
2054     end else
2055     Item.SubItems[5] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
2056     if ThreadItem.NewArrival then
2057 yoffy 1.2 Item.ImageIndex := ITEM_ICON_THREADNEW1;
2058 hi_ 1.1 end else begin
2059 yoffy 1.2 Item.ImageIndex := ITEM_ICON_THREAD1;
2060 hi_ 1.1 Item.SubItems[0] := IntToStr(ThreadItem.AllResCount);
2061     Item.SubItems[1] := '';
2062     Item.SubItems[2] := '';
2063     Item.SubItems[3] := '';
2064     Item.SubItems[4] := '';
2065     Item.SubItems[5] := '';
2066     end;
2067     Item.Data := ThreadItem;
2068     end;
2069     end;
2070    
2071     procedure TGikoForm.ListViewDataFind(Sender: TObject; Find: TItemFind;
2072     const FindString: String; const FindPosition: TPoint; FindData: Pointer;
2073     StartIndex: Integer; Direction: TSearchDirection; Wrap: Boolean;
2074     var Index: Integer);
2075     begin
2076     //
2077     end;
2078    
2079     procedure TGikoForm.ListViewDataHint(Sender: TObject; StartIndex,
2080     EndIndex: Integer);
2081     begin
2082     //
2083     end;
2084    
2085     procedure TGikoForm.ListViewDataStateChange(Sender: TObject; StartIndex,
2086     EndIndex: Integer; OldState, NewState: TItemStates);
2087     begin
2088     //
2089     end;
2090    
2091     procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString);
2092     var
2093     p: TPoint;
2094     s: string;
2095     tmp2: string;
2096     URL: string;
2097     ATitle: Boolean;
2098    
2099     wkBBS: string;
2100     wkKey: string;
2101    
2102     wkInt: Integer;
2103     wkIntSt: Integer;
2104     wkIntTo: Integer;
2105    
2106     ActiveFileName: string;
2107     e: IHTMLElement;
2108     Ext: string;
2109     PathRec: TPathRec;
2110     begin
2111     try
2112     try
2113     if (FActiveContent <> nil) and (Assigned(Browser.Document)) then begin
2114     if LowerCase(OleVariant(IHTMLDocument2(Browser.Document)).charset) <> 'shift_jis' then
2115     OleVariant(IHTMLDocument2(Browser.Document)).charset := 'shift_jis';
2116     end;
2117     except
2118     end;
2119     finally
2120     end;
2121     if PreviewTimer.Enabled then
2122     PreviewTimer.Enabled := False;
2123     Application.CancelHint;
2124     if GetActiveContent <> nil then
2125     ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '')
2126     else
2127     ActiveFileName := '';
2128    
2129     StatusBar.Panels[1].Text := Text;
2130    
2131     if FHint <> nil then begin
2132     FHint.ReleaseHandle;
2133     FHint.ClearAllRes;
2134     end;
2135     if FPreviewBrowser <> nil then
2136     ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2137    
2138     if not GikoSys.Setting.UnActivePopup then
2139     if not GikoForm.Active then
2140     Exit;
2141    
2142     //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10
2143     //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15
2144    
2145     s := '';
2146     Ext := AnsiLowerCase(ExtractFileExt(Text));
2147     if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and
2148     ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
2149     if FPreviewBrowser = nil then begin
2150     FPreviewBrowser := TPreviewBrowser.Create(Self);
2151     ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
2152     TOleControl(FPreviewBrowser).Parent := nil;
2153     end;
2154 h677 1.3 FPreviewBrowser.Navigate('about:blank');//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2155 hi_ 1.1 FPreviewURL := Text;
2156     PreviewTimer.Interval := GikoSys.Setting.PreviewWait;
2157     PreviewTimer.Enabled := True;
2158     end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin
2159     if Pos('mailto:', Text) = 1 then begin
2160     s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]);
2161     //鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申
2162     GetCursorPos(p);
2163     p.x := p.x - TWebBrowser(Sender).ClientOrigin.x;
2164     p.y := p.y - TWebBrowser(Sender).ClientOrigin.y;
2165     e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y);
2166     if (Assigned(e)) then begin
2167     tmp2 := GikoSys.ZenToHan(e.Get_outerText);
2168     if (GikoSys.IsNumeric(tmp2)) then begin
2169     //鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?
2170     wkBBS := GetActiveContent.ParentBoard.BBSID;
2171     wkKey := ChangeFileExt(GetActiveContent.FileName, '');
2172     wkIntSt := StrToInt(tmp2);
2173     wkIntTo := StrToInt(tmp2);
2174     //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2175     FHint.PopupType := gptThread;
2176     SetResPopupText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False);
2177     end else begin
2178     FHint.PopupType := gptRaw;
2179     FHint.Caption := s;
2180     end;
2181     end;
2182     end else begin
2183     URL := Text;
2184     if Pos('about:blank..', URL) = 1 then
2185     URL := StringReplace(URL, 'about:blank..', 'http://www.2ch.net', []);
2186    
2187     PathRec := Gikosys.Parse2chURL2(URL);
2188    
2189     if PathRec.FDone then begin
2190    
2191     wkIntSt := PathRec.FSt;
2192     wkIntTo := PathRec.FTo;
2193    
2194     if (wkIntSt = 0) and (wkIntTo = 0) then begin
2195     wkIntSt := 1;
2196     wkIntTo := 1;
2197     end else if (wkIntSt = 0) and (wkIntTo > 0) then begin
2198     wkIntSt := wkIntTo;
2199     end else if (wkIntSt > 0) and (wkIntTo = 0) then begin
2200     wkIntTo := wkIntSt;
2201     end else if wkIntSt > wkIntTo then begin
2202     wkInt := wkIntTo;
2203     wkIntTo := wkIntSt;
2204     wkIntSt := wkIntTo;
2205     end;
2206     //if wkIntSt = 0 then
2207     // wkIntSt := 1;
2208     //if wkINtTo = 0 then
2209     // wkIntTo := 1;
2210     //if PathRec.FFirst then
2211     // wkIntSt := 1;
2212     if PathRec.FStBegin then
2213     wkIntSt := 1;
2214     if PathRec.FToEnd then
2215     wkIntTo := 9999;
2216    
2217     ATitle := ActiveFileName <> PathRec.FKey;
2218    
2219     //HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2220     FHint.PopupType := gptThread;
2221     SetResPopupText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst);
2222     end;
2223     end;
2224    
2225     //if s <> '' then
2226     // ShowTextPopup(s);
2227     if FHint.PopupType = gptRaw then begin
2228     if FHint.Caption <> '' then
2229     ShowTextPopup;
2230     end else begin
2231 yoffy 1.2 if (FHint.ResCount <> 0) or (FHint.Title <> '') then
2232 hi_ 1.1 ShowTextPopup;
2233     end;
2234     end;
2235     end;
2236    
2237     procedure TGikoForm.BrowserTitleChange(Sender: TObject;
2238     const Text: WideString);
2239     var
2240     Title: string;
2241     begin
2242     if (Text = BLANK_HTML) or (Text = GikoSys.GetHtmlTempFileName) then
2243     Title := CAPTION_NAME
2244     else
2245     Title := CAPTION_NAME + ' - [' + Text + ']';
2246     Caption := Title;
2247     //Application.Title := Title;
2248     end;
2249    
2250     procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean);
2251     var
2252     SysMenu: HMenu;
2253     //SysMenuApp: HMenu;
2254     begin
2255     FEnabledCloseButton := Enabled;
2256     SysMenu := GetSystemMenu(Handle, False);
2257     //SysMenuApp := GetSystemMenu(Application.Handle, False);
2258    
2259     if Enabled then begin
2260     EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2261     //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
2262     end else begin
2263     EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2264     //EnableMenuItem(SysMenuApp, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED);
2265     end;
2266    
2267     DrawMenuBar(Handle);
2268     //DrawMenuBar(Application.Handle);
2269     end;
2270    
2271     procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode;
2272     var AllowChange: Boolean);
2273     begin
2274     if FTreeType = gtt2ch then
2275     FSortIndex := -1;
2276     end;
2277    
2278     procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word;
2279     Shift: TShiftState);
2280     begin
2281     if Key = VK_BACK then begin
2282     // UpFolderButtonClick(Sender);
2283     end else if Key = VK_SPACE then begin
2284     // ListClick;
2285     end else if Key = VK_RETURN then begin
2286     ListDoubleClick;
2287     end;
2288     end;
2289    
2290     function TGikoForm.GetHttpState: Boolean;
2291     begin
2292     Result := FHttpState;
2293     end;
2294    
2295     procedure TGikoForm.ListViewColumnClick(Sender: TObject;
2296     Column: TListColumn);
2297     var
2298 yoffy 1.2 i: Integer;
2299 hi_ 1.1 wkBBS: TBBS2ch;
2300     wkCategory: TCategory;
2301     wkBoard: TBoard;
2302     begin
2303     if FSortIndex = Column.Index then
2304     FSortOrder := not FSortOrder
2305     else
2306     FSortOrder := False;
2307    
2308 yoffy 1.2 for i := 0 to ListView.Columns.Count - 1 do
2309     ListView.Column[i].ImageIndex := -1;
2310     if FSortOrder then
2311     ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT1
2312     else
2313     ListView.Column[Column.Index].ImageIndex := ITEM_ICON_SORT2;
2314    
2315 hi_ 1.1 Sort.SortNoFlag := ListNumberVisibleAction.Checked;
2316    
2317     if TObject(TreeView.Selected.Data) is TBBS2ch then begin
2318     wkBBS := TBBS2ch(TreeView.Selected.Data);
2319     Sort.SortOrder := FSortOrder;
2320     Sort.SortIndex := Column.Index;
2321     wkBBS.Sort(CategorySortProc);
2322     ListView.Refresh;
2323     end else if TObject(TreeView.Selected.Data) is TCategory then begin
2324     wkCategory := TCategory(TreeView.Selected.Data);
2325     Sort.SortOrder := FSortOrder;
2326     Sort.SortIndex := Column.Index;
2327     wkCategory.Sort(BoardSortProc);
2328     ListView.Refresh;
2329     end else if TObject(TreeView.Selected.Data) is TBoard then begin
2330     wkBoard := TBoard(TreeView.Selected.Data);
2331     Sort.SortOrder := FSortOrder;
2332     Sort.SortIndex := Column.Index;
2333     wkBoard.Sort(ThreadItemSortProc);
2334     ListView.Refresh;
2335     end;
2336     FSortIndex := Column.Index;
2337     end;
2338    
2339     procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
2340     Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean);
2341     var
2342     ARect: TRect;
2343     begin
2344 yoffy 1.2 DefaultDraw := True;
2345     Exit;
2346 hi_ 1.1 DefaultDraw := False;
2347     if (cdsSelected in State) or (cdsHot in State) then begin
2348     Sender.Canvas.Brush.Color := clHighlight;
2349     Sender.Canvas.Font.Color := clHighlightText;
2350     end else begin
2351     Sender.Canvas.Brush.Color := clBtnFace;
2352     Sender.Canvas.Font.Color := clBtnText;
2353     end;
2354     ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height);
2355     Sender.Canvas.FillRect(ARect);
2356     DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
2357     end;
2358    
2359     function TGikoForm.GetTreeNode(Data: TObject): TTreeNode;
2360     var
2361     Nodes: TTreeNodes;
2362     i: integer;
2363     begin
2364     Nodes := TreeView.Items;
2365    
2366     for i := 0 to Nodes.Count - 1 do begin
2367     if Nodes.Item[i].Data = Data then begin
2368     Result := Nodes.Item[i];
2369     Exit;
2370     end;
2371     end;
2372     Result := nil;
2373     end;
2374    
2375     procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject;
2376     const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData,
2377     Headers: OleVariant; var Cancel: WordBool);
2378