| 1 |
unit Giko; |
| 2 |
|
| 3 |
interface |
| 4 |
|
| 5 |
uses |
| 6 |
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, |
| 7 |
OleCtrls, ComCtrls, ExtCtrls, Menus, StdCtrls, MMSystem, DateUtils, |
| 8 |
{$IF Defined(DELPRO) } |
| 9 |
SHDocVw, |
| 10 |
MSHTML, |
| 11 |
{$ELSE} |
| 12 |
SHDocVw_TLB, |
| 13 |
MSHTML_TLB, |
| 14 |
{$IFEND} |
| 15 |
IdHTTP, ActiveX, ActnList, ImgList, |
| 16 |
ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils, |
| 17 |
CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload, |
| 18 |
Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent, |
| 19 |
HintWindow, GikoCoolBar, GikoListView, Search, ExternalBoardManager, |
| 20 |
ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection, |
| 21 |
IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord; |
| 22 |
|
| 23 |
type |
| 24 |
TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite); |
| 25 |
TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser); |
| 26 |
TMinimizeType = (mtNone, mtMinimizing, mtMinimized); |
| 27 |
TResizeType = (rtNone, rtResizing); |
| 28 |
|
| 29 |
// TBrowserRecord = class; |
| 30 |
|
| 31 |
TGikoForm = class(TForm) |
| 32 |
StatusBar: TStatusBar; |
| 33 |
MainPanel: TPanel; |
| 34 |
ClientPanel: TPanel; |
| 35 |
TreeSplitter: TSplitter; |
| 36 |
CabinetPanel: TPanel; |
| 37 |
TreeView: TTreeView; |
| 38 |
ThreadMainPanel: TPanel; |
| 39 |
ListSplitter: TSplitter; |
| 40 |
ViewPanel: TPanel; |
| 41 |
ListView: TGikoListView; |
| 42 |
ThreadPanel: TPanel; |
| 43 |
MessagePanel: TPanel; |
| 44 |
MessageBar: TPanel; |
| 45 |
MessageHideButton: TSpeedButton; |
| 46 |
MessageListView: TListView; |
| 47 |
MessageSplitter: TSplitter; |
| 48 |
Panel3: TPanel; |
| 49 |
CabinetCloseSpeedButton: TSpeedButton; |
| 50 |
ToolBar1: TToolBar; |
| 51 |
CabinetSelectToolButton: TToolButton; |
| 52 |
HistoryToolBar: TToolBar; |
| 53 |
HistoryShowToolButton: TToolButton; |
| 54 |
HistoryAllClearToolButton: TToolButton; |
| 55 |
ItemIcon16: TImageList; |
| 56 |
ItemIcon32: TImageList; |
| 57 |
HotToobarImageList: TImageList; |
| 58 |
ItemImageList: TImageList; |
| 59 |
MainMenu: TMainMenu; |
| 60 |
FileMenu: TMenuItem; |
| 61 |
DeleteMenu: TMenuItem; |
| 62 |
ExitMenu: TMenuItem; |
| 63 |
KidokuMenu: TMenuItem; |
| 64 |
MidokuMenu: TMenuItem; |
| 65 |
AllSelectMenu: TMenuItem; |
| 66 |
ViewMenu: TMenuItem; |
| 67 |
StdToolBarMenu: TMenuItem; |
| 68 |
CabinetMenu: TMenuItem; |
| 69 |
H1: TMenuItem; |
| 70 |
N4: TMenuItem; |
| 71 |
CabinetVisibleMenu: TMenuItem; |
| 72 |
MessageMenu: TMenuItem; |
| 73 |
StatusBarMenu: TMenuItem; |
| 74 |
MMSep03: TMenuItem; |
| 75 |
LargeIconMenu: TMenuItem; |
| 76 |
SmallIconMenu: TMenuItem; |
| 77 |
ListMenu: TMenuItem; |
| 78 |
DetailMenu: TMenuItem; |
| 79 |
ToolMenu: TMenuItem; |
| 80 |
Find1: TMenuItem; |
| 81 |
RoundMenu: TMenuItem; |
| 82 |
MMSep04: TMenuItem; |
| 83 |
OptionMenu: TMenuItem; |
| 84 |
HelpMenu: TMenuItem; |
| 85 |
G1: TMenuItem; |
| 86 |
N1: TMenuItem; |
| 87 |
AboutMenu: TMenuItem; |
| 88 |
BrowserPopupMenu: TPopupMenu; |
| 89 |
ShowThreadMenu: TMenuItem; |
| 90 |
ShowBoardMenu: TMenuItem; |
| 91 |
ListIconPopupMenu: TPopupMenu; |
| 92 |
LargeIconPMenu: TMenuItem; |
| 93 |
SmallIconPMenu: TMenuItem; |
| 94 |
ListPMenu: TMenuItem; |
| 95 |
DetailPMenu: TMenuItem; |
| 96 |
ClosePopupMenu: TPopupMenu; |
| 97 |
CloseMenu: TMenuItem; |
| 98 |
U1: TMenuItem; |
| 99 |
N3: TMenuItem; |
| 100 |
B1: TMenuItem; |
| 101 |
S1: TMenuItem; |
| 102 |
N2: TMenuItem; |
| 103 |
A1: TMenuItem; |
| 104 |
L1: TMenuItem; |
| 105 |
N5: TMenuItem; |
| 106 |
S2: TMenuItem; |
| 107 |
ListPopupMenu: TPopupMenu; |
| 108 |
ListRoundPMenu: TMenuItem; |
| 109 |
ListReservPMenu: TMenuItem; |
| 110 |
LPMSep01: TMenuItem; |
| 111 |
ItemRoundPMenu: TMenuItem; |
| 112 |
LPMSep02: TMenuItem; |
| 113 |
KidokuPMenu: TMenuItem; |
| 114 |
MidokuPMenu: TMenuItem; |
| 115 |
AllSelectPMenu: TMenuItem; |
| 116 |
UrlCopyPMenu: TMenuItem; |
| 117 |
LPMSep05: TMenuItem; |
| 118 |
DeletePMenu: TMenuItem; |
| 119 |
LPMSep06: TMenuItem; |
| 120 |
ViewPMenu: TMenuItem; |
| 121 |
LargeIconLPMenu: TMenuItem; |
| 122 |
SmallIconLPMenu: TMenuItem; |
| 123 |
ListLPMenu: TMenuItem; |
| 124 |
DetailLPMenu: TMenuItem; |
| 125 |
T1: TMenuItem; |
| 126 |
B2: TMenuItem; |
| 127 |
N8: TMenuItem; |
| 128 |
URLC1: TMenuItem; |
| 129 |
N9: TMenuItem; |
| 130 |
N10: TMenuItem; |
| 131 |
G2: TMenuItem; |
| 132 |
N11: TMenuItem; |
| 133 |
T3: TMenuItem; |
| 134 |
L2: TMenuItem; |
| 135 |
N12: TMenuItem; |
| 136 |
K1: TMenuItem; |
| 137 |
N13: TMenuItem; |
| 138 |
N14: TMenuItem; |
| 139 |
R1: TMenuItem; |
| 140 |
A2: TMenuItem; |
| 141 |
N15: TMenuItem; |
| 142 |
KokoPopupMenu: TPopupMenu; |
| 143 |
KokomadePMenu: TMenuItem; |
| 144 |
AllPMenu: TMenuItem; |
| 145 |
MenuItem1: TMenuItem; |
| 146 |
MenuItem2: TMenuItem; |
| 147 |
BrowserTabPopupMenu: TPopupMenu; |
| 148 |
Close1: TMenuItem; |
| 149 |
A3: TMenuItem; |
| 150 |
N16: TMenuItem; |
| 151 |
A4: TMenuItem; |
| 152 |
TreePopupMenu: TPopupMenu; |
| 153 |
TreeSelectThreadPupupMenu: TMenuItem; |
| 154 |
TreeSelectBoardPupupMenu: TMenuItem; |
| 155 |
TPMSep01: TMenuItem; |
| 156 |
TreeSelectURLPupupMenu: TMenuItem; |
| 157 |
T2: TMenuItem; |
| 158 |
L3: TMenuItem; |
| 159 |
B3: TMenuItem; |
| 160 |
BrowserBottomPanel: TGikoPanel; |
| 161 |
CabinetSelectPopupMenu: TPopupMenu; |
| 162 |
H2: TMenuItem; |
| 163 |
ItemReservPMenu: TMenuItem; |
| 164 |
RoundNamePopupMenu: TPopupMenu; |
| 165 |
N7: TMenuItem; |
| 166 |
B4: TMenuItem; |
| 167 |
L4: TMenuItem; |
| 168 |
K2: TMenuItem; |
| 169 |
A5: TMenuItem; |
| 170 |
A6: TMenuItem; |
| 171 |
C1: TMenuItem; |
| 172 |
V1: TMenuItem; |
| 173 |
N19: TMenuItem; |
| 174 |
D1: TMenuItem; |
| 175 |
D2: TMenuItem; |
| 176 |
MessageImageList: TImageList; |
| 177 |
ProgressBar: TProgressBar; |
| 178 |
URL1: TMenuItem; |
| 179 |
NameUrlCopyPMenu: TMenuItem; |
| 180 |
URLC2: TMenuItem; |
| 181 |
URLN1: TMenuItem; |
| 182 |
N21: TMenuItem; |
| 183 |
URLC3: TMenuItem; |
| 184 |
URLN2: TMenuItem; |
| 185 |
N23: TMenuItem; |
| 186 |
ListCoolBar: TGikoCoolBar; |
| 187 |
ListToolBar: TToolBar; |
| 188 |
BrowserCoolBar: TGikoCoolBar; |
| 189 |
BrowserToolBar: TToolBar; |
| 190 |
ToolButton3: TToolButton; |
| 191 |
ToolButton9: TToolButton; |
| 192 |
ToolButton11: TToolButton; |
| 193 |
ToolButton5: TToolButton; |
| 194 |
ListNameToolBar: TToolBar; |
| 195 |
ListNameLabel: TLabel; |
| 196 |
FolderImage: TImage; |
| 197 |
BrowserNameToolBar: TToolBar; |
| 198 |
ItemBoardImage: TImage; |
| 199 |
BrowserBoardNameLabel: TLabel; |
| 200 |
ItemImage: TImage; |
| 201 |
BrowserNameLabel: TLabel; |
| 202 |
D3: TMenuItem; |
| 203 |
N25: TMenuItem; |
| 204 |
N26: TMenuItem; |
| 205 |
D4: TMenuItem; |
| 206 |
S3: TMenuItem; |
| 207 |
R2: TMenuItem; |
| 208 |
TreeSelectNameURLPupupMenu: TMenuItem; |
| 209 |
N27: TMenuItem; |
| 210 |
H3: TMenuItem; |
| 211 |
I1: TMenuItem; |
| 212 |
BrowserTabToolBar: TToolBar; |
| 213 |
BrowserTab: TTabControl; |
| 214 |
About1: TMenuItem; |
| 215 |
N28: TMenuItem; |
| 216 |
S4: TMenuItem; |
| 217 |
N29: TMenuItem; |
| 218 |
N30: TMenuItem; |
| 219 |
N31: TMenuItem; |
| 220 |
L5: TMenuItem; |
| 221 |
L6: TMenuItem; |
| 222 |
A7: TMenuItem; |
| 223 |
R3: TMenuItem; |
| 224 |
FavoriteMenu: TMenuItem; |
| 225 |
N32: TMenuItem; |
| 226 |
BoardFavoriteAddMenu: TMenuItem; |
| 227 |
ThreadFavoriteAddMenu: TMenuItem; |
| 228 |
N33: TMenuItem; |
| 229 |
TreeSelectFavoriteAddPupupMenu: TMenuItem; |
| 230 |
FavoriteTreeView: TTreeView; |
| 231 |
StateIconImageList: TImageList; |
| 232 |
TopPanel: TPanel; |
| 233 |
TopRightPanel: TPanel; |
| 234 |
AnimePanel: TPanel; |
| 235 |
Animate: TAnimate; |
| 236 |
TopCoolPanel: TPanel; |
| 237 |
MainCoolBar: TGikoCoolBar; |
| 238 |
MenuToolBar: TToolBar; |
| 239 |
StdToolBar: TToolBar; |
| 240 |
AddressToolBar: TToolBar; |
| 241 |
AddressComboBox: TComboBox; |
| 242 |
MoveToToolButton: TToolButton; |
| 243 |
AddressImageList: TImageList; |
| 244 |
AddressToolBarMenu: TMenuItem; |
| 245 |
T4: TMenuItem; |
| 246 |
Show1: TMenuItem; |
| 247 |
N34: TMenuItem; |
| 248 |
T5: TMenuItem; |
| 249 |
B5: TMenuItem; |
| 250 |
N35: TMenuItem; |
| 251 |
A8: TMenuItem; |
| 252 |
U2: TMenuItem; |
| 253 |
F1: TMenuItem; |
| 254 |
PreviewTimer: TTimer; |
| 255 |
MonazillaWebPageAction1: TMenuItem; |
| 256 |
N36: TMenuItem; |
| 257 |
H4: TMenuItem; |
| 258 |
K3: TMenuItem; |
| 259 |
L7: TMenuItem; |
| 260 |
N37: TMenuItem; |
| 261 |
A9: TMenuItem; |
| 262 |
ChevronPopupMenu: TPopupMenu; |
| 263 |
N2N1: TMenuItem; |
| 264 |
N38: TMenuItem; |
| 265 |
F2: TMenuItem; |
| 266 |
LinkToolBar: TToolBar; |
| 267 |
a10: TMenuItem; |
| 268 |
N39: TMenuItem; |
| 269 |
T6: TMenuItem; |
| 270 |
N40: TMenuItem; |
| 271 |
LinkBarPopupMenu: TPopupMenu; |
| 272 |
T7: TMenuItem; |
| 273 |
ThreadPopupMenu: TPopupMenu; |
| 274 |
MenuItem4: TMenuItem; |
| 275 |
MenuItem5: TMenuItem; |
| 276 |
MenuItem6: TMenuItem; |
| 277 |
T8: TMenuItem; |
| 278 |
URLN3: TMenuItem; |
| 279 |
SelectItemNameCopyAction1: TMenuItem; |
| 280 |
B6: TMenuItem; |
| 281 |
T9: TMenuItem; |
| 282 |
C2: TMenuItem; |
| 283 |
SelectComboBox: TComboBox; |
| 284 |
MainCoolBarPopupMenu: TPopupMenu; |
| 285 |
StdToolBarVisiblePMenu: TMenuItem; |
| 286 |
AddressToolBarVisiblePMenu: TMenuItem; |
| 287 |
LinkToolBarVisiblePMenu: TMenuItem; |
| 288 |
NG1: TMenuItem; |
| 289 |
NG2: TMenuItem; |
| 290 |
N43: TMenuItem; |
| 291 |
N44: TMenuItem; |
| 292 |
L9: TMenuItem; |
| 293 |
I3: TMenuItem; |
| 294 |
N45: TMenuItem; |
| 295 |
B9: TMenuItem; |
| 296 |
R5: TMenuItem; |
| 297 |
T12: TMenuItem; |
| 298 |
Show3: TMenuItem; |
| 299 |
N46: TMenuItem; |
| 300 |
T13: TMenuItem; |
| 301 |
B10: TMenuItem; |
| 302 |
N47: TMenuItem; |
| 303 |
A12: TMenuItem; |
| 304 |
U4: TMenuItem; |
| 305 |
F4: TMenuItem; |
| 306 |
N48: TMenuItem; |
| 307 |
T14: TMenuItem; |
| 308 |
ToolButton16: TToolButton; |
| 309 |
N50: TMenuItem; |
| 310 |
A11: TMenuItem; |
| 311 |
S5: TMenuItem; |
| 312 |
Reload: TMenuItem; |
| 313 |
GoBack: TMenuItem; |
| 314 |
GoFoward: TMenuItem; |
| 315 |
IndividualAbon1: TMenuItem; |
| 316 |
N41: TMenuItem; |
| 317 |
IndividualAbon2: TMenuItem; |
| 318 |
AntiIndivAbonMenuItem: TMenuItem; |
| 319 |
AntiIndividualAbon: TMenuItem; |
| 320 |
N49: TMenuItem; |
| 321 |
N51: TMenuItem; |
| 322 |
N52: TMenuItem; |
| 323 |
SearchBoardName: TMenuItem; |
| 324 |
TreeSelectLogDeleteSeparator: TMenuItem; |
| 325 |
N54: TMenuItem; |
| 326 |
A13: TMenuItem; |
| 327 |
FavoriteTreePopupMenu: TPopupMenu; |
| 328 |
FavoriteTreeRenamePopupMenu: TMenuItem; |
| 329 |
FavoriteTreeNewFolderPopupMenu: TMenuItem; |
| 330 |
N56: TMenuItem; |
| 331 |
FavoriteTreeDeletePopupMenu: TMenuItem; |
| 332 |
FavoriteToolBar: TToolBar; |
| 333 |
FavoriteAddToolButton: TToolButton; |
| 334 |
FavoriteArrangeToolButton: TToolButton; |
| 335 |
FavoriteTreeBrowseFolderPopupMenu: TMenuItem; |
| 336 |
N57: TMenuItem; |
| 337 |
FavoriteTreeReloadPopupMenu: TMenuItem; |
| 338 |
N58: TMenuItem; |
| 339 |
FavoriteTreeURLCopyPopupMenu: TMenuItem; |
| 340 |
FavoriteTreeNameCopyPopupMenu: TMenuItem; |
| 341 |
FavoriteTreeLogDeletePopupMenu: TMenuItem; |
| 342 |
N59: TMenuItem; |
| 343 |
FavoriteTreeNameURLCopyPopupMenu: TMenuItem; |
| 344 |
ToolButton20: TToolButton; |
| 345 |
N60: TMenuItem; |
| 346 |
ExportFavoriteFileAction1: TMenuItem; |
| 347 |
N6: TMenuItem; |
| 348 |
N17: TMenuItem; |
| 349 |
N18: TMenuItem; |
| 350 |
N20: TMenuItem; |
| 351 |
N24: TMenuItem; |
| 352 |
N62: TMenuItem; |
| 353 |
N61: TMenuItem; |
| 354 |
N63: TMenuItem; |
| 355 |
N64: TMenuItem; |
| 356 |
dummy1: TMenuItem; |
| 357 |
TreeSelectLogDeletePopupMenu: TMenuItem; |
| 358 |
N65: TMenuItem; |
| 359 |
BBSSelectPopupMenu: TPopupMenu; |
| 360 |
PlugInMenu: TMenuItem; |
| 361 |
TreeSelectNamePupupMenu: TMenuItem; |
| 362 |
BrowserPanel: TPanel; |
| 363 |
SelectTimer: TTimer; |
| 364 |
SelectThreadSave: TMenuItem; |
| 365 |
N55: TMenuItem; |
| 366 |
N66: TMenuItem; |
| 367 |
dat1: TMenuItem; |
| 368 |
OpenLogFolder: TMenuItem; |
| 369 |
Browser: TWebBrowser; |
| 370 |
TabSave: TMenuItem; |
| 371 |
TabOpen: TMenuItem; |
| 372 |
ResRangePopupMenu: TPopupMenu; |
| 373 |
ResRangeHundPMenuItem: TMenuItem; |
| 374 |
ResRangeKokoPMenuItem: TMenuItem; |
| 375 |
ResRangeNewPMenuItem: TMenuItem; |
| 376 |
ResRangeAllPMenuItem: TMenuItem; |
| 377 |
BrowsBoradHeadAction1: TMenuItem; |
| 378 |
ThreadRangePopupMenu: TPopupMenu; |
| 379 |
A15: TMenuItem; |
| 380 |
L8: TMenuItem; |
| 381 |
N67: TMenuItem; |
| 382 |
N68: TMenuItem; |
| 383 |
S6: TMenuItem; |
| 384 |
N69: TMenuItem; |
| 385 |
ResRangeSelectPMenuItem: TMenuItem; |
| 386 |
ListColumnPopupMenu: TPopupMenu; |
| 387 |
N70: TMenuItem; |
| 388 |
ID1: TMenuItem; |
| 389 |
ID2: TMenuItem; |
| 390 |
N53: TMenuItem; |
| 391 |
ID3: TMenuItem; |
| 392 |
N71: TMenuItem; |
| 393 |
N72: TMenuItem; |
| 394 |
N73: TMenuItem; |
| 395 |
SelectComboBoxPanel: TPanel; |
| 396 |
SelectComboBoxSplitter: TImage; |
| 397 |
ToolButton1: TToolButton; |
| 398 |
N74: TMenuItem; |
| 399 |
WikiFAQ: TMenuItem; |
| 400 |
GikoApplicationEvents: TApplicationEvents; |
| 401 |
procedure FormCreate(Sender: TObject); |
| 402 |
procedure FormDestroy(Sender: TObject); |
| 403 |
procedure BrowserStatusTextChange(Sender: TObject; |
| 404 |
const Text: WideString); |
| 405 |
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); |
| 406 |
procedure TreeViewChanging(Sender: TObject; Node: TTreeNode; |
| 407 |
var AllowChange: Boolean); |
| 408 |
procedure ListViewKeyDown(Sender: TObject; var Key: Word; |
| 409 |
Shift: TShiftState); |
| 410 |
procedure ListViewColumnClick(Sender: TObject; Column: TListColumn); |
| 411 |
procedure MenuToolBarCustomDrawButton(Sender: TToolBar; |
| 412 |
Button: TToolButton; State: TCustomDrawState; |
| 413 |
var DefaultDraw: Boolean); |
| 414 |
procedure BrowserBeforeNavigate2(Sender: TObject; |
| 415 |
const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, |
| 416 |
Headers: OleVariant; var Cancel: WordBool); |
| 417 |
procedure TreeViewCustomDraw(Sender: TCustomTreeView; |
| 418 |
const ARect: TRect; var DefaultDraw: Boolean); |
| 419 |
procedure TreeViewCustomDrawItem(Sender: TCustomTreeView; |
| 420 |
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); |
| 421 |
procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode); |
| 422 |
procedure TreeViewDblClick(Sender: TObject); |
| 423 |
procedure ListViewCustomDraw(Sender: TCustomListView; |
| 424 |
const ARect: TRect; var DefaultDraw: Boolean); |
| 425 |
procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton; |
| 426 |
Shift: TShiftState; X, Y: Integer); |
| 427 |
procedure TreeViewCollapsed(Sender: TObject; Node: TTreeNode); |
| 428 |
procedure MessageListViewResize(Sender: TObject); |
| 429 |
procedure CabinetVisible( isVisible : Boolean ); |
| 430 |
procedure FormResize(Sender: TObject); |
| 431 |
procedure ListPopupMenuPopup(Sender: TObject); |
| 432 |
procedure TreePopupMenuPopup(Sender: TObject); |
| 433 |
procedure BrowserNewWindow2(Sender: TObject; var ppDisp: IDispatch; |
| 434 |
var Cancel: WordBool); |
| 435 |
procedure ListSplitterMoved(Sender: TObject); |
| 436 |
procedure BrowserTabChange(Sender: TObject); |
| 437 |
procedure BrowserTabMouseDown(Sender: TObject; Button: TMouseButton; |
| 438 |
Shift: TShiftState; X, Y: Integer); |
| 439 |
procedure BrowserTabDragOver(Sender, Source: TObject; X, Y: Integer; |
| 440 |
State: TDragState; var Accept: Boolean); |
| 441 |
procedure BrowserTabDragDrop(Sender, Source: TObject; X, Y: Integer); |
| 442 |
procedure BrowserTabMouseMove(Sender: TObject; Shift: TShiftState; X, |
| 443 |
Y: Integer); |
| 444 |
procedure BrowserDocumentComplete(Sender: TObject; |
| 445 |
const pDisp: IDispatch; var URL: OleVariant); |
| 446 |
procedure RoundNamePopupMenuPopup(Sender: TObject); |
| 447 |
procedure FormShow(Sender: TObject); |
| 448 |
procedure BrowserTabToolBarResize(Sender: TObject); |
| 449 |
procedure FavoriteMenuClick(Sender: TObject); |
| 450 |
procedure MainCoolBarResize(Sender: TObject); |
| 451 |
procedure AddressToolBarResize(Sender: TObject); |
| 452 |
procedure AddressComboBoxKeyDown(Sender: TObject; var Key: Word; |
| 453 |
Shift: TShiftState); |
| 454 |
procedure BrowserEnter(Sender: TObject); |
| 455 |
procedure FormShortCut(var Msg: TWMKey; var Handled: Boolean); |
| 456 |
procedure PreviewTimerTimer(Sender: TObject); |
| 457 |
procedure MessageHideButtonClick(Sender: TObject); |
| 458 |
procedure HistoryAllClearToolButtonClick(Sender: TObject); |
| 459 |
procedure MainCoolBarBandInfo(Sender: TObject; |
| 460 |
var BandInfo: PReBarBandInfoA); |
| 461 |
procedure MainCoolBarChevronClick(Sender: TObject; |
| 462 |
RebarChevron: PNMRebarChevron); |
| 463 |
procedure ListCoolBarBandInfo(Sender: TObject; |
| 464 |
var BandInfo: PReBarBandInfoA); |
| 465 |
procedure ListCoolBarChevronClick(Sender: TObject; |
| 466 |
RebarChevron: PNMRebarChevron); |
| 467 |
procedure BrowserCoolBarBandInfo(Sender: TObject; |
| 468 |
var BandInfo: PReBarBandInfoA); |
| 469 |
procedure BrowserCoolBarChevronClick(Sender: TObject; |
| 470 |
RebarChevron: PNMRebarChevron); |
| 471 |
procedure ListViewColumnInfo(Sender: TObject; var Column: PLVColumnA); |
| 472 |
procedure FormMouseWheel(Sender: TObject; Shift: TShiftState; |
| 473 |
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); |
| 474 |
procedure SelectComboBoxChange(Sender: TObject); |
| 475 |
procedure SelectComboBoxKeyDown(Sender: TObject; var Key: Word; |
| 476 |
Shift: TShiftState); |
| 477 |
procedure SelectComboBoxExit(Sender: TObject); |
| 478 |
procedure SelectComboBoxSplitterMouseMove(Sender: TObject; |
| 479 |
Shift: TShiftState; X, Y: Integer); |
| 480 |
procedure SelectComboBoxSplitterMouseDown(Sender: TObject; |
| 481 |
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
| 482 |
procedure SelectComboBoxSplitterMouseUp(Sender: TObject; |
| 483 |
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
| 484 |
procedure StatusBarResize(Sender: TObject); |
| 485 |
procedure SelectComboBoxEnter(Sender: TObject); |
| 486 |
procedure FavoriteTreeViewDragDrop(Sender, Source: TObject; X, |
| 487 |
Y: Integer); |
| 488 |
procedure FavoriteTreeViewDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); |
| 489 |
procedure FavoriteTreeViewEdited(Sender: TObject; Node: TTreeNode; |
| 490 |
var S: String); |
| 491 |
procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word; |
| 492 |
Shift: TShiftState); |
| 493 |
procedure FavoriteTreePopupMenuPopup(Sender: TObject); |
| 494 |
procedure FavoriteTreeViewDblClick(Sender: TObject); |
| 495 |
procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer); |
| 496 |
procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton; |
| 497 |
Shift: TShiftState; X, Y: Integer); |
| 498 |
procedure LinkToolBarDragOver(Sender, Source: TObject; X, Y: Integer; |
| 499 |
State: TDragState; var Accept: Boolean); |
| 500 |
procedure FavoriteTreeViewEndDrag(Sender, Target: TObject; X, |
| 501 |
Y: Integer); |
| 502 |
procedure ListCoolBarContextPopup(Sender: TObject; MousePos: TPoint; |
| 503 |
var Handled: Boolean); |
| 504 |
procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint; |
| 505 |
var Handled: Boolean); |
| 506 |
procedure BrowserCoolBarContextPopup(Sender: TObject; MousePos: TPoint; |
| 507 |
var Handled: Boolean); |
| 508 |
procedure FavoriteTreeBrowseBoardPopupMenuClick(Sender: TObject); |
| 509 |
procedure BrowserTabContextPopup(Sender: TObject; MousePos: TPoint; |
| 510 |
var Handled: Boolean); |
| 511 |
procedure BrowserTabPopupMenuPopup(Sender: TObject); |
| 512 |
procedure BrowserTabResize(Sender: TObject); |
| 513 |
procedure TreeViewClick(Sender: TObject); |
| 514 |
procedure TreeViewKeyDown(Sender: TObject; var Key: Word; |
| 515 |
Shift: TShiftState); |
| 516 |
procedure FavoriteTreeViewMouseDown(Sender: TObject; |
| 517 |
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
| 518 |
procedure MessagePanelResize(Sender: TObject); |
| 519 |
procedure OnResized; |
| 520 |
procedure FavoriteTreeViewMouseUp(Sender: TObject; |
| 521 |
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
| 522 |
procedure SelectTimerTimer(Sender: TObject); |
| 523 |
procedure ListViewColumnRightClick(Sender: TObject; |
| 524 |
Column: TListColumn; Point: TPoint); |
| 525 |
procedure ListViewCustomDrawItem(Sender: TCustomListView; |
| 526 |
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); |
| 527 |
procedure FormActivate(Sender: TObject); |
| 528 |
procedure BrowserPanelResize(Sender: TObject); |
| 529 |
procedure MenuToolBarResize(Sender: TObject); |
| 530 |
procedure ListToolBarResize(Sender: TObject); |
| 531 |
procedure BrowserToolBarResize(Sender: TObject); |
| 532 |
procedure KokoPopupMenuPopup(Sender: TObject); |
| 533 |
procedure ListViewKeyUp(Sender: TObject; var Key: Word; |
| 534 |
Shift: TShiftState); |
| 535 |
procedure FavoriteTreeViewEditing(Sender: TObject; Node: TTreeNode; |
| 536 |
var AllowEdit: Boolean); |
| 537 |
procedure CabinetCloseSpeedButtonClick(Sender: TObject); |
| 538 |
procedure FavoriteArrangeToolButtonClick(Sender: TObject); |
| 539 |
procedure GikoApplicationEventsMessage(var Msg: tagMSG; |
| 540 |
var Handled: Boolean); |
| 541 |
procedure GikoApplicationEventsDeactivate(Sender: TObject); |
| 542 |
procedure GikoApplicationEventsException(Sender: TObject; E: Exception); |
| 543 |
procedure FavoriteTreeViewClick(Sender: TObject); |
| 544 |
procedure FavoriteTreeViewCollapsing(Sender: TObject; Node: TTreeNode; |
| 545 |
var AllowCollapse: Boolean); |
| 546 |
procedure FavoriteTreeViewExpanding(Sender: TObject; Node: TTreeNode; |
| 547 |
var AllowExpansion: Boolean); |
| 548 |
procedure TreeViewCollapsing(Sender: TObject; Node: TTreeNode; |
| 549 |
var AllowCollapse: Boolean); |
| 550 |
procedure TreeViewExpanding(Sender: TObject; Node: TTreeNode; |
| 551 |
var AllowExpansion: Boolean); |
| 552 |
procedure TreeViewMouseUp(Sender: TObject; Button: TMouseButton; |
| 553 |
Shift: TShiftState; X, Y: Integer); |
| 554 |
private |
| 555 |
{ Private 鐃緒申鐃緒申 } |
| 556 |
FSortIndex: Integer; |
| 557 |
FSortOrder: Boolean; |
| 558 |
FEnabledCloseButton: Boolean; |
| 559 |
FClickNode: TTreeNode; |
| 560 |
FHttpState: Boolean; |
| 561 |
FHint: TResPopup; |
| 562 |
FPreviewBrowser: TWebBrowser; |
| 563 |
FPreviewURL: string; |
| 564 |
FBrowserSizeHeight: Integer; |
| 565 |
FBrowserSizeWidth: Integer; |
| 566 |
FTabHintIndex: Integer; |
| 567 |
FListStyle: TViewStyle; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申 |
| 568 |
FItemNoVisible: Boolean; //鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃? |
| 569 |
FViewType: TGikoViewType; //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃? |
| 570 |
FActiveList: TObject; |
| 571 |
FActiveContent: TBrowserRecord; // |
| 572 |
FActiveBBS : TBBS; |
| 573 |
FHistoryList: TList; //鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃? |
| 574 |
FTreeType: TGikoTreeType; |
| 575 |
FWorkCount: Integer; |
| 576 |
FNameCookie: string; |
| 577 |
FMailCookie: string; |
| 578 |
FDownloadTitle: string; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申 |
| 579 |
FDownloadMax: Integer; //鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃? |
| 580 |
FEvent: THTMLDocumentEventSink;//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃? |
| 581 |
IsDraggingSelectComboBox : Boolean; |
| 582 |
DraggingSelectComboBoxPosition : TPoint; |
| 583 |
FSearchDialog: TSearchDialog; |
| 584 |
FDropSpaceNode: TTreeNode; |
| 585 |
FDragTime : Cardinal; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃? |
| 586 |
FDragButton : TToolButton; ///< 鐃緒申鐃緒申鐃?鐃緒申D&D鐃?鐃緒申Drag鐃緒申鐃緒申鐃緒申Button鐃緒申鐃緒申 |
| 587 |
FDragWFirst : Boolean; ///< WebTab鐃緒申D&D鐃? |
| 588 |
FListViewBackGroundColor : TColor; ///< ListView鐃緒申BackGroundColor |
| 589 |
FUseOddResOddColor : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申 |
| 590 |
FOddColor : TColor; ///< 鐃緒申鐃緒申鐃? |
| 591 |
FSelectResWord : string; ///< 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃? |
| 592 |
FIsIgnoreResize : TResizeType; ///< 鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 593 |
FIsMinimize : TMinimizeType; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 594 |
FOldFormWidth : Integer; ///< 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 595 |
FToolBarSettingSender : TToolBarSettingSenderType; ///< 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃? |
| 596 |
FMouseDownPos : TPoint; ///< 鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃? |
| 597 |
FBrowsers: TList; |
| 598 |
FResRangeMenuSelect : Longint; ///< ResRangeButton 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 (鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申 ResRange 鐃緒申鐃緒申) |
| 599 |
FStartUp : Boolean; |
| 600 |
FIsHandledWheel : Boolean; ///< 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 WM_MOUSEWHEEL 鐃緒申鐃緒申鐃緒申鐃緒申 |
| 601 |
DiffComp: Boolean; //Add by Genyakun 鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申True鐃緒申鐃緒申鐃緒申 |
| 602 |
FOrigenCaption: String; //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 603 |
procedure DownloadEnd(Sender: TObject; Item: TDownloadItem); |
| 604 |
procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon); |
| 605 |
procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string); |
| 606 |
procedure WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer); |
| 607 |
procedure Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer); |
| 608 |
procedure ListClick; |
| 609 |
procedure ListDoubleClick(Shift: TShiftState); |
| 610 |
function Hook(var Message: TMessage): Boolean; |
| 611 |
procedure AddRoundNameMenu(MenuItem: TMenuItem); |
| 612 |
procedure SetMenuFont; |
| 613 |
procedure CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem); |
| 614 |
procedure FavoriteClick(Sender: TObject; ActiveTab: Boolean); overload; |
| 615 |
procedure FavoriteClick(Sender: TObject); overload; |
| 616 |
procedure FavoriteDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); |
| 617 |
function OnDocumentContextMenu(Sender: TObject): WordBool; |
| 618 |
procedure ShowTextPopup; |
| 619 |
function GetWidthAllToolButton(ToolBar: TToolBar): Integer; |
| 620 |
procedure MenuBarChevronMenu; |
| 621 |
procedure LinkBarChevronMenu; |
| 622 |
procedure ToolBarChevronMenu(ToolBar: TToolBar); |
| 623 |
procedure LinkToolButtonDragDrop(Sender, Source: TObject; X, Y: Integer); |
| 624 |
procedure LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
| 625 |
procedure LinkToolButtonOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); |
| 626 |
procedure LinkToolButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
| 627 |
procedure LinkToolButtonStartDrag(Sender: TObject; var DragObject: TDragObject); |
| 628 |
function TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode; |
| 629 |
procedure FavoriteMoveTo( SenderNode, SourceNode: TTreeNode ); |
| 630 |
procedure FavoriteAddTo( SenderNode: TTreeNode; Source: TObject ); |
| 631 |
procedure FavoriteDragDrop( SenderNode: TTreeNode; Source: TObject ); |
| 632 |
// |
| 633 |
procedure SetListViewBackGroundColor(value: TColor); |
| 634 |
procedure BBSMenuItemOnClick( Sender : TObject ); |
| 635 |
/// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 636 |
procedure SaveCoolBarSettings; |
| 637 |
procedure SaveMainCoolBarSettings; |
| 638 |
procedure SaveBoardCoolBarSettings; |
| 639 |
procedure SaveBrowserCoolBarSettings; |
| 640 |
/// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 641 |
procedure LoadCoolBarSettings; |
| 642 |
/// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 643 |
procedure OnMinimize; |
| 644 |
/// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 645 |
procedure OnMinimized; |
| 646 |
/// TreeView 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 647 |
procedure TreeClick( Node : TTreeNode ); |
| 648 |
/// TreeView 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 649 |
procedure TreeDoubleClick( Node : TTreeNode ); |
| 650 |
/// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃? |
| 651 |
procedure SetBBSMenu; |
| 652 |
/// 鐃?鐃?鐃緒申鐃緒申 |
| 653 |
function GetTabURLs(AStringList: TStringList) : Boolean; |
| 654 |
/// ListColumnPopupMenu 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃? |
| 655 |
procedure ListColumnPopupMenuOnClick( Sender : TObject ); |
| 656 |
//! 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 657 |
procedure SetSelectWord( const text : string ); |
| 658 |
//鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 659 |
function GetScreenCursor(): TCursor; |
| 660 |
//鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 661 |
procedure SetScreenCursor(Cursor : TCursor); |
| 662 |
//! 鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 663 |
procedure InitActionChecked(); |
| 664 |
//! 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 665 |
procedure CreateControlThread(); |
| 666 |
//! 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 667 |
procedure CreateBrowsers(count: Integer); |
| 668 |
protected |
| 669 |
procedure CreateParams(var Params: TCreateParams); override; |
| 670 |
procedure WndProc(var Message: TMessage); override; |
| 671 |
procedure WMSetCursor(var Message: TWMSetCursor); message WM_SETCURSOR; |
| 672 |
procedure WMSettingChange(var Message: TWMWinIniChange); message WM_SETTINGCHANGE; |
| 673 |
procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA; |
| 674 |
|
| 675 |
public |
| 676 |
{ Public 鐃緒申鐃緒申 } |
| 677 |
LastRoundTime: TDateTime; |
| 678 |
BrowserNullTab: TBrowserRecord; |
| 679 |
FControlThread: TThreadControl; |
| 680 |
procedure MoveToURL(const inURL: string); |
| 681 |
function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord; |
| 682 |
procedure ReloadBBS; |
| 683 |
function GetHttpState: Boolean; |
| 684 |
procedure SetEnabledCloseButton(Enabled: Boolean); |
| 685 |
function GetTreeNode(Data: TObject): TTreeNode; |
| 686 |
procedure ListViewAllSelect; |
| 687 |
property ListStyle: TViewStyle read FListStyle write FListStyle; |
| 688 |
property ItemNoVisible: Boolean read FItemNoVisible write FItemNoVisible; |
| 689 |
property ViewType: TGikoViewType read FViewType write FViewType; |
| 690 |
property NameCookie: string read FNameCookie write FNameCookie; |
| 691 |
property MailCookie: string read FMailCookie write FMailCookie; |
| 692 |
property ClickNode: TTreeNode read FClickNode write FClickNode; |
| 693 |
property TreeType: TGikoTreeType read FTreeType write FTreeType; |
| 694 |
property ActiveContent: TBrowserRecord read FActiveContent write FActiveContent; |
| 695 |
property ResRangeMenuSelect: Longint read FResRangeMenuSelect write FResRangeMenuSelect; |
| 696 |
property SelectResWord : string read FSelectResWord write FSelectResWord; |
| 697 |
property BrowserSizeWidth: Integer read FBrowserSizeWidth write FBrowserSizeWidth; |
| 698 |
property BrowserSizeHeight: Integer read FBrowserSizeHeight write FBrowserSizeHeight; |
| 699 |
property SearchDialog: TSearchDialog read FSearchDialog write FSearchDialog; |
| 700 |
property ToolBarSettingSender : TToolBarSettingSenderType |
| 701 |
read FToolBarSettingSender write FToolBarSettingSender; |
| 702 |
property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor; |
| 703 |
property SortIndex: Integer read FSortIndex write FSortIndex; |
| 704 |
property SortOrder: Boolean read FSortOrder write FSortOrder; |
| 705 |
property ActiveBBS : TBBS read FActiveBBS write FActiveBBS; |
| 706 |
property WorkCount: Integer read FWorkCount write FWorkCount; |
| 707 |
procedure SetContent(inThread: TBrowserRecord); |
| 708 |
function GetActiveContent: TThreadItem; |
| 709 |
function GetActiveList: TObject; |
| 710 |
|
| 711 |
procedure SetListViewType(AViewType: TGikoViewType); overload; |
| 712 |
procedure SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); overload; |
| 713 |
procedure PlaySound(SoundEventName: string); |
| 714 |
function AddHistory( FavItem: TFavoriteThreadItem ): Boolean; |
| 715 |
procedure ClearHistory; |
| 716 |
procedure SaveHistory; |
| 717 |
procedure LoadHistory; |
| 718 |
procedure ShowBBSTree( inBBS : TBBS ); |
| 719 |
procedure ShowBBSTreeOld( inBBS : TBBS ); |
| 720 |
procedure ShowHistoryTree; |
| 721 |
procedure SetHistoryTreeNode; |
| 722 |
procedure AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon); |
| 723 |
procedure SetBrowserTabState; |
| 724 |
procedure SetToolBarPopup; |
| 725 |
procedure ShowFavoriteAddDialog( Item : TObject ); |
| 726 |
procedure FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList); |
| 727 |
procedure RoundListURLReplace(oldURLs: TStringList; newURLs: TStringList); |
| 728 |
property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor; |
| 729 |
property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor; |
| 730 |
property OddColor : TColor read FOddColor write FOddColor; |
| 731 |
function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton; |
| 732 |
procedure OnPlugInMenuItem( Sender : TObject ); |
| 733 |
procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList); |
| 734 |
/// ListView 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申 KuroutSetting鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 735 |
procedure ActiveListColumnSave; |
| 736 |
procedure SetActiveList(Obj: TObject); |
| 737 |
property ActiveList: TObject read GetActiveList write SetActiveList; |
| 738 |
/// CoolBar 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申 |
| 739 |
procedure CoolBarResized(Sender: TObject; CoolBar: TCoolBar); |
| 740 |
//鐃緒申鐃緒申ID鐃緒申鐃緒申鐃緒申鐃?鐃緒申 |
| 741 |
procedure IndividualAbonID(Atype : Integer); |
| 742 |
//鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申 |
| 743 |
procedure IndividualAbon(Atag, Atype : Integer); |
| 744 |
//鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申 true:鐃?鐃緒申鐃緒申鐃?鐃? false:鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 745 |
procedure RepaintAllTabsBrowser(); |
| 746 |
//鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申 |
| 747 |
procedure SetLinkBar; |
| 748 |
procedure FavoriteBrowseFolder( node: TTreeNode ); |
| 749 |
//鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃? |
| 750 |
procedure DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False); |
| 751 |
//鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃? |
| 752 |
procedure DownloadList(Board: TBoard; ForceDownload: Boolean = False); |
| 753 |
//鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 754 |
procedure DeleteHistory( threadItem: TThreadItem ); |
| 755 |
//鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 756 |
procedure DeleteTab(ThreadItem: TThreadItem); overload; |
| 757 |
procedure DeleteTab(BrowserRecord: TBrowserRecord); overload; |
| 758 |
//鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申 |
| 759 |
procedure BrowserMovement(const AName: string); |
| 760 |
//Application鐃緒申MainForm鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 761 |
function GetMainForm(): TComponent; |
| 762 |
procedure SelectTreeNode(Item: TObject; CallEvent: Boolean); |
| 763 |
//! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃? |
| 764 |
procedure OnGestureStart(Sender: TObject); |
| 765 |
//! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申 |
| 766 |
procedure OnGestureMove(Sender: TObject); |
| 767 |
//! 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申 |
| 768 |
procedure OnGestureEnd(Sender: TObject); |
| 769 |
/// 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 770 |
procedure ResetBandInfo( bar : TGikoCoolBar; band : TToolBar ); |
| 771 |
//鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃緒申 |
| 772 |
function EditorFormExists(): boolean; |
| 773 |
//鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 774 |
procedure AllEditroFormNameTextClearClear(); |
| 775 |
//鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申EditorForm鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 776 |
procedure AllEditroFormMailTextClearClear(); |
| 777 |
//ListView鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 778 |
procedure SelectListItem(List: TList); |
| 779 |
/// 鐃?鐃?鐃緒申鐃緒申 |
| 780 |
function SaveTabURLs : Boolean; |
| 781 |
/// 鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申 |
| 782 |
function LoadTabURLs : Boolean; |
| 783 |
//鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申 |
| 784 |
procedure KonoresCopy(Number: Integer; ReplaceTag : Boolean); |
| 785 |
// |
| 786 |
procedure ModifySelectList; |
| 787 |
// |
| 788 |
procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string); overload; |
| 789 |
// |
| 790 |
procedure SetSelectItemRound(RoundFlag: Boolean; RoundName: string; ParentName: string); overload; |
| 791 |
// |
| 792 |
procedure SetSelectRoundName(Sender: TObject); |
| 793 |
// |
| 794 |
function GetCoolBand(CoolBar: TCoolBar; Control: TWinControl): TCoolBand; |
| 795 |
// |
| 796 |
function WebBrowserClick(Sender: TObject): WordBool; |
| 797 |
//! 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 798 |
procedure SetSelectComboBox(); |
| 799 |
published |
| 800 |
property EnabledCloseButton: Boolean read FEnabledCloseButton write SetEnabledCloseButton; |
| 801 |
end; |
| 802 |
|
| 803 |
TFavoriteMenuItem = class(TMenuItem) |
| 804 |
private |
| 805 |
FData : Pointer; |
| 806 |
public |
| 807 |
property Data: Pointer read FData write FData; |
| 808 |
end; |
| 809 |
|
| 810 |
TBBSMenuItem = class(TMenuItem) |
| 811 |
private |
| 812 |
FData : Pointer; |
| 813 |
public |
| 814 |
property Data: Pointer read FData write FData; |
| 815 |
end; |
| 816 |
|
| 817 |
TLinkToolButton = class(TToolButton) |
| 818 |
private |
| 819 |
FData : Pointer; |
| 820 |
public |
| 821 |
property Data: Pointer read FData write FData; |
| 822 |
end; |
| 823 |
|
| 824 |
var |
| 825 |
GikoForm: TGikoForm; |
| 826 |
|
| 827 |
implementation |
| 828 |
|
| 829 |
uses |
| 830 |
GikoUtil, IndividualAbon, Math, Kotehan, KeySetting, |
| 831 |
YofUtils, ShellAPI, ToolBarUtil, ToolBarSetting, |
| 832 |
GikoXMLDoc, RoundName, IniFiles, FavoriteAdd, |
| 833 |
FavoriteArrange, AddressHistory, Preview, Gesture, |
| 834 |
About, Option, Round, Splash, Sort, ListSelect, Imm, |
| 835 |
NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter, |
| 836 |
HTMLCreate, ListViewUtils, GikoDataModule, GikoMessage; |
| 837 |
|
| 838 |
const |
| 839 |
BLANK_HTML: string = 'about:blank'; |
| 840 |
BROWSER_COUNT = 5; //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 841 |
//D&D鐃緒申鐃? |
| 842 |
DandD_THRESHOLD = 5; //D&D鐃緒申鐃緒申鐃?鐃?pixcel) |
| 843 |
//鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申 |
| 844 |
HTML_FILE_NAME = 'temp_preview.html'; |
| 845 |
ITEM_ICON_THREADLOG1 = 6; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃? |
| 846 |
ITEM_ICON_THREADLOG2 = 7; //鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃? |
| 847 |
//鐃緒申鐃?鐃?鐃?鐃?ID |
| 848 |
USER_TREECLICK = WM_USER + 2000; |
| 849 |
USER_RESIZED = WM_USER + 2001; |
| 850 |
USER_MINIMIZED = WM_USER + 2002; |
| 851 |
USER_SETLINKBAR = WM_USER + 2003; |
| 852 |
USER_DOCUMENTCOMPLETE = WM_USER + 2004; ///< wParam : TWebBrowser |
| 853 |
{$R *.DFM} |
| 854 |
|
| 855 |
procedure TGikoForm.CreateParams(var Params: TCreateParams); |
| 856 |
begin |
| 857 |
inherited; |
| 858 |
if FormStyle in [fsNormal, fsStayOnTop] then begin |
| 859 |
if BorderStyle in [bsSingle, bsSizeable] then begin |
| 860 |
Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW; |
| 861 |
Params.WndParent := 0; |
| 862 |
end; |
| 863 |
end; |
| 864 |
end; |
| 865 |
|
| 866 |
procedure TGikoForm.FormCreate(Sender: TObject); |
| 867 |
const |
| 868 |
TVS_NOTOOLTIPS = $0080; |
| 869 |
var |
| 870 |
FileName: string; |
| 871 |
Style: DWORD; |
| 872 |
msg: string; |
| 873 |
i: Integer; |
| 874 |
wp: TWindowPlacement; |
| 875 |
s: string; |
| 876 |
begin |
| 877 |
{$IFDEF DEBUG} |
| 878 |
AllocConsole; |
| 879 |
Writeln('============================================================'); |
| 880 |
Writeln(' 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? 鐃?鐃緒申鐃?鐃?鐃緒申'); |
| 881 |
Writeln(''); |
| 882 |
Writeln(' 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?'); |
| 883 |
Writeln(' 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申'); |
| 884 |
Writeln('============================================================'); |
| 885 |
{$ENDIF} |
| 886 |
FTreeType := gttNone; |
| 887 |
// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 888 |
FStartUp := true; |
| 889 |
Application.HookMainWindow(Hook); |
| 890 |
FIsIgnoreResize := rtResizing; |
| 891 |
|
| 892 |
FSearchDialog := nil; |
| 893 |
CreateBrowsers(BROWSER_COUNT); |
| 894 |
|
| 895 |
//鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃? |
| 896 |
SetMenuFont; |
| 897 |
|
| 898 |
//鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申 |
| 899 |
Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND'); |
| 900 |
|
| 901 |
//鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 902 |
//AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount); |
| 903 |
AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount); |
| 904 |
|
| 905 |
EnabledCloseButton := True; |
| 906 |
|
| 907 |
//鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申 |
| 908 |
ListView.ViewStyle := GikoSys.Setting.ListStyle; |
| 909 |
|
| 910 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃? |
| 911 |
AnimePanel.Top := 0; |
| 912 |
AnimePanel.Left := 0; |
| 913 |
|
| 914 |
//鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 915 |
|
| 916 |
//鐃?鐃緒申鐃?鐃?鐃?鐃? |
| 917 |
CabinetPanel.Width := GikoSys.Setting.CabinetWidth; |
| 918 |
|
| 919 |
//鐃緒申鐃?鐃?鐃?鐃?鐃?鐃? |
| 920 |
GikoDM.MsgBarVisibleAction.Checked := GikoSys.Setting.MessageBarVisible; |
| 921 |
GikoDM.MsgBarVisibleActionExecute(nil); |
| 922 |
MessagePanel.Height := GikoSys.Setting.MessegeBarHeight; |
| 923 |
|
| 924 |
//鐃?鐃?鐃?鐃?鐃?鐃?鐃? |
| 925 |
GikoDM.StatusBarVisibleAction.Checked := GikoSys.Setting.StatusBarVisible; |
| 926 |
GikoDM.StatusBarVisibleActionExecute(nil); |
| 927 |
|
| 928 |
//鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申 |
| 929 |
TreeView.Items.BeginUpdate; |
| 930 |
FavoriteTreeView.Items.BeginUpdate; |
| 931 |
ListView.Items.BeginUpdate; |
| 932 |
try |
| 933 |
TreeView.Font.Name := GikoSys.Setting.CabinetFontName; |
| 934 |
TreeView.Font.Size := GikoSys.Setting.CabinetFontSize; |
| 935 |
TreeView.Font.Color := GikoSys.Setting.CabinetFontColor; |
| 936 |
TreeView.Color := GikoSys.Setting.CabinetBackColor; |
| 937 |
FavoriteTreeView.Font.Assign(TreeView.Font); |
| 938 |
FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor; |
| 939 |
|
| 940 |
ListView.Font.Name := GikoSys.Setting.ListFontName; |
| 941 |
ListView.Font.Size := GikoSys.Setting.ListFontSize; |
| 942 |
ListView.Font.Color := GikoSys.Setting.ListFontColor; |
| 943 |
ListView.Font.Style := []; |
| 944 |
if GikoSys.Setting.ListFontBold then |
| 945 |
ListView.Font.Style := [fsbold]; |
| 946 |
if GikoSys.Setting.ListFontItalic then |
| 947 |
ListView.Font.Style := ListView.Font.Style + [fsitalic]; |
| 948 |
|
| 949 |
ListViewBackGroundColor := clWhite; // 鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 950 |
ListViewBackGroundColor := GikoSys.Setting.ListBackColor; // 鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃? |
| 951 |
FUseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum; |
| 952 |
FOddColor := GikoSys.Setting.OddColor; |
| 953 |
|
| 954 |
finally |
| 955 |
TreeView.Items.EndUpdate; |
| 956 |
FavoriteTreeView.Items.EndUpdate; |
| 957 |
ListView.Items.EndUpdate; |
| 958 |
end; |
| 959 |
//ViewNoButton.Down := GikoSys.Setting.ListViewNo; |
| 960 |
GikoDM.ListNumberVisibleAction.Checked := GikoSys.Setting.ListViewNo; |
| 961 |
|
| 962 |
//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃? |
| 963 |
BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName; |
| 964 |
BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize; |
| 965 |
BrowserTab.Font.Style := []; |
| 966 |
if GikoSys.Setting.BrowserTabFontBold then |
| 967 |
BrowserTab.Font.Style := [fsBold]; |
| 968 |
if GikoSys.Setting.BrowserTabFontItalic then |
| 969 |
BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic]; |
| 970 |
FDragWFirst := false; |
| 971 |
SetContent(BrowserNullTab); //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申 |
| 972 |
|
| 973 |
//鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 974 |
ProgressBar.Parent := StatusBar; |
| 975 |
ProgressBar.Top := 2; |
| 976 |
ProgressBar.Left := 0; |
| 977 |
ProgressBar.Width := StatusBar.Panels[0].Width; |
| 978 |
ProgressBar.Height := StatusBar.Height - 2; |
| 979 |
ProgressBar.Position := 0; |
| 980 |
|
| 981 |
// 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申) |
| 982 |
InitializeBoardPlugIns; |
| 983 |
|
| 984 |
// 鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申(ReadFavorite 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申) |
| 985 |
GikoSys.ListBoardFile; |
| 986 |
|
| 987 |
// 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 988 |
SplashWindow.ProgressBar.Max := Length(BBSs) * 20; |
| 989 |
|
| 990 |
// 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 991 |
for i := Length(BBSs) - 1 downto 0 do begin |
| 992 |
if not BBSs[i].IsBoardFileRead then |
| 993 |
GikoSys.ReadBoardFile(BBSs[i]); |
| 994 |
|
| 995 |
if SplashWindow <> nil then begin |
| 996 |
SplashWindow.ProgressBar.StepBy(20); |
| 997 |
SplashWindow.Update; |
| 998 |
end; |
| 999 |
end; |
| 1000 |
//鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1001 |
RoundList := TRoundList.Create; |
| 1002 |
RoundList.LoadRoundBoardFile; |
| 1003 |
RoundList.LoadRoundThreadFile; |
| 1004 |
|
| 1005 |
//TreeView鐃緒申鐃緒申鐃緒申鐃?鐃緒申ToolTip鐃緒申鐃緒申鐃?鐃緒申 |
| 1006 |
Style := GetWindowLong(TreeView.Handle, GWL_STYLE); |
| 1007 |
Style := Style or TVS_NOTOOLTIPS; |
| 1008 |
SetWindowLong(TreeView.Handle, GWL_STYLE, Style); |
| 1009 |
|
| 1010 |
// 鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1011 |
TreeView.Align := alClient; |
| 1012 |
FavoriteTreeView.Align := alClient; |
| 1013 |
FavoriteTreeView.Visible := False; |
| 1014 |
|
| 1015 |
// 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申 |
| 1016 |
SetBBSMenu; |
| 1017 |
|
| 1018 |
//鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申 |
| 1019 |
wp.length := sizeof(wp); |
| 1020 |
wp.rcNormalPosition.Top := GikoSys.Setting.WindowTop; |
| 1021 |
wp.rcNormalPosition.Left := GikoSys.Setting.WindowLeft; |
| 1022 |
wp.rcNormalPosition.Bottom := GikoSys.Setting.WindowTop + GikoSys.Setting.WindowHeight; |
| 1023 |
wp.rcNormalPosition.Right := GikoSys.Setting.WindowLeft + GikoSys.Setting.WindowWidth; |
| 1024 |
wp.showCmd := SW_HIDE; |
| 1025 |
SetWindowPlacement(Handle, @wp); |
| 1026 |
//Self.Update; |
| 1027 |
|
| 1028 |
if GikoSys.Setting.WindowMax then |
| 1029 |
WindowState := wsMaximized; |
| 1030 |
|
| 1031 |
//鐃?鐃?鐃?鐃?鐃緒申 |
| 1032 |
try |
| 1033 |
FileName := GikoSys.GetAppDir + 'gikoNavi.avi'; |
| 1034 |
if FileExists(FileName) then |
| 1035 |
Animate.FileName := FileName; |
| 1036 |
except |
| 1037 |
end; |
| 1038 |
|
| 1039 |
//鐃?鐃?鐃?鐃? |
| 1040 |
FNameCookie := ''; |
| 1041 |
FMailCookie := ''; |
| 1042 |
|
| 1043 |
//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1044 |
FBrowserSizeHeight := GikoSys.Setting.ListHeight; |
| 1045 |
FBrowserSizeWidth := GikoSys.Setting.ListWidth; |
| 1046 |
|
| 1047 |
|
| 1048 |
// 鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?(LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申) |
| 1049 |
FHistoryList := TList.Create; |
| 1050 |
|
| 1051 |
// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1052 |
LoadHistory; |
| 1053 |
|
| 1054 |
//鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1055 |
FavoriteDM.SetFavTreeView(FavoriteTreeView); |
| 1056 |
FavoriteDM.ReadFavorite; |
| 1057 |
|
| 1058 |
GikoDM.ArrangeAction.Checked := not (GikoSys.Setting.ListOrientation = gloVertical); |
| 1059 |
GikoDM.ArrangeAction.Execute; |
| 1060 |
|
| 1061 |
if GikoSys.Setting.ListOrientation = gloHorizontal then begin |
| 1062 |
case GikoSys.Setting.ListWidthState of |
| 1063 |
glsMax: begin |
| 1064 |
ViewPanel.Width := 1; |
| 1065 |
GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL; |
| 1066 |
GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN; |
| 1067 |
end; |
| 1068 |
glsMin: begin |
| 1069 |
ViewPanel.Width := GikoSys.Setting.ListWidth; |
| 1070 |
GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX; |
| 1071 |
GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL; |
| 1072 |
end; |
| 1073 |
else begin |
| 1074 |
ViewPanel.Width := GikoSys.Setting.ListWidth; |
| 1075 |
GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX; |
| 1076 |
GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN; |
| 1077 |
end; |
| 1078 |
end; |
| 1079 |
end else begin |
| 1080 |
case GikoSys.Setting.ListHeightState of |
| 1081 |
glsMax: begin |
| 1082 |
ViewPanel.Height := 1; |
| 1083 |
GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL; |
| 1084 |
GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN; |
| 1085 |
end; |
| 1086 |
glsMin: begin |
| 1087 |
ViewPanel.Height := GikoSys.Setting.ListHeight; |
| 1088 |
GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX; |
| 1089 |
GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL; |
| 1090 |
end; |
| 1091 |
else begin |
| 1092 |
ViewPanel.Height := GikoSys.Setting.ListHeight; |
| 1093 |
GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX; |
| 1094 |
GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN; |
| 1095 |
end; |
| 1096 |
end; |
| 1097 |
end; |
| 1098 |
|
| 1099 |
//鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? |
| 1100 |
CreateControlThread(); |
| 1101 |
|
| 1102 |
// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1103 |
SelectComboBox.Items.Assign( GikoSys.Setting.SelectTextList ); |
| 1104 |
|
| 1105 |
//鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申 |
| 1106 |
SetBrowserTabState; |
| 1107 |
|
| 1108 |
BrowserBoardNameLabel.Caption := ''; |
| 1109 |
BrowserNameLabel.Caption := ''; |
| 1110 |
FWorkCount := 0; |
| 1111 |
|
| 1112 |
FTabHintIndex := -1; |
| 1113 |
|
| 1114 |
//鐃?鐃?鐃緒申鐃?鐃?Wrapable |
| 1115 |
ListToolBar.Wrapable := GikoSys.Setting.ListToolBarWrapable; |
| 1116 |
BrowserToolBar.Wrapable := GikoSys.Setting.BrowserToolBarWrapable; |
| 1117 |
|
| 1118 |
MakeDefaultINIFile(); |
| 1119 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1120 |
ReadToolBarSetting(GikoDM.GikoFormActionList, StdToolBar); |
| 1121 |
ReadToolBarSetting(GikoDM.GikoFormActionList, ListToolBar); |
| 1122 |
ReadToolBarSetting(GikoDM.GikoFormActionList, BrowserToolBar); |
| 1123 |
SetToolBarPopup; |
| 1124 |
|
| 1125 |
//ListToolBar鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申ComboBox鐃緒申鐃?鐃? |
| 1126 |
SetSelectComboBox(); |
| 1127 |
|
| 1128 |
//鐃?鐃?鐃緒申鐃?鐃?鐃? |
| 1129 |
AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop; |
| 1130 |
|
| 1131 |
//鐃緒申鐃緒申鐃?鐃?鐃? |
| 1132 |
SetLinkBar; |
| 1133 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1134 |
|
| 1135 |
//鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申 |
| 1136 |
if not FileExists(GikoSys.GetBoardFileName) then begin |
| 1137 |
msg := '鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申' + #13#10#13#10 |
| 1138 |
+ '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申' + #13#10 |
| 1139 |
+ '鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?'; |
| 1140 |
MsgBox(SplashWindow.Handle, msg, '鐃?鐃?鐃?鐃?', MB_OK or MB_ICONINFORMATION); |
| 1141 |
GikoDM.NewBoardAction.Execute; |
| 1142 |
end; |
| 1143 |
|
| 1144 |
//鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1145 |
GikoSys.LoadKeySetting(GikoDM.GikoFormActionList, GikoSys.GetMainKeyFileName); |
| 1146 |
|
| 1147 |
//鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1148 |
// FLastRoundTime := 0; |
| 1149 |
|
| 1150 |
//ResHint |
| 1151 |
FHint := TResPopup.Create(Self); |
| 1152 |
|
| 1153 |
ListView.OnData := TListViewUtils.ListViewData; |
| 1154 |
|
| 1155 |
// 鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 1156 |
CabinetVisible( False ); |
| 1157 |
if GikoSys.Setting.CabinetVisible then begin |
| 1158 |
i := CabinetSelectPopupMenu.Items.Count - 1; |
| 1159 |
if GikoSys.Setting.CabinetIndex = i - 1 then |
| 1160 |
GikoDM.CabinetHistoryAction.Execute |
| 1161 |
else if GikoSys.Setting.CabinetIndex = i then |
| 1162 |
GikoDM.CabinetFavoriteAction.Execute |
| 1163 |
else begin |
| 1164 |
if GikoSys.Setting.CabinetIndex < Length( BBSs ) then |
| 1165 |
ShowBBSTree( BBSs[ GikoSys.Setting.CabinetIndex ] ); |
| 1166 |
// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 2 |
| 1167 |
FIsIgnoreResize := rtResizing; |
| 1168 |
GikoDM.CabinetBBSAction.Execute; |
| 1169 |
end; |
| 1170 |
end else begin |
| 1171 |
ShowBBSTreeOld( BBSs[ 0 ] ); |
| 1172 |
PostMessage( Handle, USER_TREECLICK, 0, 0 ); |
| 1173 |
end; |
| 1174 |
|
| 1175 |
//鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃? |
| 1176 |
for i := 1 to ParamCount do begin |
| 1177 |
MoveToURL(ParamStr(i)); |
| 1178 |
end; |
| 1179 |
|
| 1180 |
s := GikoSys.FAbon.NGwordname; |
| 1181 |
StatusBar.Panels[2].Text := s; |
| 1182 |
StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100); |
| 1183 |
StatusBarResize(Sender); |
| 1184 |
|
| 1185 |
dummy1.Caption := ItemReservPMenu.Caption; |
| 1186 |
dummy1.Hint := ItemReservPMenu.Hint; |
| 1187 |
|
| 1188 |
//Samba24鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃? |
| 1189 |
GikoSys.SambaFileExists(); |
| 1190 |
|
| 1191 |
{$IFDEF SPAM_FILTER_ENABLED} |
| 1192 |
// 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申 |
| 1193 |
GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName ); |
| 1194 |
{$ENDIF} |
| 1195 |
|
| 1196 |
// 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃? |
| 1197 |
MouseGesture := TMouseGesture.Create; |
| 1198 |
GikoSys.Setting.Gestures.LoadGesture( |
| 1199 |
GikoSys.Setting.GetGestureFileName, GikoDM.GikoFormActionList ); |
| 1200 |
MouseGesture.Margin := GikoSys.Setting.Gestures.Margin; |
| 1201 |
MouseGesture.OnGestureStart := OnGestureStart; |
| 1202 |
MouseGesture.OnGestureMove := OnGestureMove; |
| 1203 |
MouseGesture.OnGestureEnd := OnGestureEnd; |
| 1204 |
if GikoSys.Setting.GestureEnabled then |
| 1205 |
MouseGesture.SetHook( Handle ); |
| 1206 |
|
| 1207 |
//2ch鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申 |
| 1208 |
GikoSys.SetGikoMessage; |
| 1209 |
|
| 1210 |
//鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申 |
| 1211 |
if GikoSys.Setting.AutoLogin then |
| 1212 |
GikoDM.LoginAction.Execute; |
| 1213 |
|
| 1214 |
GikoSys.Setting.BeLogin := GikoSys.Setting.BeAutoLogin; |
| 1215 |
|
| 1216 |
//鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1217 |
FavoriteAddToolButton.Caption := '鐃緒申鐃緒申...'; |
| 1218 |
AntiIndivAbonMenuItem.Caption := '鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申'; |
| 1219 |
|
| 1220 |
end; |
| 1221 |
|
| 1222 |
// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1223 |
procedure TGikoForm.SaveCoolBarSettings; |
| 1224 |
begin |
| 1225 |
|
| 1226 |
if IsIconic( Handle ) or (FIsIgnoreResize <> rtNone) then |
| 1227 |
Exit; |
| 1228 |
SaveMainCoolBarSettings; |
| 1229 |
SaveBoardCoolBarSettings; |
| 1230 |
SaveBrowserCoolBarSettings; |
| 1231 |
|
| 1232 |
end; |
| 1233 |
procedure TGikoForm.SaveMainCoolBarSettings; |
| 1234 |
var |
| 1235 |
i : Integer; |
| 1236 |
CoolSet : TCoolSet; |
| 1237 |
begin |
| 1238 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main) |
| 1239 |
for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin |
| 1240 |
CoolSet.FCoolID := MainCoolBar.Bands[i].ID; |
| 1241 |
CoolSet.FCoolWidth := MainCoolBar.Bands[i].Width; |
| 1242 |
CoolSet.FCoolBreak := MainCoolBar.Bands[i].Break; |
| 1243 |
GikoSys.Setting.MainCoolSet[i] := CoolSet; |
| 1244 |
end; |
| 1245 |
end; |
| 1246 |
procedure TGikoForm.SaveBoardCoolBarSettings; |
| 1247 |
var |
| 1248 |
i : Integer; |
| 1249 |
CoolSet : TCoolSet; |
| 1250 |
begin |
| 1251 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board) |
| 1252 |
for i := 0 to LIST_COOLBAND_COUNT - 1 do begin |
| 1253 |
CoolSet.FCoolID := ListCoolBar.Bands[i].ID; |
| 1254 |
CoolSet.FCoolWidth := ListCoolBar.Bands[i].Width; |
| 1255 |
CoolSet.FCoolBreak := ListCoolBar.Bands[i].Break; |
| 1256 |
GikoSys.Setting.ListCoolSet[i] := CoolSet; |
| 1257 |
end; |
| 1258 |
end; |
| 1259 |
procedure TGikoForm.SaveBrowserCoolBarSettings; |
| 1260 |
var |
| 1261 |
i : Integer; |
| 1262 |
CoolSet : TCoolSet; |
| 1263 |
begin |
| 1264 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser) |
| 1265 |
for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin |
| 1266 |
CoolSet.FCoolID := BrowserCoolBar.Bands[i].ID; |
| 1267 |
CoolSet.FCoolWidth := BrowserCoolBar.Bands[i].Width; |
| 1268 |
CoolSet.FCoolBreak := BrowserCoolBar.Bands[i].Break; |
| 1269 |
GikoSys.Setting.BrowserCoolSet[i] := CoolSet; |
| 1270 |
end; |
| 1271 |
end; |
| 1272 |
// CoolBar 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1273 |
procedure TGikoForm.LoadCoolBarSettings; |
| 1274 |
var |
| 1275 |
i : Integer; |
| 1276 |
CoolSet : TCoolSet; |
| 1277 |
begin |
| 1278 |
|
| 1279 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Main) |
| 1280 |
MainCoolBar.Bands.BeginUpdate; |
| 1281 |
try |
| 1282 |
// for i := 0 to MainCoolBar.Bands.Count - 1 do begin |
| 1283 |
for i := MAIN_COOLBAND_COUNT - 1 downto 0 do begin |
| 1284 |
CoolSet := GikoSys.Setting.MainCoolSet[i]; |
| 1285 |
if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin |
| 1286 |
FIsIgnoreResize := rtNone; |
| 1287 |
SaveCoolBarSettings; |
| 1288 |
Exit; |
| 1289 |
end; |
| 1290 |
MainCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i; |
| 1291 |
MainCoolBar.Bands[i].Break := CoolSet.FCoolBreak; |
| 1292 |
MainCoolBar.Bands[i].Width := CoolSet.FCoolWidth; |
| 1293 |
end; |
| 1294 |
finally |
| 1295 |
MainCoolBar.Bands.EndUpdate; |
| 1296 |
end; |
| 1297 |
|
| 1298 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Board) |
| 1299 |
ListCoolBar.Bands.BeginUpdate; |
| 1300 |
try |
| 1301 |
// for i := 0 to ListCoolBar.Bands.Count - 1 do begin |
| 1302 |
for i := LIST_COOLBAND_COUNT - 1 downto 0 do begin |
| 1303 |
CoolSet := GikoSys.Setting.ListCoolSet[i]; |
| 1304 |
if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin |
| 1305 |
FIsIgnoreResize := rtNone; |
| 1306 |
SaveCoolBarSettings; |
| 1307 |
Exit; |
| 1308 |
end; |
| 1309 |
ListCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i; |
| 1310 |
ListCoolBar.Bands[i].Break := CoolSet.FCoolBreak; |
| 1311 |
ListCoolBar.Bands[i].Width := CoolSet.FCoolWidth; |
| 1312 |
end; |
| 1313 |
finally |
| 1314 |
ListCoolBar.Bands.EndUpdate; |
| 1315 |
end; |
| 1316 |
|
| 1317 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申(Browser) |
| 1318 |
BrowserCoolBar.Bands.BeginUpdate; |
| 1319 |
try |
| 1320 |
// for i := 0 to BrowserCoolBar.Bands.Count - 1 do begin |
| 1321 |
for i := BROWSER_COOLBAND_COUNT - 1 downto 0 do begin |
| 1322 |
CoolSet := GikoSys.Setting.BrowserCoolSet[i]; |
| 1323 |
if (CoolSet.FCoolID = -1) or (CoolSet.FCoolWidth = -1) then begin |
| 1324 |
FIsIgnoreResize := rtNone; |
| 1325 |
SaveCoolBarSettings; |
| 1326 |
Exit; |
| 1327 |
end; |
| 1328 |
BrowserCoolBar.Bands.FindItemID(CoolSet.FCoolID).Index := i; |
| 1329 |
BrowserCoolBar.Bands[i].Break := CoolSet.FCoolBreak; |
| 1330 |
BrowserCoolBar.Bands[i].Width := CoolSet.FCoolWidth; |
| 1331 |
end; |
| 1332 |
finally |
| 1333 |
BrowserCoolBar.Bands.EndUpdate; |
| 1334 |
end; |
| 1335 |
|
| 1336 |
end; |
| 1337 |
// |
| 1338 |
procedure TGikoForm.FormShow(Sender: TObject); |
| 1339 |
begin |
| 1340 |
if FStartUp then begin |
| 1341 |
ShowWindow(Application.Handle, SW_HIDE); |
| 1342 |
|
| 1343 |
//FormCreate鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申FormShow鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1344 |
//鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申 |
| 1345 |
GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible; |
| 1346 |
GikoDM.StdToolBarVisibleActionExecute( nil ); |
| 1347 |
GikoDM.AddressBarVisibleAction.Checked := GikoSys.Setting.AddressBarVisible; |
| 1348 |
GikoDM.AddressBarVisibleActionExecute( nil ); |
| 1349 |
GikoDM.LinkBarVisibleAction.Checked := GikoSys.Setting.LinkBarVisible; |
| 1350 |
GikoDM.LinkBarVisibleActionExecute( nil ); |
| 1351 |
GikoDM.ListToolBarVisibleAction.Checked := GikoSys.Setting.ListToolBarVisible; |
| 1352 |
GikoDM.ListToolBarVisibleActionExecute( nil ); |
| 1353 |
GikoDM.ListNameBarVisibleAction.Checked := GikoSys.Setting.ListNameBarVisible; |
| 1354 |
GikoDM.ListNameBarVisibleActionExecute( nil ); |
| 1355 |
GikoDM.BrowserToolBarVisibleAction.Checked := GikoSys.Setting.BrowserToolBarVisible; |
| 1356 |
GikoDM.BrowserToolBarVisibleActionExecute( nil ); |
| 1357 |
GikoDM.BrowserNameBarVisibleAction.Checked := GikoSys.Setting.BrowserNameBarVisible; |
| 1358 |
GikoDM.BrowserNameBarVisibleActionExecute( nil ); |
| 1359 |
|
| 1360 |
//鐃?鐃緒申鐃?鐃?鐃?鐃? |
| 1361 |
GikoDM.BrowserTabVisibleAction.Checked := GikoSys.Setting.BrowserTabVisible; |
| 1362 |
GikoDM.BrowserTabVisibleActionExecute(nil); |
| 1363 |
|
| 1364 |
if GikoSys.Setting.BrowserTabPosition = gtpTop then begin |
| 1365 |
GikoDM.BrowserTabTopAction.Checked := True; |
| 1366 |
GikoDM.BrowserTabTopActionExecute(nil); |
| 1367 |
end else begin |
| 1368 |
GikoDM.BrowserTabBottomAction.Checked := True; |
| 1369 |
GikoDM.BrowserTabBottomActionExecute(nil); |
| 1370 |
end; |
| 1371 |
|
| 1372 |
if GikoSys.Setting.BrowserTabStyle = gtsTab then begin |
| 1373 |
GikoDM.BrowserTabTabStyleAction.Checked := True; |
| 1374 |
GikoDM.BrowserTabTabStyleActionExecute(nil); |
| 1375 |
end else if GikoSys.Setting.BrowserTabStyle = gtsButton then begin |
| 1376 |
GikoDM.BrowserTabButtonStyleAction.Checked := True; |
| 1377 |
GikoDM.BrowserTabButtonStyleActionExecute(nil); |
| 1378 |
end else begin |
| 1379 |
GikoDM.BrowserTabFlatStyleAction.Checked := True; |
| 1380 |
GikoDM.BrowserTabFlatStyleActionExecute(nil); |
| 1381 |
end; |
| 1382 |
|
| 1383 |
// ListView 鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃? |
| 1384 |
// ListView.FullDrag := True; |
| 1385 |
|
| 1386 |
// CoolBar 鐃緒申鐃緒申 |
| 1387 |
LoadCoolBarSettings; |
| 1388 |
|
| 1389 |
//鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1390 |
// ResetBandInfo( ListCoolBar, ListToolBar ); |
| 1391 |
FIsIgnoreResize := rtNone; |
| 1392 |
//鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1393 |
//鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1394 |
InitActionChecked(); |
| 1395 |
|
| 1396 |
//FormCrete鐃緒申鐃緒申鐃緒申鐃緒申鐃? |
| 1397 |
if GikoSys.Setting.TabAutoLoadSave then begin |
| 1398 |
GikoDM.TabAutoLoadAction.Execute; |
| 1399 |
end; |
| 1400 |
//鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃? |
| 1401 |
if GikoSys.Setting.GengoSupport then begin |
| 1402 |
//鐃?鐃緒申鐃? |
| 1403 |
//Test鐃緒申鐃緒申 |
| 1404 |
end; |
| 1405 |
|
| 1406 |
FStartUp := false; |
| 1407 |
end; |
| 1408 |
end; |
| 1409 |
|
| 1410 |
procedure TGikoForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); |
| 1411 |
begin |
| 1412 |
// if GikoForm.WindowState <> wsMinimized then |
| 1413 |
// SaveCoolBarSettings; |
| 1414 |
if ( GikoSys.Setting.ShowDialogForEnd ) and |
| 1415 |
(MessageDlg('鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', mtConfirmation,[mbOk, mbCancel], 0) = mrCancel ) then begin |
| 1416 |
CanClose := false; |
| 1417 |
Exit; |
| 1418 |
end else begin |
| 1419 |
CanClose := True; |
| 1420 |
if GikoSys.Setting.TabAutoLoadSave then begin |
| 1421 |
GikoDM.TabAutoSaveAction.Execute; |
| 1422 |
end; |
| 1423 |
end; |
| 1424 |
{ //2ch鐃緒申鐃緒申鐃緒申鐃緒申Free |
| 1425 |
if GikoSys.Setting.Gengo <> nil then begin |
| 1426 |
GikoSys.Setting.Gengo.Free; |
| 1427 |
end; |
| 1428 |
} |
| 1429 |
Application.UnhookMainWindow(Hook); |
| 1430 |
Application.Terminate; |
| 1431 |
end; |
| 1432 |
|
| 1433 |
procedure TGikoForm.FormDestroy(Sender: TObject); |
| 1434 |
var |
| 1435 |
i : Integer; |
| 1436 |
// CoolSet: TCoolSet; |
| 1437 |
wp : TWindowPlacement; |
| 1438 |
tmpBool : Boolean; |
| 1439 |
begin |
| 1440 |
// 鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申 |
| 1441 |
try |
| 1442 |
MouseGesture.UnHook; |
| 1443 |
except |
| 1444 |
end; |
| 1445 |
try |
| 1446 |
ActiveListColumnSave; |
| 1447 |
except |
| 1448 |
end; |
| 1449 |
try |
| 1450 |
//鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申 |
| 1451 |
wp.length := sizeof(wp); |
| 1452 |
GetWindowPlacement(Handle, @wp); |
| 1453 |
GikoSys.Setting.WindowTop := wp.rcNormalPosition.Top; |
| 1454 |
GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left; |
| 1455 |
GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top; |
| 1456 |
GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left; |
| 1457 |
GikoSys.Setting.WindowMax := WindowState = wsMaximized; |
| 1458 |
|
| 1459 |
GikoSys.Setting.ListStyle := ListView.ViewStyle; |
| 1460 |
GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked; |
| 1461 |
GikoSys.Setting.CabinetWidth := CabinetPanel.Width; |
| 1462 |
GikoSys.Setting.ListHeight := FBrowserSizeHeight; |
| 1463 |
GikoSys.Setting.ListWidth := FBrowserSizeWidth; |
| 1464 |
if GikoDM.ArrangeAction.Checked then |
| 1465 |
GikoSys.Setting.ListOrientation := gloVertical |
| 1466 |
else |
| 1467 |
GikoSys.Setting.ListOrientation := gloHorizontal; |
| 1468 |
GikoSys.Setting.MessegeBarHeight := MessagePanel.Height; |
| 1469 |
except |
| 1470 |
end; |
| 1471 |
|
| 1472 |
try |
| 1473 |
// 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 1474 |
if not GikoSys.Setting.ResRangeHold then |
| 1475 |
GikoSys.Setting.ResRange := FResRangeMenuSelect; |
| 1476 |
except |
| 1477 |
end; |
| 1478 |
if WindowState <> wsNormal then |
| 1479 |
WindowState := wsNormal; |
| 1480 |
SaveCoolBarSettings; |
| 1481 |
try |
| 1482 |
GikoSys.Setting.WriteWindowSettingFile; |
| 1483 |
GikoSys.Setting.WriteNameMailSettingFile; |
| 1484 |
except |
| 1485 |
end; |
| 1486 |
// 鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申 CoolBar 鐃緒申鐃緒申 |
| 1487 |
// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1488 |
|
| 1489 |
// 鐃緒申FormDestroy鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?2004/04/09鐃? |
| 1490 |
// CoolBar 鐃緒申鐃緒申 |
| 1491 |
//if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then |
| 1492 |
|
| 1493 |
|
| 1494 |
//鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1495 |
try |
| 1496 |
//FavoriteDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1497 |
FavoriteDM.WriteFavorite; |
| 1498 |
FavoriteDM.Clear; |
| 1499 |
except |
| 1500 |
end; |
| 1501 |
LockWindowUpdate(Self.Handle); |
| 1502 |
try |
| 1503 |
//鐃?鐃?鐃?鐃緒申鐃?鐃? |
| 1504 |
tmpBool := GikoSys.Setting.ShowDialogForAllTabClose; |
| 1505 |
GikoSys.Setting.ShowDialogForAllTabClose := false; |
| 1506 |
GikoDM.AllTabCloseAction.Execute; |
| 1507 |
GikoSys.Setting.ShowDialogForAllTabClose := tmpBool; |
| 1508 |
except |
| 1509 |
end; |
| 1510 |
try |
| 1511 |
for i := FBrowsers.Count - 1 downto 0 do begin |
| 1512 |
TWebBrowser(FBrowsers[i]).Free; |
| 1513 |
end; |
| 1514 |
FBrowsers.Clear; |
| 1515 |
FBrowsers.Capacity := 0; |
| 1516 |
finally |
| 1517 |
FBrowsers.Free; |
| 1518 |
end; |
| 1519 |
try |
| 1520 |
if BrowserNullTab <> nil then begin |
| 1521 |
BrowserNullTab.Browser := nil; {*BrowserNullTab鐃緒申Browser鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃? |
| 1522 |
*鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申Free鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃? |
| 1523 |
*} |
| 1524 |
BrowserNullTab.Free; |
| 1525 |
end; |
| 1526 |
except |
| 1527 |
end; |
| 1528 |
|
| 1529 |
try |
| 1530 |
TreeView.Items.BeginUpdate; |
| 1531 |
TreeView.Items.GetFirstNode.Free; |
| 1532 |
TreeView.Items.Clear; |
| 1533 |
TreeView.Items.EndUpdate; |
| 1534 |
except |
| 1535 |
end; |
| 1536 |
|
| 1537 |
//鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1538 |
try |
| 1539 |
//AddressHistoryDM鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃? |
| 1540 |
//AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount); |
| 1541 |
AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount); |
| 1542 |
except |
| 1543 |
end; |
| 1544 |
|
| 1545 |
//鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 1546 |
try |
| 1547 |
SaveHistory; |
| 1548 |
except |
| 1549 |
end; |
| 1550 |
try |
| 1551 |
try |
| 1552 |
ClearHistory; |
| 1553 |
except |
| 1554 |
end; |
| 1555 |
finally |
| 1556 |
FHistoryList.Free; |
| 1557 |
end; |
| 1558 |
|
| 1559 |
//鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申&鐃?鐃緒申 |
| 1560 |
try |
| 1561 |
RoundList.SaveRoundFile; |
| 1562 |
except |
| 1563 |
end; |
| 1564 |
try |
| 1565 |
try |
| 1566 |
RoundList.Clear; |
| 1567 |
except |
| 1568 |
end; |
| 1569 |
finally |
| 1570 |
RoundList.Free; |
| 1571 |
end; |
| 1572 |
|
| 1573 |
try |
| 1574 |
try |
| 1575 |
FControlThread.Terminate; |
| 1576 |
FControlThread.WaitFor; |
| 1577 |
except |
| 1578 |
end; |
| 1579 |
finally |
| 1580 |
FControlThread.Free; |
| 1581 |
end; |
| 1582 |
|
| 1583 |
// TBBS 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 TCategory, TBoard, TThreadItem 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申 |
| 1584 |
// TBoard, TThreadItem 鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1585 |
// BoardPluteIns 鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申 |
| 1586 |
for i := Length(BoardGroups) - 1 downto 0 do begin |
| 1587 |
//BoardGroups[i].Clear; |
| 1588 |
BoardGroups[i].Free; |
| 1589 |
end; |
| 1590 |
|
| 1591 |
try |
| 1592 |
for i := Length( BBSs ) - 1 downto 0 do begin |
| 1593 |
if BBSs[ i ] <> nil then |
| 1594 |
BBSs[ i ].Free; |
| 1595 |
BBSs[ i ] := nil; |
| 1596 |
end; |
| 1597 |
except |
| 1598 |
end; |
| 1599 |
|
| 1600 |
try |
| 1601 |
if FEvent <> nil then |
| 1602 |
FEvent.Free; |
| 1603 |
|
| 1604 |
//Hint鐃?鐃緒申 |
| 1605 |
if FHint <> nil then begin |
| 1606 |
FHint.ReleaseHandle; |
| 1607 |
FHint.Free; |
| 1608 |
FHint := nil; |
| 1609 |
end; |
| 1610 |
//Preview鐃?鐃緒申 |
| 1611 |
if TPreviewBrowser <> nil then begin |
| 1612 |
FPreviewBrowser.Free; |
| 1613 |
FPreviewBrowser := nil; |
| 1614 |
end; |
| 1615 |
except |
| 1616 |
end; |
| 1617 |
LockWindowUpdate(0); |
| 1618 |
end; |
| 1619 |
|
| 1620 |
// 鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃? BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃? |
| 1621 |
procedure TGikoForm.SetBBSMenu; |
| 1622 |
var |
| 1623 |
i : Integer; |
| 1624 |
item : TBBSMenuItem; |
| 1625 |
begin |
| 1626 |
|
| 1627 |
// 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申 |
| 1628 |
for i := CabinetSelectPopupMenu.Items.Count - 1 downto 0 do begin |
| 1629 |
try |
| 1630 |
if CabinetSelectPopupMenu.Items[ i ] is TBBSMenuItem then begin |
| 1631 |
CabinetSelectPopupMenu.Items[ i ].Free; |
| 1632 |
CabinetMenu.Items[ i ].Free; |
| 1633 |
BBSSelectPopupMenu.Items[ i ].Free; |
| 1634 |
end; |
| 1635 |
except |
| 1636 |
end; |
| 1637 |
end; |
| 1638 |
|
| 1639 |
// 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申 |
| 1640 |
for i := Length( BBSs ) - 1 downto 0 do begin |
| 1641 |
try |
| 1642 |
item := TBBSMenuItem.Create( PopupMenu ); |
| 1643 |
item.Caption := BBSs[ i ].Title; |
| 1644 |
item.Data := BBSs[ i ]; |
| 1645 |
item.OnClick := BBSMenuItemOnClick; |
| 1646 |
CabinetSelectPopupMenu.Items.Insert( 0, item ); |
| 1647 |
item := TBBSMenuItem.Create( PopupMenu ); |
| 1648 |
item.Caption := BBSs[ i ].Title; |
| 1649 |
item.Data := BBSs[ i ]; |
| 1650 |
item.OnClick := BBSMenuItemOnClick; |
| 1651 |
CabinetMenu.Insert( 0, item ); |
| 1652 |
item := TBBSMenuItem.Create( PopupMenu ); |
| 1653 |
item.Caption := BBSs[ i ].Title; |
| 1654 |
item.Data := BBSs[ i ]; |
| 1655 |
item.OnClick := BBSMenuItemOnClick; |
| 1656 |
BBSSelectPopupMenu.Items.Insert( 0, Item ); |
| 1657 |
except |
| 1658 |
end; |
| 1659 |
end; |
| 1660 |
|
| 1661 |
end; |
| 1662 |
|
| 1663 |
procedure TGikoForm.ReloadBBS; |
| 1664 |
var |
| 1665 |
i : Integer; |
| 1666 |
tmpBool: Boolean; |
| 1667 |
begin |
| 1668 |
LockWindowUpdate(Self.Handle); |
| 1669 |
|
| 1670 |
//鐃?鐃?鐃?鐃緒申鐃?鐃? |
| 1671 |
tmpBool := GikoSys.Setting.ShowDialogForAllTabClose; |
| 1672 |
GikoSys.Setting.ShowDialogForAllTabClose := false; |
| 1673 |
GikoDM.AllTabCloseAction.Execute; |
| 1674 |
GikoSys.Setting.ShowDialogForAllTabClose := tmpBool; |
| 1675 |
|
| 1676 |
SetContent(BrowserNullTab); |
| 1677 |
//TreeView鐃?鐃緒申鐃?鐃?BBS2ch.Free鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申XP鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃? |
| 1678 |
TreeView.Items.Clear; |
| 1679 |
|
| 1680 |
//鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 1681 |
try |
| 1682 |
RoundList.SaveRoundFile; |
| 1683 |
except |
| 1684 |
end; |
| 1685 |
//鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申 |
| 1686 |
try |
| 1687 |
RoundList.Clear; |
| 1688 |
except |
| 1689 |
end; |
| 1690 |
|
| 1691 |
//鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申 |
| 1692 |
try |
| 1693 |
SaveHistory; |
| 1694 |
ClearHistory; |
| 1695 |
except |
| 1696 |
end; |
| 1697 |
|
| 1698 |
//鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申 |
| 1699 |
try |
| 1700 |
FavoriteDM.WriteFavorite; |
| 1701 |
FavoriteDM.Clear; |
| 1702 |
except |
| 1703 |
end; |
| 1704 |
|
| 1705 |
//鐃緒申鐃?鐃?鐃緒申鐃?PLUGIN鐃緒申鐃?鐃緒申 |
| 1706 |
for i := Length(BoardGroups) - 1 downto 0 do begin |
| 1707 |
try |
| 1708 |
BoardGroups[i].Free; |
| 1709 |
except |
| 1710 |
end; |
| 1711 |
end; |
| 1712 |
//BBS鐃?鐃緒申 |
| 1713 |
try |
| 1714 |
for i := Length( BBSs ) - 1 downto 0 do begin |
| 1715 |
if BBSs[ i ] <> nil then |
| 1716 |
BBSs[ i ].Free; |
| 1717 |
BBSs[ i ] := nil; |
| 1718 |
end; |
| 1719 |
except |
| 1720 |
end; |
| 1721 |
|
| 1722 |
ActiveList := nil; |
| 1723 |
|
| 1724 |
FTreeType := gttNone; |
| 1725 |
|
| 1726 |
//============鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申================================// |
| 1727 |
|
| 1728 |
// 鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?(ReadBoardFile, LoadHistory 鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申) |
| 1729 |
InitializeBoardPlugIns; |
| 1730 |
|
| 1731 |
GikoSys.ListBoardFile; //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申 |
| 1732 |
|
| 1733 |
// 鐃緒申鐃緒申鐃緒申鐃緒申BBS鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1734 |
for i := Length(BBSs) - 1 downto 0 do begin |
| 1735 |
if not BBSs[i].IsBoardFileRead then |
| 1736 |
GikoSys.ReadBoardFile(BBSs[i]); |
| 1737 |
end; |
| 1738 |
|
| 1739 |
// BBS 鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃? |
| 1740 |
SetBBSMenu; |
| 1741 |
|
| 1742 |
ShowBBSTree( BBSs[ 0 ] ); |
| 1743 |
|
| 1744 |
// 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1745 |
LoadHistory; |
| 1746 |
|
| 1747 |
//鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1748 |
FavoriteDM.ReadFavorite; |
| 1749 |
|
| 1750 |
SetLinkBar; |
| 1751 |
|
| 1752 |
//鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1753 |
RoundList.LoadRoundBoardFile; |
| 1754 |
RoundList.LoadRoundThreadFile; |
| 1755 |
|
| 1756 |
LockWindowUpdate(0); |
| 1757 |
// |
| 1758 |
GikoDM.TabsOpenAction.Execute; |
| 1759 |
end; |
| 1760 |
|
| 1761 |
|
| 1762 |
procedure TGikoForm.BrowserStatusTextChange(Sender: TObject; const Text: WideString); |
| 1763 |
var |
| 1764 |
p: TPoint; |
| 1765 |
s: string; |
| 1766 |
tmp2: string; |
| 1767 |
URL: string; |
| 1768 |
ATitle: Boolean; |
| 1769 |
|
| 1770 |
threadItem : TThreadItem; |
| 1771 |
board : TBoard; |
| 1772 |
Protocol, Host, Path, Document, Port, Bookmark: string; |
| 1773 |
|
| 1774 |
wkInt: Integer; |
| 1775 |
wkIntSt: Integer; |
| 1776 |
wkIntTo: Integer; |
| 1777 |
ActiveFileName: string; |
| 1778 |
e: IHTMLElement; |
| 1779 |
Ext: string; |
| 1780 |
PathRec: TPathRec; |
| 1781 |
begin |
| 1782 |
if not( TObject(Sender) is TWebBrowser )then |
| 1783 |
Exit; |
| 1784 |
try |
| 1785 |
try |
| 1786 |
if (TWebBrowser(Sender) <> nil) and (not TWebBrowser(Sender).Busy) and (Assigned(TWebBrowser(Sender).Document)) then begin |
| 1787 |
if LowerCase(OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset) <> 'shift_jis' then begin |
| 1788 |
OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset := 'shift_jis'; |
| 1789 |
end; |
| 1790 |
end; |
| 1791 |
except |
| 1792 |
end; |
| 1793 |
finally |
| 1794 |
end; |
| 1795 |
if PreviewTimer.Enabled then |
| 1796 |
PreviewTimer.Enabled := False; |
| 1797 |
Application.CancelHint; |
| 1798 |
try |
| 1799 |
if GetActiveContent <> nil then |
| 1800 |
ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '') |
| 1801 |
else |
| 1802 |
ActiveFileName := ''; |
| 1803 |
except |
| 1804 |
FActiveContent := nil; |
| 1805 |
Exit; |
| 1806 |
end; |
| 1807 |
|
| 1808 |
StatusBar.Panels[1].Text := Text; |
| 1809 |
|
| 1810 |
if FHint <> nil then begin |
| 1811 |
FHint.ReleaseHandle; |
| 1812 |
FHint.ClearAllRes; |
| 1813 |
end; |
| 1814 |
if FPreviewBrowser <> nil then |
| 1815 |
ShowWindow(FPreviewBrowser.Handle, SW_HIDE); |
| 1816 |
|
| 1817 |
if not GikoSys.Setting.UnActivePopup then |
| 1818 |
if not GikoForm.Active then |
| 1819 |
Exit; |
| 1820 |
|
| 1821 |
//file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10 |
| 1822 |
//file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15 |
| 1823 |
|
| 1824 |
s := ''; |
| 1825 |
Ext := AnsiLowerCase(ExtractFileExt(Text)); |
| 1826 |
if (Pos('http://', Text) = 1) and (GikoSys.Setting.PreviewVisible) and |
| 1827 |
((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin |
| 1828 |
if FPreviewBrowser = nil then begin |
| 1829 |
FPreviewBrowser := TPreviewBrowser.Create(Self); |
| 1830 |
ShowWindow(FPreviewBrowser.Handle, SW_HIDE); |
| 1831 |
TOleControl(FPreviewBrowser).Parent := nil; |
| 1832 |
end; |
| 1833 |
FPreviewBrowser.Navigate(BLANK_HTML);//鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃? |
| 1834 |
FPreviewURL := Text; |
| 1835 |
PreviewTimer.Interval := GikoSys.Setting.PreviewWait; |
| 1836 |
PreviewTimer.Enabled := True; |
| 1837 |
end else if (Pos('about:blank', Text) = 1) or (Pos('http://', Text) = 1) or (Pos('mailto:', Text) = 1) then begin |
| 1838 |
if Pos('mailto:', Text) = 1 then begin |
| 1839 |
s := StringReplace(Text, 'mailto:', '', [rfIgnoreCase]); |
| 1840 |
//鐃?鐃?鐃?鐃?鐃?鐃緒申 鐃?鐃?鐃?3鐃緒申466鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1841 |
GetCursorPos(p); |
| 1842 |
p.x := p.x - TWebBrowser(Sender).ClientOrigin.x; |
| 1843 |
p.y := p.y - TWebBrowser(Sender).ClientOrigin.y; |
| 1844 |
e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y); |
| 1845 |
if (Assigned(e)) then begin |
| 1846 |
tmp2 := ZenToHan(e.Get_outerText); |
| 1847 |
if (GikoSys.IsNumeric(tmp2)) then begin |
| 1848 |
//鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃? |
| 1849 |
wkIntSt := StrToInt(tmp2); |
| 1850 |
wkIntTo := StrToInt(tmp2); |
| 1851 |
//s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False); |
| 1852 |
FHint.PopupType := gptThread; |
| 1853 |
HTMLCreater.SetResPopupText(FHint, GetActiveContent, wkIntSt, wkIntTo, False, False); |
| 1854 |
end else begin |
| 1855 |
FHint.PopupType := gptRaw; |
| 1856 |
FHint.Caption := s; |
| 1857 |
end; |
| 1858 |
end; |
| 1859 |
end else begin |
| 1860 |
threadItem := GetActiveContent; |
| 1861 |
URL := THTMLCreate.GetRespopupURL(Text, threadItem.URL); |
| 1862 |
PathRec := Gikosys.Parse2chURL2(URL); |
| 1863 |
if (PathRec.FNoParam) then begin |
| 1864 |
PathRec.FSt := 1; |
| 1865 |
PathRec.FTo := 1; |
| 1866 |
end else begin |
| 1867 |
Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo); |
| 1868 |
end; |
| 1869 |
GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark ); |
| 1870 |
|
| 1871 |
if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin |
| 1872 |
|
| 1873 |
URL := GikoSys.GetBrowsableThreadURL( URL ); |
| 1874 |
wkIntSt := PathRec.FSt; |
| 1875 |
wkIntTo := PathRec.FTo; |
| 1876 |
|
| 1877 |
if (wkIntSt = 0) and (wkIntTo = 0) then begin |
| 1878 |
wkIntSt := 1; |
| 1879 |
wkIntTo := 1; |
| 1880 |
end else if (wkIntSt = 0) and (wkIntTo > 0) then begin |
| 1881 |
wkIntSt := wkIntTo; |
| 1882 |
end else if (wkIntSt > 0) and (wkIntTo = 0) then begin |
| 1883 |
wkIntTo := wkIntSt; |
| 1884 |
end else if wkIntSt > wkIntTo then begin |
| 1885 |
wkInt := wkIntTo; |
| 1886 |
wkIntTo := wkIntSt; |
| 1887 |
wkIntSt := wkInt; |
| 1888 |
end; |
| 1889 |
if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then |
| 1890 |
ATitle := false |
| 1891 |
else |
| 1892 |
ATitle := true; |
| 1893 |
|
| 1894 |
threadItem := BBSsFindThreadFromURL( URL ); |
| 1895 |
|
| 1896 |
if (threadItem = nil) and GikoSys.Is2chHost( Host ) then begin |
| 1897 |
board := BBSs[ 0 ].FindBBSID( PathRec.FBBS ); |
| 1898 |
if board <> nil then begin |
| 1899 |
if not board.IsThreadDatRead then |
| 1900 |
GikoSys.ReadSubjectFile( board ); |
| 1901 |
threadItem := board.FindThreadFromFileName( PathRec.FKey + '.dat' ); |
| 1902 |
end; |
| 1903 |
end; |
| 1904 |
|
| 1905 |
if threadItem <> nil then begin |
| 1906 |
//HintData := GetThreadText(PathRec.FBBS, PathRec.FKey, wkIntSt, wkIntTo, ATitle, PathRec.FFirst); |
| 1907 |
//URL鐃緒申鐃緒申鐃緒申鐃緒申/鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃? |
| 1908 |
if ( IntToStr(wkIntSt) = ChangeFileExt(threadItem.FileName, '') ) then begin |
| 1909 |
wkIntSt := 1; |
| 1910 |
wkIntTo := 1; |
| 1911 |
end; |
| 1912 |
FHint.PopupType := gptThread; |
| 1913 |
HTMLCreater.SetResPopupText(FHint, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst ); |
| 1914 |
end; |
| 1915 |
end; |
| 1916 |
end; |
| 1917 |
|
| 1918 |
if FHint.PopupType = gptRaw then begin |
| 1919 |
if FHint.Caption <> '' then |
| 1920 |
ShowTextPopup; |
| 1921 |
end else begin |
| 1922 |
if (FHint.ResCount <> 0) or (FHint.Title <> '') then |
| 1923 |
ShowTextPopup; |
| 1924 |
end; |
| 1925 |
end; |
| 1926 |
end; |
| 1927 |
|
| 1928 |
procedure TGikoForm.SetEnabledCloseButton(Enabled: Boolean); |
| 1929 |
var |
| 1930 |
SysMenu: HMenu; |
| 1931 |
begin |
| 1932 |
FEnabledCloseButton := Enabled; |
| 1933 |
SysMenu := GetSystemMenu(Handle, False); |
| 1934 |
|
| 1935 |
if Enabled then begin |
| 1936 |
EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED); |
| 1937 |
end else begin |
| 1938 |
EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_GRAYED); |
| 1939 |
end; |
| 1940 |
|
| 1941 |
DrawMenuBar(Handle); |
| 1942 |
end; |
| 1943 |
|
| 1944 |
procedure TGikoForm.TreeViewChanging(Sender: TObject; Node: TTreeNode; |
| 1945 |
var AllowChange: Boolean); |
| 1946 |
begin |
| 1947 |
//鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 1948 |
// if FTreeType = gtt2ch then |
| 1949 |
// FSortIndex := -1; |
| 1950 |
end; |
| 1951 |
|
| 1952 |
procedure TGikoForm.ListViewKeyDown(Sender: TObject; var Key: Word; |
| 1953 |
Shift: TShiftState); |
| 1954 |
var |
| 1955 |
pos : TPoint; |
| 1956 |
begin |
| 1957 |
if GetActiveList is TBoard then begin |
| 1958 |
case Key of |
| 1959 |
VK_BACK:; // UpFolderButtonClick(Sender); |
| 1960 |
VK_SPACE: ListDoubleClick(Shift); |
| 1961 |
VK_RETURN: ListClick; |
| 1962 |
VK_APPS: |
| 1963 |
begin |
| 1964 |
if ListView.Selected <> nil then begin |
| 1965 |
pos.X := ListView.Column[ 0 ].Width; |
| 1966 |
pos.Y := ListView.Selected.Top; |
| 1967 |
end else begin |
| 1968 |
pos.X := ListView.Left; |
| 1969 |
pos.Y := ListView.Top; |
| 1970 |
end; |
| 1971 |
Windows.ClientToScreen( ListView.Handle, pos ); |
| 1972 |
ListPopupMenu.Popup( pos.X, pos.Y ); |
| 1973 |
end; |
| 1974 |
end; |
| 1975 |
end else begin // TBBS, TCategory |
| 1976 |
case Key of |
| 1977 |
VK_BACK:; // UpFolderButtonClick(Sender); |
| 1978 |
VK_SPACE: ListClick; |
| 1979 |
VK_RETURN: ListDoubleClick(Shift); |
| 1980 |
VK_APPS: |
| 1981 |
begin |
| 1982 |
if ListView.Selected <> nil then begin |
| 1983 |
pos.X := ListView.Column[ 0 ].Width; |
| 1984 |
pos.Y := ListView.Selected.Top; |
| 1985 |
end else begin |
| 1986 |
pos.X := ListView.Left; |
| 1987 |
pos.Y := ListView.Top; |
| 1988 |
end; |
| 1989 |
Windows.ClientToScreen( ListView.Handle, pos ); |
| 1990 |
ListPopupMenu.Popup( pos.X, pos.Y ); |
| 1991 |
end; |
| 1992 |
end; |
| 1993 |
end; |
| 1994 |
end; |
| 1995 |
|
| 1996 |
function TGikoForm.GetHttpState: Boolean; |
| 1997 |
begin |
| 1998 |
Result := FHttpState; |
| 1999 |
end; |
| 2000 |
|
| 2001 |
procedure TGikoForm.ListViewColumnClick(Sender: TObject; |
| 2002 |
Column: TListColumn); |
| 2003 |
var |
| 2004 |
id, idx : Integer; |
| 2005 |
orderList : TList; |
| 2006 |
begin |
| 2007 |
idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag; |
| 2008 |
|
| 2009 |
if TObject( FActiveList ) is TBBS then |
| 2010 |
orderList := GikoSys.Setting.BBSColumnOrder |
| 2011 |
else if TObject( FActiveList ) is TCategory then |
| 2012 |
orderList := GikoSys.Setting.CategoryColumnOrder |
| 2013 |
else if TObject( FActiveList ) is TBoard then |
| 2014 |
orderList := GikoSys.Setting.BoardColumnOrder |
| 2015 |
else |
| 2016 |
Exit; |
| 2017 |
|
| 2018 |
id := Integer( orderList[ idx ] ); |
| 2019 |
|
| 2020 |
if FSortIndex = id then |
| 2021 |
FSortOrder := not FSortOrder |
| 2022 |
else begin |
| 2023 |
FSortOrder := id = 0; |
| 2024 |
end; |
| 2025 |
|
| 2026 |
TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, FSortOrder, FSortIndex ); |
| 2027 |
end; |
| 2028 |
|
| 2029 |
procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar; |
| 2030 |
Button: TToolButton; State: TCustomDrawState; var DefaultDraw: Boolean); |
| 2031 |
var |
| 2032 |
ARect: TRect; |
| 2033 |
begin |
| 2034 |
DefaultDraw := True; |
| 2035 |
Exit; |
| 2036 |
DefaultDraw := False; |
| 2037 |
if (cdsSelected in State) or (cdsHot in State) then begin |
| 2038 |
Sender.Canvas.Brush.Color := clHighlight; |
| 2039 |
Sender.Canvas.Font.Color := clHighlightText; |
| 2040 |
end else begin |
| 2041 |
Sender.Canvas.Brush.Color := clBtnFace; |
| 2042 |
Sender.Canvas.Font.Color := clBtnText; |
| 2043 |
end; |
| 2044 |
ARect := Rect(Button.Left, Button.Top, Button.Left + Button.Width, Button.Top + Button.Height); |
| 2045 |
Sender.Canvas.FillRect(ARect); |
| 2046 |
DrawText(Sender.Canvas.Handle, PChar(Button.Caption), -1, ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER); |
| 2047 |
end; |
| 2048 |
|
| 2049 |
function TGikoForm.GetTreeNode(Data: TObject): TTreeNode; |
| 2050 |
var |
| 2051 |
Nodes: TTreeNodes; |
| 2052 |
i: integer; |
| 2053 |
begin |
| 2054 |
Nodes := TreeView.Items; |
| 2055 |
|
| 2056 |
for i := 0 to Nodes.Count - 1 do begin |
| 2057 |
if Nodes.Item[i].Data = Data then begin |
| 2058 |
Result := Nodes.Item[i]; |
| 2059 |
Exit; |
| 2060 |
end; |
| 2061 |
end; |
| 2062 |
Result := nil; |
| 2063 |
end; |
| 2064 |
|
| 2065 |
procedure TGikoForm.BrowserBeforeNavigate2(Sender: TObject; |
| 2066 |
const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, |
| 2067 |
Headers: OleVariant; var Cancel: WordBool); |
| 2068 |
var |
| 2069 |
sNo: string; |
| 2070 |
p: TPoint; |
| 2071 |
const |
| 2072 |
kMenuName: string = 'menu:'; |
| 2073 |
begin |
| 2074 |
|
| 2075 |
if Pos(kMenuName, URL) <> 0 then begin |
| 2076 |
sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) ); |
| 2077 |
|
| 2078 |
if not GikoSys.IsNumeric(sNo) then Exit; |
| 2079 |
|
| 2080 |
Cancel := True; |
| 2081 |
GetCursorpos(p); |
| 2082 |
KokoPopupMenu.Tag := StrToInt(sNo); |
| 2083 |
KokoPopupMenu.Popup(p.x, p.y); |
| 2084 |
end else if Pos('mailto', LowerCase(URL)) <> 0 then begin |
| 2085 |
Cancel := not GikoSys.Setting.OpenMailer; |
| 2086 |
end; |
| 2087 |
|
| 2088 |
end; |
| 2089 |
|
| 2090 |
procedure TGikoForm.TreeViewCustomDraw(Sender: TCustomTreeView; |
| 2091 |
const ARect: TRect; var DefaultDraw: Boolean); |
| 2092 |
var |
| 2093 |
NodeRect: TRect; |
| 2094 |
i, j: Integer; |
| 2095 |
IsBoardNode: Boolean; |
| 2096 |
Cnt: Integer; |
| 2097 |
CntText: string; |
| 2098 |
TextWidth: Integer; |
| 2099 |
TextRect: TRect; |
| 2100 |
Board: TBoard; |
| 2101 |
Category: TCategory; |
| 2102 |
Bitmap: TBitmap; |
| 2103 |
NodeWidth: Integer; |
| 2104 |
begin |
| 2105 |
DefaultDraw := True; |
| 2106 |
|
| 2107 |
if FTreeType = gttHistory then Exit; |
| 2108 |
|
| 2109 |
TreeView.Canvas.Font.Color := clBlue; |
| 2110 |
IsBoardNode := False; |
| 2111 |
for i := 0 to TreeView.Items.Count - 1 do begin |
| 2112 |
Cnt := 0; |
| 2113 |
if not TreeView.Items[i].IsVisible then |
| 2114 |
continue; |
| 2115 |
|
| 2116 |
if TObject(TreeView.Items[i].Data) is TCategory then begin |
| 2117 |
if TreeView.Items[i].Expanded then |
| 2118 |
continue; |
| 2119 |
|
| 2120 |
IsBoardNode := False; |
| 2121 |
Category := TCategory(TreeView.Items[i].Data); |
| 2122 |
for j := 0 to Category.Count - 1 do begin |
| 2123 |
Board := Category.Items[j]; |
| 2124 |
if Board <> nil then begin |
| 2125 |
if Board.UnRead > 0 then begin |
| 2126 |
Cnt := 1; |
| 2127 |
Break; |
| 2128 |
end; |
| 2129 |
end; |
| 2130 |
end; |
| 2131 |
if Cnt <> 1 then |
| 2132 |
continue; |
| 2133 |
end else if TObject(TreeView.Items[i].Data) is TBoard then begin |
| 2134 |
IsBoardNode := True; |
| 2135 |
Board := TBoard(TreeView.Items[i].Data); |
| 2136 |
|
| 2137 |
Cnt := Board.UnRead; |
| 2138 |
if Cnt <= 0 then |
| 2139 |
continue; |
| 2140 |
end else |
| 2141 |
continue; |
| 2142 |
|
| 2143 |
Bitmap := TBitmap.Create; |
| 2144 |
try |
| 2145 |
Bitmap.Canvas.Font.Assign(TreeView.Canvas.Font); |
| 2146 |
Bitmap.Canvas.Font.Style := [fsBold]; |
| 2147 |
NodeWidth := Bitmap.Canvas.TextWidth(TreeView.Items[i].Text); |
| 2148 |
finally |
| 2149 |
Bitmap.Free; |
| 2150 |
end; |
| 2151 |
|
| 2152 |
NodeRect := TreeView.Items[i].DisplayRect(True); |
| 2153 |
|
| 2154 |
if IsBoardNode then |
| 2155 |
CntText := '(' + IntToStr(Cnt) + ')' |
| 2156 |
else if Cnt = 1 then |
| 2157 |
CntText := '(+)'; |
| 2158 |
|
| 2159 |
|
| 2160 |
TextWidth := TreeView.Canvas.TextWidth(CntText); |
| 2161 |
|
| 2162 |
TextRect := Rect(NodeRect.Left + NodeWidth + 8, |
| 2163 |
NodeRect.Top, |
| 2164 |
NodeRect.Left + NodeWidth + TextWidth + 8, |
| 2165 |
NodeRect.Bottom); |
| 2166 |
DrawText(TreeView.Canvas.Handle, |
| 2167 |
PChar(CntText), |
| 2168 |
-1, |
| 2169 |
TextRect, |
| 2170 |
DT_SINGLELINE or DT_VCENTER); |
| 2171 |
end; |
| 2172 |
TreeViewCustomDrawItem(nil, nil, [], DefaultDraw); |
| 2173 |
end; |
| 2174 |
|
| 2175 |
procedure TGikoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView; |
| 2176 |
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); |
| 2177 |
var |
| 2178 |
Board: TBoard; |
| 2179 |
Category: TCategory; |
| 2180 |
i: Integer; |
| 2181 |
begin |
| 2182 |
DefaultDraw := True; |
| 2183 |
|
| 2184 |
if FTreeType = gttHistory then Exit; |
| 2185 |
|
| 2186 |
TreeView.Canvas.Font.Style := []; |
| 2187 |
if Node <> nil then begin |
| 2188 |
if TObject(Node.Data) is TCategory then begin |
| 2189 |
Category := TCategory(Node.Data); |
| 2190 |
for i := 0 to Category.Count - 1 do begin |
| 2191 |
Board := Category.Items[i]; |
| 2192 |
if Board <> nil then begin |
| 2193 |
if Board.UnRead > 0 then begin |
| 2194 |
TreeView.Canvas.Font.Style := [fsBold]; |
| 2195 |
Break; |
| 2196 |
end; |
| 2197 |
end; |
| 2198 |
end; |
| 2199 |
end else if TObject(Node.Data) is TBoard then begin |
| 2200 |
Board := TBoard(Node.Data); |
| 2201 |
if Board.UnRead > 0 then |
| 2202 |
TreeView.Canvas.Font.Style := [fsBold]; |
| 2203 |
end; |
| 2204 |
end; |
| 2205 |
end; |
| 2206 |
|
| 2207 |
procedure TGikoForm.TreeViewExpanded(Sender: TObject; Node: TTreeNode); |
| 2208 |
begin |
| 2209 |
TreeView.Invalidate; |
| 2210 |
|
| 2211 |
if TObject(Node.Data) is TBBS then begin |
| 2212 |
TBBS(Node.Data).NodeExpand := True; |
| 2213 |
end else if TObject(Node.Data) is TCategory then begin |
| 2214 |
TCategory(Node.Data).NodeExpand := True; |
| 2215 |
end else if TObject(Node.Data) is TBoard then begin |
| 2216 |
TBoard(Node.Data).NodeExpand := True; |
| 2217 |
end; |
| 2218 |
end; |
| 2219 |
|
| 2220 |
procedure TGikoForm.ListViewAllSelect; |
| 2221 |
begin |
| 2222 |
ListView.SetFocus; |
| 2223 |
ListView.SelectAll; |
| 2224 |
end; |
| 2225 |
// ************************************************************************* |
| 2226 |
//! 鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃? |
| 2227 |
// ************************************************************************* |
| 2228 |
procedure TGikoForm.TreeViewDblClick(Sender: TObject); |
| 2229 |
var |
| 2230 |
pos : TPoint; |
| 2231 |
rect: TRect; |
| 2232 |
begin |
| 2233 |
pos := FMouseDownPos; |
| 2234 |
if (FClickNode <> nil) and (FClickNode = TreeView.GetNodeAt(pos.X, pos.Y)) then begin |
| 2235 |
//鐃?鐃?鐃?鐃緒申node鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 2236 |
rect := FClickNode.DisplayRect(true); |
| 2237 |
if ((rect.Left <= pos.X) and (rect.Right >= pos.X)) and |
| 2238 |
((rect.Bottom >= pos.Y) and (rect.Top <= pos.Y)) then begin |
| 2239 |
TreeDoubleClick( FClickNode ); |
| 2240 |
FClickNode := nil; |
| 2241 |
end; |
| 2242 |
end; |
| 2243 |
end; |
| 2244 |
|
| 2245 |
procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon); |
| 2246 |
begin |
| 2247 |
AddMessageList(Msg, nil, Icon); |
| 2248 |
end; |
| 2249 |
|
| 2250 |
procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem); |
| 2251 |
var |
| 2252 |
ATitle: string; |
| 2253 |
s: string; |
| 2254 |
boardPlugIn : TBoardPlugIn; |
| 2255 |
i: Integer; |
| 2256 |
browserRec : TBrowserRecord; |
| 2257 |
Res : TResRec; |
| 2258 |
begin |
| 2259 |
try |
| 2260 |
if Item.DownType = gdtBoard then |
| 2261 |
ATitle := Item.Board.Title |
| 2262 |
else |
| 2263 |
ATitle := Item.ThreadItem.Title; |
| 2264 |
if ATitle = '' then |
| 2265 |
ATitle := GikoSys.GetGikoMessage(gmUnKnown); |
| 2266 |
|
| 2267 |
if Item.State in [gdsComplete, gdsDiffComplete] then begin |
| 2268 |
//鐃緒申鐃緒申鐃?鐃緒申 |
| 2269 |
if Item.DownType = gdtBoard then begin |
| 2270 |
//鐃緒申 |
| 2271 |
Item.SaveListFile; |
| 2272 |
AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureItiran), nil, gmiOK); |
| 2273 |
if GetActiveList = Item.Board then begin |
| 2274 |
FActiveList := nil; |
| 2275 |
SetActiveList(Item.Board); |
| 2276 |
end; |
| 2277 |
Item.Board.Modified := True; |
| 2278 |
Item.Board.IsThreadDatRead := True; |
| 2279 |
PlaySound('New'); |
| 2280 |
end else if Item.DownType = gdtThread then begin |
| 2281 |
//鐃?鐃緒申 |
| 2282 |
Item.SaveItemFile; |
| 2283 |
Item.ThreadItem.NewArrival := True; |
| 2284 |
//if (Item.ThreadItem.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin |
| 2285 |
if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin |
| 2286 |
//boardPlugIn := Item.ThreadItem.BoardPlugIn; |
| 2287 |
boardPlugIn := Item.ThreadItem.ParentBoard.BoardPlugIn; |
| 2288 |
THTMLCreate.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 ), @Res); |
| 2289 |
Item.ThreadItem.Title := Res.FTitle; |
| 2290 |
ATitle := Item.ThreadItem.Title; |
| 2291 |
end else if ATitle = '鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?' then begin |
| 2292 |
THTMLCreate.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1), @Res); |
| 2293 |
ATitle := Res.FTitle; |
| 2294 |
end; |
| 2295 |
for i := BrowserTab.Tabs.Count - 1 downto 0 do begin |
| 2296 |
if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin |
| 2297 |
TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true; |
| 2298 |
break; |
| 2299 |
end; |
| 2300 |
end; |
| 2301 |
if GikoSys.Setting.BrowserTabVisible then begin |
| 2302 |
if GetActiveContent = Item.ThreadItem then |
| 2303 |
browserRec := InsertBrowserTab(Item.ThreadItem) |
| 2304 |
else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then |
| 2305 |
browserRec := InsertBrowserTab(Item.ThreadItem, True) |
| 2306 |
else |
| 2307 |
browserRec := InsertBrowserTab(Item.ThreadItem, False); |
| 2308 |
if browserRec.Thread = BrowserNullTab.Thread then begin |
| 2309 |
browserRec.Movement := BrowserNullTab.Movement; |
| 2310 |
BrowserNullTab.Movement := ''; |
| 2311 |
end; |
| 2312 |
end else begin |
| 2313 |
if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then |
| 2314 |
InsertBrowserTab(Item.ThreadItem); |
| 2315 |
end; |
| 2316 |
|
| 2317 |
Application.ProcessMessages; |
| 2318 |
|
| 2319 |
if Item.State = gdsComplete then begin |
| 2320 |
PlaySound('New'); |
| 2321 |
AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureSyutoku), nil, gmiOK); |
| 2322 |
//Add by Genyakun |
| 2323 |
DiffComp := True; |
| 2324 |
end else begin |
| 2325 |
PlaySound('NewDiff'); |
| 2326 |
AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureDiff), nil, gmiOK); |
| 2327 |
//Add by Genyakun |
| 2328 |
DiffComp := True; |
| 2329 |
end; |
| 2330 |
|
| 2331 |
//鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 2332 |
if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin |
| 2333 |
Item.ThreadItem.Round := False; |
| 2334 |
//Item.ThreadItem.RoundName := ''; |
| 2335 |
AddMessageList('鐃緒申1000鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 - [' + Item.ThreadItem.Title + ']', nil, gmiOK); |
| 2336 |
end; |
| 2337 |
TreeView.Refresh; |
| 2338 |
//ListView鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 2339 |
if (ActiveList <> nil) and (ActiveList is TBoard) then begin |
| 2340 |
TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount; |
| 2341 |
TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount; |
| 2342 |
TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount; |
| 2343 |
//ListView鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃? |
| 2344 |
case GikoForm.ViewType of |
| 2345 |
gvtAll: ListView.Items.Count := TBoard(ActiveList).Count; |
| 2346 |
gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount; |
| 2347 |
gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount; |
| 2348 |
gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount; |
| 2349 |
end; |
| 2350 |
end; |
| 2351 |
end; |
| 2352 |
ListView.Refresh; |
| 2353 |
end else if Item.State = gdsNotModify then begin |
| 2354 |
//鐃緒申鐃?鐃?鐃? |
| 2355 |
{ if (Item.DownType = gdtThread) and (AddHistory(Item.ThreadItem)) then begin |
| 2356 |
//SetContent(Item.ThreadItem); |
| 2357 |
InsertBrowserTab(Item.ThreadItem); |
| 2358 |
end;} |
| 2359 |
AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmNotMod), nil, gmiSAD); |
| 2360 |
PlaySound('NoChange'); |
| 2361 |
Screen.Cursor := crDefault; |
| 2362 |
end else if Item.State = gdsAbort then begin |
| 2363 |
//鐃緒申鐃? |
| 2364 |
AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK); |
| 2365 |
end else if Item.State = gdsError then begin |
| 2366 |
//鐃?鐃緒申鐃? |
| 2367 |
s := Item.ErrText; |
| 2368 |
if s <> '' then |
| 2369 |
s := ':' + s; |
| 2370 |
AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmError) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG); |
| 2371 |
// if Item.ResponseCode = 302 then |
| 2372 |
// AddMessageList('鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', nil, gmiNG); |
| 2373 |
PlaySound('Error'); |
| 2374 |
end; |
| 2375 |
finally |
| 2376 |
Item.Free; |
| 2377 |
Dec(FWorkCount); |
| 2378 |
if FWorkCount < 0 then FWorkCount := 0; |
| 2379 |
if FWorkCount = 0 then begin |
| 2380 |
try |
| 2381 |
Animate.Active := False; |
| 2382 |
finally |
| 2383 |
Screen.Cursor := crDefault; |
| 2384 |
end; |
| 2385 |
end; |
| 2386 |
|
| 2387 |
end; |
| 2388 |
end; |
| 2389 |
|
| 2390 |
procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string); |
| 2391 |
begin |
| 2392 |
// SetProgressValue(Number, 0, AWorkCountMax); |
| 2393 |
// ProgressBar.Visible := True; |
| 2394 |
ProgressBar.Position := 0; |
| 2395 |
ProgressBar.Max := AWorkCountMax; |
| 2396 |
FDownloadTitle := AWorkTitle; |
| 2397 |
StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申'; |
| 2398 |
FDownloadMax := AWorkCountMax; |
| 2399 |
end; |
| 2400 |
|
| 2401 |
procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer); |
| 2402 |
begin |
| 2403 |
ProgressBar.Position := 0; |
| 2404 |
if FDownloadMax <> 0 then |
| 2405 |
StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申'; |
| 2406 |
end; |
| 2407 |
|
| 2408 |
procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer); |
| 2409 |
begin |
| 2410 |
ProgressBar.Position := AWorkCount; |
| 2411 |
// SetProgressValue(Number, AWorkCount); |
| 2412 |
StatusBar.Panels[1].Text := FDownloadTitle + ' - 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')'; |
| 2413 |
end; |
| 2414 |
|
| 2415 |
procedure TGikoForm.AddMessageList(ACaption: string; AObject: TObject; Icon: TGikoMessageIcon); |
| 2416 |
var |
| 2417 |
ListItem: TListItem; |
| 2418 |
begin |
| 2419 |
MessageListView.Items.BeginUpdate; |
| 2420 |
try |
| 2421 |
ListItem := MessageListView.Items.Add; |
| 2422 |
ListItem.Caption := ACaption; |
| 2423 |
ListItem.Data := AObject; |
| 2424 |
ListItem.MakeVisible(False); |
| 2425 |
case Icon of |
| 2426 |
gmiOK: ListItem.ImageIndex := 0; |
| 2427 |
gmiSAD: ListItem.ImageIndex := 1; |
| 2428 |
gmiNG: ListItem.ImageIndex := 2; |
| 2429 |
gmiWhat: ListItem.ImageIndex := 3; |
| 2430 |
end; |
| 2431 |
finally |
| 2432 |
MessageListView.Items.EndUpdate; |
| 2433 |
end; |
| 2434 |
end; |
| 2435 |
|
| 2436 |
|
| 2437 |
function TGikoForm.InsertBrowserTab( |
| 2438 |
ThreadItem : TThreadItem; |
| 2439 |
ActiveTab : Boolean = True |
| 2440 |
) : TBrowserRecord; |
| 2441 |
var |
| 2442 |
i, j, idx : Integer; |
| 2443 |
favItem : TFavoriteThreadItem; |
| 2444 |
newBrowser : TBrowserRecord; |
| 2445 |
begin |
| 2446 |
|
| 2447 |
Result := nil; |
| 2448 |
if Threaditem = nil then Exit; |
| 2449 |
|
| 2450 |
if ThreadItem.IsLogFile then begin |
| 2451 |
//鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申browser鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 2452 |
//鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申Active鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申 |
| 2453 |
if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) and |
| 2454 |
(FActiveContent.Browser <> BrowserNullTab.Browser)then begin |
| 2455 |
j := FBrowsers.IndexOf(FActiveContent.Browser); |
| 2456 |
if j = BROWSER_COUNT - 1 then |
| 2457 |
FBrowsers.Move(BROWSER_COUNT - 1, 0); |
| 2458 |
end; |
| 2459 |
favItem := TFavoriteThreadItem.Create(ThreadItem.URL, ThreadItem.Title ); |
| 2460 |
if not AddHistory( favItem ) then |
| 2461 |
favItem.Free; |
| 2462 |
|
| 2463 |
for i := 0 to BrowserTab.Tabs.Count - 1 do begin |
| 2464 |
if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin |
| 2465 |
if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin |
| 2466 |
Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] ); |
| 2467 |
if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin |
| 2468 |
for j := BrowserTab.Tabs.Count - 1 downto 0 do begin |
| 2469 |
if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin |
| 2470 |
ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j])); |
| 2471 |
break; |
| 2472 |
end; |
| 2473 |
end; |
| 2474 |
TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); |
| 2475 |
TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true; |
| 2476 |
FBrowsers.Move(BROWSER_COUNT - 1, 0); |
| 2477 |
end; |
| 2478 |
if ActiveTab then begin |
| 2479 |
BrowserTab.TabIndex := i; |
| 2480 |
BrowserTab.OnChange(nil); |
| 2481 |
BrowserTab.Repaint; |
| 2482 |
end; |
| 2483 |
Exit; |
| 2484 |
end; |
| 2485 |
end; |
| 2486 |
end; |
| 2487 |
idx := BrowserTab.TabIndex; |
| 2488 |
if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin |
| 2489 |
newBrowser := TBrowserRecord.Create; |
| 2490 |
for j := BrowserTab.Tabs.Count - 1 downto 0 do begin |
| 2491 |
if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin |
| 2492 |
ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j])); |
| 2493 |
break; |
| 2494 |
end; |
| 2495 |
end; |
| 2496 |
newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); |
| 2497 |
FBrowsers.Move(BROWSER_COUNT - 1, 0); |
| 2498 |
//newBrowser.Browser.Navigate(BLANK_HTML); |
| 2499 |
newBrowser.thread := ThreadItem; |
| 2500 |
newBrowser.Repaint := true; |
| 2501 |
// newBrowser.OnlyHundred := GikoSys.OnlyAHundredRes; |
| 2502 |
|
| 2503 |
BrowserTab.Tabs.InsertObject(0, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser); |
| 2504 |
if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin |
| 2505 |
DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) ); |
| 2506 |
end;// else begin |
| 2507 |
//end; |
| 2508 |
BrowserTab.Repaint; |
| 2509 |
if ActiveTab then begin |
| 2510 |
BrowserTab.TabIndex := 0; |
| 2511 |
end; |
| 2512 |
|
| 2513 |
end else begin |
| 2514 |
newBrowser := TBrowserRecord.Create; |
| 2515 |
for j := BrowserTab.Tabs.Count - 1 downto 0 do begin |
| 2516 |
if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin |
| 2517 |
ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j])); |
| 2518 |
break; |
| 2519 |
end; |
| 2520 |
end; |
| 2521 |
newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); |
| 2522 |
FBrowsers.Move(BROWSER_COUNT - 1, 0); |
| 2523 |
//newBrowser.Browser.Navigate(BLANK_HTML); |
| 2524 |
newBrowser.thread := ThreadItem; |
| 2525 |
// newBrowser.OnlyHundred := GikoSys.OnlyAHundredRes; |
| 2526 |
newBrowser.Repaint := true; |
| 2527 |
|
| 2528 |
i := BrowserTab.Tabs.AddObject(GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser); |
| 2529 |
if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin |
| 2530 |
DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) ); |
| 2531 |
end; |
| 2532 |
//end; |
| 2533 |
BrowserTab.Repaint; |
| 2534 |
if ActiveTab then begin |
| 2535 |
if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then |
| 2536 |
BrowserTab.TabIndex := 0 |
| 2537 |
else |
| 2538 |
BrowserTab.TabIndex := i; |
| 2539 |
end; |
| 2540 |
end; |
| 2541 |
Result := newBrowser; |
| 2542 |
if(ActiveTab) or (idx = -1) then begin |
| 2543 |
BrowserTab.OnChange(nil); |
| 2544 |
end; |
| 2545 |
end else begin |
| 2546 |
if BrowserNullTab = nil then begin |
| 2547 |
BrowserNullTab := TBrowserRecord.Create; |
| 2548 |
BrowserNullTab.Browser := Browser; |
| 2549 |
end; |
| 2550 |
BrowserNullTab.thread := ThreadItem; |
| 2551 |
Result := BrowserNullTab; |
| 2552 |
BrowserTab.TabIndex := -1; |
| 2553 |
SetContent(BrowserNullTab); |
| 2554 |
end; |
| 2555 |
|
| 2556 |
if GikoSys.Setting.URLDisplay then |
| 2557 |
AddressComboBox.Text := ThreadItem.URL; |
| 2558 |
|
| 2559 |
end; |
| 2560 |
|
| 2561 |
procedure TGikoForm.SetContent(inThread : TBrowserRecord); |
| 2562 |
var |
| 2563 |
BBSID: string; |
| 2564 |
FileName: string; |
| 2565 |
sTitle: string; |
| 2566 |
doc: Variant; |
| 2567 |
s: string; |
| 2568 |
i: Integer; |
| 2569 |
idx: Integer; |
| 2570 |
ThreadItem: TThreadItem; |
| 2571 |
Thread: TBrowserRecord; |
| 2572 |
ThreadTitle, ThreadPTitle: string; |
| 2573 |
ThreadIsLog, {ThreadUnRead,} ThreadNewArraical: boolean; |
| 2574 |
begin |
| 2575 |
Thread := inThread; |
| 2576 |
idx := BrowserTab.TabIndex; |
| 2577 |
if (FActiveContent <> nil) and |
| 2578 |
(FActiveContent.Thread <> Thread.Thread) and |
| 2579 |
(Assigned(FActiveContent.Browser.Document)) then begin |
| 2580 |
try |
| 2581 |
try |
| 2582 |
Sleep(1); |
| 2583 |
FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document).Body).ScrollTop; |
| 2584 |
except |
| 2585 |
on E: Exception do |
| 2586 |
MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0); |
| 2587 |
end; |
| 2588 |
finally |
| 2589 |
end; |
| 2590 |
end; |
| 2591 |
if not (Assigned(Thread)) or (Thread.Thread = nil) then begin |
| 2592 |
Thread.Browser.Navigate(BLANK_HTML); |
| 2593 |
BrowserBoardNameLabel.Caption := ''; |
| 2594 |
ItemBoardImage.Picture := nil; |
| 2595 |
BrowserNameLabel.Caption := ''; |
| 2596 |
ItemImage.Picture := nil; |
| 2597 |
BrowserNullTab.Thread := nil; |
| 2598 |
//TOleControl(BrowserNullTab.Browser).Visible := true; |
| 2599 |
ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW); |
| 2600 |
FActiveContent := nil; |
| 2601 |
Exit; |
| 2602 |
end else if Thread.Browser = nil then begin |
| 2603 |
if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then |
| 2604 |
FBrowsers.Move(BROWSER_COUNT - 1, 0); |
| 2605 |
for i := BrowserTab.Tabs.Count - 1 downto 0 do begin |
| 2606 |
if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin |
| 2607 |
ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i])); |
| 2608 |
break; |
| 2609 |
end; |
| 2610 |
end; |
| 2611 |
Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); |
| 2612 |
FBrowsers.Move(BROWSER_COUNT - 1, 0); |
| 2613 |
end; |
| 2614 |
|
| 2615 |
ThreadTitle := Thread.Thread.Title; |
| 2616 |
ThreadPTitle := Thread.Thread.ParentBoard.Title; |
| 2617 |
//ThreadScrollTop := Thread.Thread.ScrollTop; |
| 2618 |
ThreadIsLog := Thread.Thread.IsLogFile; |
| 2619 |
ThreadItem := Thread.Thread; |
| 2620 |
ThreadNewArraical := Thread.Thread.NewArrival; |
| 2621 |
//ThreadUnRead := Thread.Thread.UnRead; |
| 2622 |
BBSID := ThreadItem.ParentBoard.BBSID; |
| 2623 |
FileName := ThreadItem.FileName; |
| 2624 |
|
| 2625 |
if GetCapture = ListView.Handle then |
| 2626 |
ReleaseCapture; |
| 2627 |
|
| 2628 |
Screen.Cursor := crHourGlass; |
| 2629 |
|
| 2630 |
|
| 2631 |
try |
| 2632 |
if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin |
| 2633 |
if (FActiveContent.Browser <> BrowserNullTab.Browser) then |
| 2634 |
ShowWindow(FActiveContent.Browser.Handle, SW_HIDE); |
| 2635 |
end; |
| 2636 |
ShowWindow(Thread.Browser.Handle, SW_SHOW); |
| 2637 |
if (not Assigned(Thread.Browser.Document)) then begin |
| 2638 |
Thread.Browser.Navigate('about:blank'); |
| 2639 |
end; |
| 2640 |
|
| 2641 |
while (Thread.Browser.ReadyState <> READYSTATE_COMPLETE) and |
| 2642 |
(Thread.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin |
| 2643 |
Application.ProcessMessages; |
| 2644 |
if idx <> BrowserTab.TabIndex then begin |
| 2645 |
Exit; |
| 2646 |
end; |
| 2647 |
end; |
| 2648 |
|
| 2649 |
//ActiveContent鐃?鐃緒申鐃?鐃? |
| 2650 |
FActiveContent := Thread; |
| 2651 |
|
| 2652 |
if not ThreadIsLog then begin |
| 2653 |
Self.Caption := GikoDataModule.CAPTION_NAME ; |
| 2654 |
try |
| 2655 |
s := '<HTML><BODY><CENTER>鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申</CENTER></BODY></HTML>'; |
| 2656 |
doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2; |
| 2657 |
doc.open; |
| 2658 |
doc.charset := 'Shift_JIS'; |
| 2659 |
doc.Write(s); |
| 2660 |
doc.Close; |
| 2661 |
finally |
| 2662 |
end; |
| 2663 |
end else begin |
| 2664 |
Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + ThreadTitle + ']'; |
| 2665 |
//Thread.Repaint鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?Thread鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 2666 |
//鐃?鐃?鐃緒申Thread鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃? |
| 2667 |
if Thread.Repaint then begin |
| 2668 |
Thread.Repaint := false; |
| 2669 |
|
| 2670 |
Thread.Browser.OnStatusTextChange := nil; |
| 2671 |
doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2; |
| 2672 |
|
| 2673 |
//GikoSys.CreateHTML2(doc, ThreadItem, sTitle); |
| 2674 |
HTMLCreater.CreateHTML2(doc, ThreadItem, sTitle); |
| 2675 |
Thread.Browser.OnStatusTextChange := BrowserStatusTextChange; |
| 2676 |
|
| 2677 |
if ThreadItem = nil then begin |
| 2678 |
FActiveContent := nil; |
| 2679 |
BrowserTab.Repaint; |
| 2680 |
Exit; |
| 2681 |
end; |
| 2682 |
PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( Thread.Browser ), 0 ); |
| 2683 |
end; |
| 2684 |
end; |
| 2685 |
if (Thread <> nil) and (ThreadItem <>nil) then begin |
| 2686 |
BrowserBoardNameLabel.Caption := ThreadPTitle; |
| 2687 |
ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap); |
| 2688 |
BrowserNameLabel.Caption := ThreadTitle; |
| 2689 |
ItemImage.Picture := nil; |
| 2690 |
if ThreadIsLog then |
| 2691 |
if ThreadNewArraical then |
| 2692 |
ItemImageList.GetBitmap(2, ItemImage.Picture.Bitmap) |
| 2693 |
else |
| 2694 |
ItemImageList.GetBitmap(0, ItemImage.Picture.Bitmap) |
| 2695 |
else |
| 2696 |
ItemImageList.GetBitmap(1, ItemImage.Picture.Bitmap); |
| 2697 |
|
| 2698 |
ItemImage.Left := BrowserBoardNameLabel.Left + BrowserBoardNameLabel.Width + 8; |
| 2699 |
BrowserNameLabel.Left := ItemImage.Left + 20; |
| 2700 |
|
| 2701 |
//Thread鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 2702 |
if (FActiveList is TBoard) and (TBoard(ActiveList) = ThreadItem.ParentBoard) then |
| 2703 |
ListView.Refresh; |
| 2704 |
end else begin |
| 2705 |
FActiveContent := nil; |
| 2706 |
end; |
| 2707 |
finally |
| 2708 |
Screen.Cursor := crDefault; |
| 2709 |
end; |
| 2710 |
end; |
| 2711 |
|
| 2712 |
function TGikoForm.GetActiveContent: TThreadItem; |
| 2713 |
begin |
| 2714 |
try |
| 2715 |
if FActiveContent <> nil then |
| 2716 |
Result := FActiveContent.Thread |
| 2717 |
else |
| 2718 |
Result := nil; |
| 2719 |
except |
| 2720 |
Result := nil; |
| 2721 |
end; |
| 2722 |
|
| 2723 |
end; |
| 2724 |
|
| 2725 |
procedure TGikoForm.SetActiveList(Obj: TObject); |
| 2726 |
var |
| 2727 |
idx : Integer; |
| 2728 |
begin |
| 2729 |
// if FActiveList <> Obj then begin |
| 2730 |
FActiveList := Obj; |
| 2731 |
try |
| 2732 |
if ListView.Selected <> nil then |
| 2733 |
idx := ListView.Selected.Index |
| 2734 |
else |
| 2735 |
idx := -1; |
| 2736 |
except |
| 2737 |
idx := -1; |
| 2738 |
end; |
| 2739 |
ListView.Items.Count := 0; |
| 2740 |
ListView.Items.Clear; |
| 2741 |
ListView.Selected := nil; |
| 2742 |
// ListView.Columns.Clear; |
| 2743 |
if (FActiveContent <> nil) and (FActiveContent.Thread <> nil) |
| 2744 |
and (FActiveContent.Thread.IsLogFile) then |
| 2745 |
Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + FActiveContent.Thread.Title + ']' |
| 2746 |
else |
| 2747 |
Self.Caption := GikoDataModule.CAPTION_NAME; |
| 2748 |
//Application.Title := CAPTION_NAME; |
| 2749 |
|
| 2750 |
// ActiveListColumnSave; |
| 2751 |
|
| 2752 |
Screen.Cursor := crHourGlass; |
| 2753 |
try |
| 2754 |
if Obj is TBBS then begin |
| 2755 |
TListViewUtils.SetCategoryListItem(TBBS(obj), ListView, GikoDM.ListNumberVisibleAction.Checked, |
| 2756 |
FSortIndex, FSortOrder); |
| 2757 |
end else if Obj is TCategory then begin |
| 2758 |
TListViewUtils.SetBoardListItem(TCategory(Obj), ListView, GikoDM.ListNumberVisibleAction.Checked, |
| 2759 |
FSortIndex, FSortOrder); |
| 2760 |
end else if Obj is TBoard then begin |
| 2761 |
TListViewUtils.SetThreadListItem(TBoard(Obj), ListView, GikoDM.ListNumberVisibleAction.Checked, |
| 2762 |
FSortIndex, FSortOrder); |
| 2763 |
end; |
| 2764 |
finally |
| 2765 |
Screen.Cursor := crDefault; |
| 2766 |
end; |
| 2767 |
|
| 2768 |
if idx >= 0 then begin |
| 2769 |
if idx >= ListView.Items.Count then |
| 2770 |
idx := ListView.Items.Count - 1; |
| 2771 |
ListView.ItemIndex := idx; |
| 2772 |
ListView.ItemFocused := ListView.Items.Item[ idx ]; |
| 2773 |
end; |
| 2774 |
// end; |
| 2775 |
end; |
| 2776 |
|
| 2777 |
|
| 2778 |
//鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申 |
| 2779 |
//鐃緒申鐃緒申鐃緒申鐃緒申interface鐃緒申鐃?鐃緒申 |
| 2780 |
function TGikoForm.GetActiveList: TObject; |
| 2781 |
begin |
| 2782 |
Result := FActiveList; |
| 2783 |
end; |
| 2784 |
|
| 2785 |
procedure TGikoForm.SetListViewType(AViewType: TGikoViewType); |
| 2786 |
begin |
| 2787 |
SetListViewType(AViewType, '', False); |
| 2788 |
end; |
| 2789 |
|
| 2790 |
procedure TGikoForm.SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); |
| 2791 |
var |
| 2792 |
Board: TBoard; |
| 2793 |
i: Integer; |
| 2794 |
begin |
| 2795 |
for i := Length( BBSs ) - 1 downto 0 do begin |
| 2796 |
BBSs[i].SelectText := SelectText; |
| 2797 |
BBSs[i].KubetsuChk := KubetsuChk; |
| 2798 |
end; |
| 2799 |
ViewType := AViewType; |
| 2800 |
if ActiveList is TBoard then begin |
| 2801 |
Board := TBoard(ActiveList); |
| 2802 |
case ViewType of |
| 2803 |
//gvtAll: ListView.Items.Count := Board.Count; |
| 2804 |
gvtLog: Board.LogThreadCount := Board.GetLogThreadCount; |
| 2805 |
gvtNew: Board.NewThreadCount := Board.GetNewThreadCount; |
| 2806 |
gvtUser: Board.UserThreadCount:= Board.GetUserThreadCount; |
| 2807 |
end; |
| 2808 |
|
| 2809 |
SetActiveList(Board); |
| 2810 |
end; |
| 2811 |
end; |
| 2812 |
|
| 2813 |
procedure TGikoForm.ListViewCustomDraw(Sender: TCustomListView; |
| 2814 |
const ARect: TRect; var DefaultDraw: Boolean); |
| 2815 |
var |
| 2816 |
s: string; |
| 2817 |
p: TPoint; |
| 2818 |
// Board: TBoard; |
| 2819 |
begin |
| 2820 |
if ListView.Items.Count = 0 then begin |
| 2821 |
DefaultDraw := true; |
| 2822 |
ListView.Canvas.Brush.Color := ListView.Color; |
| 2823 |
ListView.Canvas.FillRect(ARect); |
| 2824 |
|
| 2825 |
case ViewType of |
| 2826 |
gvtAll: begin |
| 2827 |
ListView.Canvas.Font.Color := clWindowText; |
| 2828 |
s := '鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?'; |
| 2829 |
end; |
| 2830 |
gvtLog: begin |
| 2831 |
ListView.Canvas.Font.Color := clBlue; |
| 2832 |
s := '鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?'; |
| 2833 |
end; |
| 2834 |
gvtNew: begin |
| 2835 |
ListView.Canvas.Font.Color := clGreen; |
| 2836 |
s := '鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?'; |
| 2837 |
end; |
| 2838 |
gvtUser: begin |
| 2839 |
ListView.Canvas.Font.Color := clNavy; |
| 2840 |
s := '鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?%s鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?'; |
| 2841 |
if GetActiveList is TBoard then |
| 2842 |
s := Format(s, [TBoard(GetActiveList).ParentCategory.ParenTBBS.SelectText]); |
| 2843 |
// SelectText]); |
| 2844 |
end; |
| 2845 |
else begin |
| 2846 |
s := ''; |
| 2847 |
end; |
| 2848 |
end; |
| 2849 |
|
| 2850 |
p := Point((ListView.ClientWidth div 2) - (ListView.Canvas.TextWidth(s) div 2), |
| 2851 |
(ListView.ClientHeight div 2) - (ListView.Canvas.TextHeight(s) div 2)); |
| 2852 |
ListView.Canvas.TextOut(p.X, p.Y, s); |
| 2853 |
end else begin |
| 2854 |
DefaultDraw := True; |
| 2855 |
end; |
| 2856 |
end; |
| 2857 |
|
| 2858 |
procedure TGikoForm.DownloadList(Board: TBoard; ForceDownload: Boolean = False); |
| 2859 |
var |
| 2860 |
Item: TDownloadItem; |
| 2861 |
begin |
| 2862 |
if not Board.IsThreadDatRead then |
| 2863 |
GikoSys.ReadSubjectFile(Board); |
| 2864 |
Item := TDownloadItem.Create; |
| 2865 |
try |
| 2866 |
Item.Board := Board; |
| 2867 |
Item.DownType := gdtBoard; |
| 2868 |
Item.ForceDownload := ForceDownload; |
| 2869 |
FControlThread.AddItem(Item); |
| 2870 |
if FWorkCount = 0 then begin |
| 2871 |
try |
| 2872 |
Animate.Active := True; |
| 2873 |
except |
| 2874 |
end; |
| 2875 |
Screen.Cursor := crAppStart; |
| 2876 |
end; |
| 2877 |
Inc(FWorkCount); |
| 2878 |
finally |
| 2879 |
//Item.Free; |
| 2880 |
end; |
| 2881 |
end; |
| 2882 |
|
| 2883 |
procedure TGikoForm.DownloadContent(ThreadItem: TThreadItem; ForceDownload: Boolean = False); |
| 2884 |
var |
| 2885 |
Item: TDownloadItem; |
| 2886 |
begin |
| 2887 |
Item := TDownloadItem.Create; |
| 2888 |
try |
| 2889 |
Item.ThreadItem := ThreadItem; |
| 2890 |
Item.DownType := gdtThread; |
| 2891 |
Item.ForceDownload := ForceDownload; |
| 2892 |
FControlThread.AddItem(Item); |
| 2893 |
if FWorkCount = 0 then begin |
| 2894 |
try |
| 2895 |
Animate.Active := True; |
| 2896 |
except |
| 2897 |
end; |
| 2898 |
Screen.Cursor := crAppStart; |
| 2899 |
end; |
| 2900 |
Inc(FWorkCount); |
| 2901 |
finally |
| 2902 |
// Item.Free; |
| 2903 |
end; |