1 //////////////////////////////////////////////////
6 // Author: Dimaxx (dimaxx@atnet.ru) //
9 //////////////////////////////////////////////////
14 uses Classes
, Kol
, Mirror
;
17 TShockwaveFlashOnReadyStateChange
= procedure(Sender
: TObject
; newState
: Integer) of object;
18 TShockwaveFlashOnProgress
= procedure(Sender
: TObject
; percentDone
: Integer) of object;
19 TShockwaveFlashFSCommand
= procedure(Sender
: TObject
; const command
: WideString
; const args
: WideString
) of object;
21 TKOLFlash
= class(TKOLCustomControl
)
23 FOnFlashReadyStateChange
: TShockwaveFlashOnReadyStateChange
;
24 FOnFlashProgress
: TShockwaveFlashOnProgress
;
25 FOnFlashFSCommand
: TShockwaveFlashFSCommand
;
27 constructor Create(Owner
: TComponent
); override;
29 function AdditionalUnits
: string; override;
30 procedure SetupFirst(SL
: TStringList
; const AName
,AParent
,Prefix
: string); override;
31 procedure AssignEvents(SL
: TStringList
; const AName
: string); override;
32 procedure SetOnFlashReadyStateChange(E
: TShockwaveFlashOnReadyStateChange
);
33 procedure SetOnFlashProgress(E
: TShockwaveFlashOnProgress
);
34 procedure SetOnFlashFSCommand(E
: TShockwaveFlashFSCommand
);
40 property OnFlashReadyStateChange
: TShockwaveFlashOnReadyStateChange read FOnFlashReadyStateChange write SetOnFlashReadyStateChange
;
41 property OnFlashProgress
: TShockwaveFlashOnProgress read FOnFlashProgress write SetOnFlashProgress
;
42 property OnFlashFSCommand
: TShockwaveFlashFSCommand read FOnFlashFSCommand write SetOnFlashFSCommand
;
53 RegisterComponents('KOL', [TKOLFlash
]);
56 constructor TKOLFlash
.Create
;
58 inherited Create(Owner
);
61 function TKOLFlash
.AdditionalUnits
;
66 procedure TKOLFlash
.SetupFirst
;
68 SL
.Add(Prefix
+AName
+' := NewKOLFlash(Result.Form); ');
69 AssignEvents(SL
,AName
);
72 procedure TKOLFlash
.AssignEvents
;
75 DoAssignEvents(SL
,AName
,
76 ['OnFlashReadyStateChange','OnFlashProgress','OnFlashFSCommand'],
77 [@OnFlashReadyStateChange
,@OnFlashProgress
,@OnFlashFSCommand
]);
80 procedure TKOLFlash
.SetOnFlashReadyStateChange
;
82 FOnFlashReadyStateChange
:=E
;
86 procedure TKOLFlash
.SetOnFlashProgress
;
92 procedure TKOLFlash
.SetOnFlashFSCommand
;