Project

General

Profile

WLineEdit styling

Added by Sébastien D. almost 13 years ago

Hello,

we want to change the background color of a WLineEdit according to the validity of the data in it.

The problem we have is that it's working fine in chrome, but not in Internet explorer (nothing happens).

What we do is something along those lines:

WLineEdit* widget= new WLineEdit();

widget->keyWentUp().connect(boost::bind(&MyClass::MyMethod, this, true));

...

WRegExpValidator* regex = new WRegExpValidator(someRegex);

regex->setInvalidNoMatchText(toolTip);

widget->setValidator(regex);

and then in MyClass::MyMethod:

if( widget->validate() != WValidator::Valid )

{

widget->decorationStyle().setBackgroundColor( WColor( "#F79A9A" ) );

}

btw wt version is 3.2.0

note that we also tried widget->decorationStyle().setCursor(PointingHandCursor); and it is working on ie.


Replies (4)

RE: WLineEdit styling - Added by Sébastien D. almost 13 years ago

I must add, before 3.2.0, the color change was automatic, but it stopped working with 3.2.0 too ...

RE: WLineEdit styling - Added by Стойчо Стефанов Stoycho Stefanov almost 13 years ago

Hi Sebastian,

it seems to me, you're facing the same problem as I already did, but in different context. Look here [[[http://redmine.webtoolkit.eu/boards/2/topics/3302#message-3323]]] - Koen said: "you are using an old version of Wt's resource files".

You could try to update your resources until you are waiting for answer form a developer.

regards

Stoycho

RE: WLineEdit styling - Added by Sébastien D. almost 13 years ago

Indeed I forgot to copy the ressources, I did it, and now it works just fine!

Thanks a lot

RE: WLineEdit styling - Added by Стойчо Стефанов Stoycho Stefanov almost 13 years ago

You're welcome, Sébastien (now it's correct :-))!

    (1-4/4)