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