var Bouton,lien,btn,jmp,signet,Titre,Nom,H:string;
i,nbr:integer;
r,v,b,L,Numero:integer;
Vertical:boolean;
color:string;
Skip :TStringList;
iSkip,nSkip:integer;
okSkip:boolean;
begin
//skip contient les noms des signets à ne pas reprendre
Skip := TStringList.create;
Skip.text := GetParam('Skip','');
nSkip := Skip.count-1;

Lien := 'JI(qchPath,`$SIGNET$'+#39+')';
Bouton := '<<CBT($TITRE$,$LH$,$RVB$,256,4097,$LIEN$|EASYHELP,#0)>>';

color := GetParam('Color','');

if color='' then
begin
// couleur des boutons adaptés à la couleur du fond
if IsScroll then
GetRgb(GetElement(eScrollColor),r,v,b) // couleur z. défilante
else
GetRgb(GetElement(eFixeColor),r,v,b); // z. fixe
end else GetRgb(StringToColor(color),r,v,b);
// on patche le bouton avec la couleur
Bouton := Replace(Bouton,'$RVB$',IntToStr(r)+','+IntToStr(v)+','+IntToStr(b));
// on patche le bouton avec Bordure,Largeur,hauteur
L := StrToInt(GetPAram('Width','20')); // par défaut 20
// par défaut le bouton n'a pas de bordure tant qu'il n'est pas survolé
// passez FLAT=FALSE pour qu'il est toujours une bordure
if GetParam('Flat','true')='true' then L:=10000+L;
H := GetParam('Height','20'); // par défaut 20
Bouton := Replace(Bouton,'$LH$',IntTostr(L)+','+H);

// déterminer si les boutons sont horizontaux ou verticaux
Vertical := GetParam('Vertical','false')='true'; // par défaut horizontaux

// Titre & nom de la rubrique
Titre := GetTitre;
Nom := GetNom;

// obtenir le nombre de signet de la rubrique
nbr := GetSignetCount(Titre);
// initialiser les numéros des signet
Numero := 1;

// pour chaque signet, un bouton à son nom et lié sur lui
for i:=0 to nbr-1 do
begin
signet := GetSignetOf(Titre,i);
if (signet<>'') then
begin
// vérifier que le signet est autorisé
okSkip := false;
for iSkip := 0 to nSkip do
if (Match(SKip.strings[iSkip],Signet)=true) then okSkip := true;

if not okSkip then
begin
jmp := Replace(Lien,'$SIGNET$',Nom+'>'+Signet);
btn := Replace(Bouton,'$TITRE$',IntToStr(numero)+'^'+Signet);
Btn := Replace(btn,'$LIEN$',jmp);
numero := numero+1;
if Vertical then WriteLn(Btn) else Write(Btn);
end;
end;
end;

Skip.free;
end;
end.

Sommaire