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 » Label/StaticText
Re: Label/StaticText [message #3878 is a reply to message #3877] Wed, 05 July 2006 17:22 Go to previous messageGo to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Hi Arni,

I am not sure, wether i am right or not nor wether it is the best way to do it.

I would derive a class from Label and reimplement the Paint Method of StaticText
void StaticText::Paint(Draw& w)
{
 Size sz = GetSize();
 if(!IsTransparent())
  w.DrawRect(0,0,sz.cx,sz.cy,SColorFace);    
 PaintLabel(w,0,0,sz.cx,sz.cy,!IsShowEnabled(),false,false,VisibleAccessKeys()); 
}


to
void StaticText::Paint(Draw& w)
{
 Size sz = GetSize();
 if(!IsTransparent())   
  w.DrawRect(0,0,sz.cx,sz.cy,BackgroundColor);
 PaintLabel(w,0,0,sz.cx,sz.cy,!IsShowEnabled(),false,false,VisibleAccessKeys()); 
}

and add "Color BackgroundColor" and the get/set-Method to your derived Class

to get it blinking create a Callback-Function, that changes your Backgroundcolor and let it be called each n ms by setting up a TimeCallback with Ctrl::SetTimeCallback(int delay_ms, Callback cb, int id)

hope that helps and isnt too bad,
Bas
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: OpenGL, SDL
Next Topic: Mapping button to CALLBACK
Goto Forum:
  


Current Time: Sun Apr 27 15:57:14 CEST 2025

Total time taken to generate the page: 0.00771 seconds