// déclaration variables
var pathSystem,pathProj,flash,img,button,fullscreen,h,w,auto,color,defaut: string;
liste:TStringList;
i:integer;
begin

img := GetParam('img','');
// on va récuperer la liste des images
Liste := TStringList.create;
// on remplace la virgule qui sépare les images par les caratères 13 et 10 qui indique un saut de ligne
Liste.text := replace(img,',',chr(13)+chr(10));
// image par défaut si pas de flash
defaut := GetParam('Img-no-Flash','');
if defaut<>'' then
begin
AddBitmapFile(defaut);
defaut := '<<BMP(C,')>>+defaut+<<FNT(STRING.-,-,-,-:',,,,1,1)>>';
end else
// si pas de lecteur flash on utilise la première image
if (Liste.count>0) then Defaut:='<<BMP(C,')>>+liste.strings[<<FNT(NUMBER.-,-,-,-:0)>>]+<<FNT(STRING.-,-,-,-:',,,,1,1)>>';
// on renseigne help&web sur les images utilisées
for i:=0 to Liste.count-1 do AddBitmapFile(liste.strings[i]);
Liste.free;


// ne fonctionne qu'en html
if Condition('_HTML_') then
begin
h := GetParam('Height','420');
w := GetParam('Width','520');

color := ColorToHtml(GetParam('color','$FFFFFF'));
auto := GetParam('delai','5');
if (auto<>'0')and(auto<>'') then auto:='auto='+auto else auto := '';

if GetParam('button','true')='true' then button := 'on' else button:='off';
if GetParam('fullscreen','false')='true' then fullscreen := 'on' else fullscreen:='off';


Flash := 'dewslider.swf';
// copier le fichier flash une seule fois
if GetVarInt(flash,0)=0 then
begin
SetVarInt(flash,1); // positionné à un pour ne pas revenir ici*
// on détermine les répertoires source et cible
pathSystem := Path+'system.hew\';
pathProj := PathProjet;
if Condition('_HTMLHELP_') then pathProj:=pathProj+'htmlhelp\';
pathProj := pathProj+'html\';
CopyFile(Pathsystem+'DewSlider\'+Flash,pathProj+Flash);
end;

// insérer le code
write('<<WEB($html:+)>>'); // on insérer directement du code html
write('<object type="application/x-shockwave-flash" data="dewslider.swf?img='+img);
write('&fullscreen='+fullscreen+'&buttons='+button+'&'+auto+'" width="'+w+'" height="'+h+'">');
write('<param name="movie" value="dewslider.swf?img='+img);
write('&fullscreen='+fullscreen+'&buttons='+button+'&'+auto+'" />');
write('<param name="bgcolor" value="'+color+'" />');
write(defaut);
write('</object>');

write('<<WEB($html:-)>>'); // on rebascule en code help&web
end else write(defaut); // fin si html

end;
end.

Sommaire