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 » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl and AttrText
Re: GridCtrl and AttrText [message #9058 is a reply to message #9052] Sun, 15 April 2007 21:56 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
unodgs wrote on Sun, 15 April 2007 19:57


It does not work yet. I will add it in the next snapshot. In the meantime make your own GridDisplay and check in it if passed value type is AttrText.


Sorry, but I've not understood your recipe.
Quote:

If yes pass furhter (to GridDisplay::Paint() color of ink and paper.


I used the following code to color the cell of a column and it works
class ColoredStatus : public GridDisplay
{ public:
    void Paint(Draw &w, int x, int y, int cx, int cy, const Value &val, dword style,
				           Color &fg, Color &bg, Font &fnt, bool found, int fs, int fe);
	
};

void ColoredStatus::Paint(Draw &w, int x, int y, int cx, int cy, const Value &val, dword style,
				           Color &fg, Color &bg, Font &fnt, bool found, int fs, int fe)
{
    if( StrInt(AsString(val)) >= 2451 )	bg = Color(0, 255, 0);	
    GridDisplay::Paint(w, x, y, cx, cy, val, style, fg, bg, fnt, found, fs, fe);
} 

But now I would like to apply it to others columns, each with its own color. So I would pass to the previous class a parameter and then by a switch select the right color.
But how to do it? Single seems to refuse a parameter.
Otherwise I need to declare 4 similar classes one for each column... or maybe wait until AttrText is operative Smile

Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GridCtrl and mingw compiler error
Next Topic: SqlArray: mouse selection
Goto Forum:
  


Current Time: Sat May 11 15:42:30 CEST 2024

Total time taken to generate the page: 0.03013 seconds