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.11 - (hide annotations) (download) (as text)
Wed Aug 13 05:10:13 2003 UTC (20 years, 8 months ago) by h677
Branch: MAIN
Changes since 1.10: +5 -12 lines
File MIME type: text/x-pascal
GikoSysのFAbonをpublicに変更したので、Abonizerを削除

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