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.2 - (hide annotations) (download) (as text)
Sat Aug 9 14:22:50 2003 UTC (20 years, 8 months ago) by yoffy
Branch: MAIN
CVS Tags: c33_4
Changes since 1.1: +1000 -416 lines
File MIME type: text/x-pascal
・Windows 95 でもお気に入りが使えるようになった。
・ツールバーを右クリックすることで表示/非表示が行えようになった。
・ツールバーから絞込検索ができるようになった。
・「ログ有りのスレッドのみを表示する」「新着スレッドの未表示する」の各ボタンと絞込み検索が And 検索になった。
・レスのプレビューでトリップが確認できるようになった。
・ギコナビは Delphi 6 Personal でビルドできるようになった。

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