sf_flashreg.pas
来自「smartflash ,delphi vcl组件 ,可以实现透明flash窗体」· PAS 代码 · 共 89 行
PAS
89 行
{*******************************************************************}
{ }
{ Almediadev Visual Component Library }
{ SmartFlash }
{ Version 1.50 }
{ }
{ Copyright (c) 2000-2007 Almediadev }
{ ALL RIGHTS RESERVED }
{ }
{ Home: http://www.almdev.com }
{ Support: support@almdev.com }
{ }
{*******************************************************************}
unit sf_flashreg;
{$I sf_define.inc}
{$T-,W-,X+,P+}
interface
uses
SysUtils, Dialogs, Forms, Classes, Controls,
{$IFDEF AL_COMPILER6_UP} DesignIntf, DesignEditors {$ELSE} DsgnIntf {$ENDIF};
procedure Register;
implementation {===============================================================}
{$IFNDEF AL_COMPILER5_UP}
{$R *.dcr}
{$ENDIF}
uses sf_flashplayer, sf_Flash;
type
{ TsfFlashStreamProperty }
TsfFlashStreamProperty = class(TPropertyEditor)
private
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue: string; override;
end;
procedure TsfFlashStreamProperty.Edit;
var
OpenDialog: TOpenDialog;
begin
{ Execute editor }
OpenDialog := TOpenDialog.Create(Application);
OpenDialog.Filter := 'Flash file|*.swf|Flash video file|*.flv';
try
if OpenDialog.Execute then
begin
TsfFlashStream(GetComponent(0)).Flash.LoadFromFile(OpenDialog.FileName);
if TsfFlashStream(GetComponent(0)).Flash.Size > 0 then
TsfFlashStream(GetComponent(0)).FFlashStore := ExtractFileName(OpenDialog.FileName);
end;
Modified;
finally
OpenDialog.Free;
end;
end;
function TsfFlashStreamProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog];
end;
function TsfFlashStreamProperty.GetValue: string;
begin
Result := TsfFlashStream(GetComponent(0)).DisplayName;
end;
{ Register classes ============================================================}
procedure Register;
begin
RegisterComponents('SmartFlash', [TsfFlashPlayer, TsfFlashList,
TsfLayeredFlashForm]);
RegisterPropertyEditor(TypeInfo(string), TsfFlashStream, 'FlashStore', TsfFlashStreamProperty);
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?