U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » EditField-Style - paper - just black!
EditField-Style - paper - just black! [message #34422] Mon, 21 November 2011 13:39 Go to next message
Wolfgang is currently offline  Wolfgang
Messages: 146
Registered: November 2011
Location: Germany
Experienced Member
Hi there,

I'm trying to change the background color of a EditField but no matter what the background of the field is just black.
LAYOUT(testLayout, 376, 140)
	ITEM(EditField, ef, LeftPosZ(24, 64).TopPosZ(12, 19))
END_LAYOUT
test::test()
{
	CtrlLayout(*this, "Window title");
	EditField::Style sd = ef.StyleDefault();
	sd.paper = White();
        sd.text = Red();
	ef.SetStyle(sd);
	ef.Refresh();
}


The text color is red but the background isn't it. Whats my fault?
Re: EditField-Style - paper - just black! [message #34424 is a reply to message #34422] Mon, 21 November 2011 15:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Wolfgang wrote on Mon, 21 November 2011 07:39

Hi there,

I'm trying to change the background color of a EditField but no matter what the background of the field is just black.
LAYOUT(testLayout, 376, 140)
	ITEM(EditField, ef, LeftPosZ(24, 64).TopPosZ(12, 19))
END_LAYOUT
test::test()
{
	CtrlLayout(*this, "Window title");
	EditField::Style sd = ef.StyleDefault();
	sd.paper = White();
        sd.text = Red();
	ef.SetStyle(sd);
	ef.Refresh();
}


The text color is red but the background isn't it. Whats my fault?


Overriding style has to be static or global. Try

LAYOUT(testLayout, 376, 140)
	ITEM(EditField, ef, LeftPosZ(24, 64).TopPosZ(12, 19))
END_LAYOUT
test::test()
{
	CtrlLayout(*this, "Window title");
	static EditField::Style sd = ef.StyleDefault();
	sd.paper = White();
        sd.text = Red();
	ef.SetStyle(sd);
}

[Updated on: Mon, 21 November 2011 15:43]

Report message to a moderator

Re: EditField-Style - paper - just black! [message #34425 is a reply to message #34424] Mon, 21 November 2011 16:01 Go to previous message
Wolfgang is currently offline  Wolfgang
Messages: 146
Registered: November 2011
Location: Germany
Experienced Member
Now it works, thank you very much!

[Updated on: Mon, 21 November 2011 16:03]

Report message to a moderator

Previous Topic: ChildMouseEvent problems
Next Topic: How do you make the widgets resizable?
Goto Forum:
  


Current Time: Fri Sep 18 08:11:08 GMT+2 2026

Total time taken to generate the page: 0.01141 seconds