Develop and Download Open Source Software

Browse CVS Repository

Contents of /gikonavigoeson/gikonavi/Giko.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.20 - (show annotations) (download) (as text)
Fri Aug 15 15:26:10 2003 UTC (20 years, 8 months ago) by yoffy
Branch: MAIN
Changes since 1.19: +4 -4 lines
File MIME type: text/x-pascal
・応急処置その3で終了時にクラッシュするバグを修正。
 多分これで [ツールバー設定] と絞り込み検索は満足に連動するはず。

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