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 » How to change color background of a cell?
How to change color background of a cell? [message #20274] Fri, 06 March 2009 14:27 Go to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
It's me again.. Smile I don't found a way to change bg color..
thanks to all!
Re: How to change color background of a cell? [message #20313 is a reply to message #20274] Mon, 09 March 2009 10:54 Go to previous messageGo to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
I have do the change of color, but I don't understand perfectly this solution.

I copied some code, the code is :



class RedBackGround : public Display
{
public:
	void Paint(Draw& w, const Rect& r, const Value& value,
             Color ink, Color paper, dword s) const
  	{
   		Display::Paint(w, r, value, ink, LtRed(), s);
  	}
};


class GreenBackGround : public Display
{
public:
	void Paint(Draw& w, const Rect& r, const Value& value,
             Color ink, Color paper, dword s) const
  	{
   		Display::Paint(w, r, value, ink, LtGreen(), s);
  	}
};



and when i want to change color, after a double left click:

arrctr_Grid.Set(int_GridPos, Col_Active ,(WString)"N");
arrctr_Grid.SetDisplay(int_GridPos, Col_Active, Single<GreenBackGround>());


is not possible do a thing like "arrctr_Grid.GetDisplay(row, col).ChangeColor(Green);
?

thanks
Re: How to change color background of a cell? [message #20314 is a reply to message #20313] Mon, 09 March 2009 11:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Because Display is very generic solution... It allows you to embed any kind of value and display it correctly.

Anyway, you might be interested in AttrText too - that is a special Value that is interpreted by standard (default) Display.

Mirek
Re: How to change color background of a cell? [message #20427 is a reply to message #20274] Wed, 18 March 2009 10:42 Go to previous messageGo to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
Someone could explain me what exactly "Single<>" do?
And where I can found information about it?
thanks!

Sam

[Updated on: Wed, 18 March 2009 10:43]

Report message to a moderator

Re: How to change color background of a cell? [message #20437 is a reply to message #20427] Wed, 18 March 2009 17:13 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
darthspawn wrote on Wed, 18 March 2009 10:42

Someone could explain me what exactly "Single<>" do?
And where I can found information about it?
thanks!

Sam


http://www.ultimatepp.org/forum/index.php?t=msg&&th= 234&goto=3805#msg_3805

Luigi
Previous Topic: RightClick on HeaderCtrl
Next Topic: How to set fontsize in GridCtrl
Goto Forum:
  


Current Time: Mon Apr 29 00:16:37 CEST 2024

Total time taken to generate the page: 0.03619 seconds