[a supprimer] PS la couleur de fond de mon texte ne s'affiche pas

59cortex59 Messages postés 11 Date d'inscription lundi 31 mars 2008 Statut Membre Dernière intervention 15 janvier 2009 - 31 mars 2008 à 11:17
NHenry Messages postés 15112 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 13 avril 2024 - 31 mars 2008 à 17:03
bonjour,

je voudrais afficher du texte qui change de couleur sur un fond rouge.
Le texte s'affiche et change de couleur, mais la couleur de fond ne s'affiche pas!!
j'aurai besoin d'une aide svp
merci

voici mon code :

/******************************************************************************
* Textback Class
******************************************************************************/
Textback.prototype = new DynamicComponent();
Textback.parent = DynamicComponent.prototype;
Textback.prototype.constructor = Textback;

/******************************************************************************
* Constructor
******************************************************************************/
function Textback()
{
}

/******************************************************************************
* Initialize object
* svgId -> Id of SVG node
* objectName -> global variable name of the object
******************************************************************************/
Textback.prototype.init = function(svgId, objectName)
{
Textback.parent.init.call(this, svgId, objectName, false);
this.m_SizeFont = GetVisioPropAsInt(this.m_SvgNode, "FontSize");

removeAllChildExceptNodeName(this.m_SvgNode, "text");
this.m_txtParentElem = getChildNodeFromName(this.m_SvgNode, "text");
removeAllChild(this.m_txtParentElem);
this.m_txtElem = createTextNode(this.m_txtParentElem, "");
}

/******************************************************************************
* Callback for refresh event
******************************************************************************/
Textback.prototype.OnRefresh = function()
{
// Get the value
var value = this.m_arrayValueDefinition[0].getValue();


var coltext = colortext;
var red = Math.round((coltext & 0x000000FF) >> 0);
var green = Math.round((coltext & 0x0000FF00) >> 8);
var blue = Math.round((coltext & 0x00FF0000) >> 16);
var fill = "fill:rgb("+ red +","+ green+","+blue+")";

var size = "font-size:"+this.m_SizeFont;
var fontType = "font-family:Arial Unicode MS"
this.m_txtParentElem.setAttribute("style", fill+";"+size+";"+fontType);

this.m_txtParentElem.setAttribute("backcolor", "red");

// Change text value to reflect the read value
var st = value;
this.m_txtElem.nodeValue = st;
}

1 réponse

NHenry Messages postés 15112 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 13 avril 2024 159
31 mars 2008 à 17:03
Bonjour

Quel rapport avec CS ?

Postes plutot sur le site le plus adapté, je pense que c'est du Javascript, tu peux donc aller voir du coté de www.javascriptfr.com

Nous captons le cockpit coupable qui a capoté
VB (6, .NET1&2), C++, C#.Net1
Mon site
0
Rejoignez-nous