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.24 - (show annotations) (download) (as text)
Wed Aug 27 05:40:29 2003 UTC (20 years, 7 months ago) by h677
Branch: MAIN
Changes since 1.23: +13 -9 lines
File MIME type: text/x-pascal
NGワードのメニューをキー設定できるようにActionListに追加した。

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