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 » U++ Widgets - General questions or Mixed problems » Background color of StaticText or EditString
Re: Background color of StaticText or EditString [message #54807 is a reply to message #54806] Thu, 17 September 2020 14:40 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
Hello aquilarubra,


Quote:
Using layouts, I seem unable to add a widget (StaticRect) from code.

Even a button doesn't show up, whether I put it into the constructor or a click event:
Button button;
*this << button.SetLabel("Button").LeftPosZ(10, 64).TopPosZ(10, 24);

I suspect the layout hides everything under itself. Any way to do that?



1) StaticRect is not predefined in Layout manager. You have to add it as a "User class" (it is in the context menu).
Just set the CtrlType to StaticRect.

2) Order is important. StaticRect should come first, then StaticText on the ctrl list in the layout editor.

I have attached an example. It sets a backround rectangle and overlays a static text over it.

Best regards,
Oblivion

  • Attachment: TestApp.zip
    (Size: 1.46KB, Downloaded 144 times)


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Changing mouse icon with MouseEvent
Next Topic: Add Button crashes program on start
Goto Forum:
  


Current Time: Fri Apr 26 09:45:38 CEST 2024

Total time taken to generate the page: 0.05248 seconds