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.32 - (show annotations) (download) (as text)
Fri Aug 29 17:52:18 2003 UTC (20 years, 7 months ago) by hi_
Branch: MAIN
Changes since 1.31: +44 -25 lines
File MIME type: text/x-pascal
ステータスバーのNGワード部分を固定サイズにした

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