Home » U++ Library support » LineEdit, EditFields, DocEdit » Should EditField::Paint respect IsEditable method???
Should EditField::Paint respect IsEditable method??? [message #39578] |
Mon, 01 April 2013 00:44 |
|
Klugier
Messages: 1075 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I have noticed that EditField::Paint dosen't use textdisabled style variable after I called method SetEditable(false) on my EditField. Personally, I think it should be default behavior for this widget. Of course, I can be wrong and this behavior is intentional.
I have written simply patch (CtrlLib/EditField.cpp - line 289):
void EditField::Paint(Draw& w)
{
Size sz = GetSize();
bool enabled = IsShowEnabled();
Color paper = enabled && !IsReadOnly() ? (HasFocus() ? style->focus : style->paper) : style->disabled;
if(nobg)
paper = Null;
Color ink = enabled && !IsReadOnly() ? style->text : style->textdisabled; // <- This line
...
}
I have enclosed demonstrative images.
Befor:
After:
P.S
I have found the easy solution. I need to call other method on EditField insted of SetEditable. It is SetEnable method. At the end, I would like to enclose sample code:
editField.SetEnable(false);
It works exactly as I want.
Sincerely,
Klugier
-
Attachment: befor.png
(Size: 3.60KB, Downloaded 707 times)
-
Attachment: after.png
(Size: 3.64KB, Downloaded 922 times)
U++ - one framework to rule them all.
[Updated on: Mon, 01 April 2013 17:25] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri Mar 29 12:58:00 CET 2024
Total time taken to generate the page: 0.01853 seconds
|