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