1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| PROCEDURE Image_Afficher_InfoBulle(suneFenêtre, suneImage, sunChampCommentaire, sInfoAAfficher)
nFacteurEspacement est un entier = 10
nFacteurDépassementX, nFacteurDépassementY est un entier
rHauteurChampBulle est un réel
rLargeurChampBulle est un réel
sUnChampSurvolé est une chaîne = suneImage
nRes est un entier = CurseurPos(cpClient)
nPositionPremiereLigne est un entier = PoidsFort(nRes)-{suneImage,indChamp}..Hauteur+{suneImage,indChamp}..Y
SI Position(sUnChampSurvolé,"Img") <> 0 ALORS //Si on est bien sur le champ image
SI nRes <> -1 ALORS
SI ChampExiste(sUnChampSurvolé) ALORS
// Afficher le champ des commentaires en haut si l'image dépasse la fenêtre par en bas
// Idem par à droite par la gauche
nFacteurDépassementX = PoidsFaible(nRes) + nFacteurEspacement + {sunChampCommentaire,indChamp}..Largeur
nFacteurDépassementY = PoidsFort(nRes) + nFacteurEspacement + {sunChampCommentaire,indChamp}..Hauteur
SI nFacteurDépassementY > {suneFenêtre,indChamp}..Hauteur ALORS
{sunChampCommentaire,indChamp}..Y = PoidsFort(nRes) + nFacteurEspacement - {sunChampCommentaire,indChamp}..Hauteur
SINON
{sunChampCommentaire,indChamp}..Y = PoidsFort(nRes) + nFacteurEspacement
FIN
SI nFacteurDépassementX > {suneFenêtre,indChamp}..Largeur ALORS
{sunChampCommentaire,indChamp}..X = PoidsFaible(nRes) + nFacteurEspacement - {sunChampCommentaire,indChamp}..Largeur
SINON
{sunChampCommentaire,indChamp}..X = PoidsFaible(nRes) + nFacteurEspacement
FIN
{sunChampCommentaire,indChamp}..Valeur = sInfoAAfficher
rHauteurChampBulle=TexteHauteur({sunChampCommentaire,indChamp},sInfoAAfficher) //Prépare la hauteur du champ en fonction du texte à afficher
rLargeurChampBulle=TexteLargeur({sunChampCommentaire,indChamp},sInfoAAfficher)+5 //Prépare la largeur du champ en fonction du texte à afficher
{sunChampCommentaire,indChamp}..Hauteur = rHauteurChampBulle
{sunChampCommentaire,indChamp}..Largeur = rLargeurChampBulle
{sunChampCommentaire,indChamp}..Visible = Vrai
FIN
SINON
{sunChampCommentaire,indChamp}..Visible = Faux
FIN
SINON
{sunChampCommentaire,indChamp}..Visible = Faux
FIN |
Partager