Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Lionel Morin
Salut Vincent
Voici un bout de script (mieux vaut tard que jamais...) juste pour que tu voies la démarche : [pompé sur un objet de maitre Sébastien Portebois ;-)]
hth A+ Lionel -------------------------
maxLght = 0 charCnt = 0 linesNb = pMember.lines.count repeat with i = 1 to linesNb lineCharNb = pMember.line[i].char.count if (lineCharNb > maxLght) then maxLght = lineCharNb charCnt = pMember.line[1..i].char.count end if end repeat
pixWidth = charPosToLoc(pMember, charCnt+1)[1] if (pixWidth > 0) then pSprite.visible = TRUE fieldWidth = pixWidth -- We adjust the line size myRect = pMember.rect myRect.right = fieldWidth pMember.rect = myRect else if pPhantom then pSprite.visible = FALSE else myRect = pMember.rect myRect.right = myRect.left + pMinWidth pMember.rect = myRect end if end if
Salut Vincent
Voici un bout de script (mieux vaut tard que jamais...) juste pour que tu
voies la démarche :
[pompé sur un objet de maitre Sébastien Portebois ;-)]
hth
A+
Lionel
-------------------------
maxLght = 0
charCnt = 0
linesNb = pMember.lines.count
repeat with i = 1 to linesNb
lineCharNb = pMember.line[i].char.count
if (lineCharNb > maxLght) then
maxLght = lineCharNb
charCnt = pMember.line[1..i].char.count
end if
end repeat
pixWidth = charPosToLoc(pMember, charCnt+1)[1]
if (pixWidth > 0) then
pSprite.visible = TRUE
fieldWidth = pixWidth
-- We adjust the line size
myRect = pMember.rect
myRect.right = fieldWidth
pMember.rect = myRect
else
if pPhantom then
pSprite.visible = FALSE
else
myRect = pMember.rect
myRect.right = myRect.left + pMinWidth
pMember.rect = myRect
end if
end if
Voici un bout de script (mieux vaut tard que jamais...) juste pour que tu voies la démarche : [pompé sur un objet de maitre Sébastien Portebois ;-)]
hth A+ Lionel -------------------------
maxLght = 0 charCnt = 0 linesNb = pMember.lines.count repeat with i = 1 to linesNb lineCharNb = pMember.line[i].char.count if (lineCharNb > maxLght) then maxLght = lineCharNb charCnt = pMember.line[1..i].char.count end if end repeat
pixWidth = charPosToLoc(pMember, charCnt+1)[1] if (pixWidth > 0) then pSprite.visible = TRUE fieldWidth = pixWidth -- We adjust the line size myRect = pMember.rect myRect.right = fieldWidth pMember.rect = myRect else if pPhantom then pSprite.visible = FALSE else myRect = pMember.rect myRect.right = myRect.left + pMinWidth pMember.rect = myRect end if end if