Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Klugier is currently offline  Klugier
Messages: 1076
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:
index.php?t=getfile&id=4126&private=0

After:
index.php?t=getfile&id=4127&private=0

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 713 times)
  • Attachment: after.png
    (Size: 3.64KB, Downloaded 928 times)


U++ - one framework to rule them all.

[Updated on: Mon, 01 April 2013 17:25]

Report message to a moderator

 
Read Message
Read Message
Previous Topic: BUG: LineEdit "Drag And Drop" violates read-only state
Next Topic: Wrap EditString Rect to text
Goto Forum:
  


Current Time: Fri Apr 26 11:41:31 CEST 2024

Total time taken to generate the page: 0.06082 seconds