Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » How to Setup ArrayCtrl colors ?
Re: How to Setup ArrayCtrl colors ? [message #18581 is a reply to message #18579] |
Fri, 10 October 2008 13:23 |
TeCNoYoTTa
Messages: 138 Registered: July 2008 Location: Egypt
|
Experienced Member |
|
|
Oblivion wrote on Fri, 10 October 2008 12:41 |
Quote: |
i want to set a color and then add a row with this color then change it and add another row with another color ......how can i do that ?
|
You can use Display structure and SetDisplay() method to set column colors and content:
First you should add a Display object. For example:
struct Column1Display : Display {
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
{
w.DrawRect(r, Color(500,0,0));
}
};
struct Column2Display : Display {
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
{
w.DrawRect(r, Color(0,500,0));
}
};
Then, Set the Display of the column, using ArrayCtrl::Column::SetDisplay() or Array::SetDisplay() in your constructor or wherever you instantiate your ArrayCtrl object:
MyApp::MyApp()
{
//.....
//.....
MyArray.AddColumn("Column 1").SetDisplay(Single<Column1Display>());
MyArray.AddColumn("Column 2").SetDisplay(Single<Column2Display>());
}
This will set the "column 1" and "column 2" colors. You can set other columns' displays as such. As you may have noticed, by using the Display structure you can also do other specific operations on a single column (eg, adding images, changing background, fonts, etc.). Display also has a virtual PaintBackground() method which you can set background seperately See Display structure for more information.
Regards.
|
thanxxxxxxxxx alot ......but i think that you are talking about columns colors ......but i want to color rows background not columns
thx again
|
|
|
|
|
How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: Oblivion on Fri, 10 October 2008 12:41
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: Oblivion on Fri, 10 October 2008 14:23
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: Oblivion on Fri, 10 October 2008 14:56
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: unodgs on Fri, 10 October 2008 14:59
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: mrjt on Fri, 10 October 2008 16:15
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: Oblivion on Fri, 10 October 2008 21:29
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: mirek on Mon, 20 October 2008 07:42
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: mrjt on Tue, 21 October 2008 14:27
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: mirek on Tue, 21 October 2008 19:00
|
|
|
Re: How to Setup ArrayCtrl colors ?
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: mrjt on Mon, 13 October 2008 12:44
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: whiteman on Wed, 10 February 2010 17:36
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: mirek on Tue, 16 February 2010 20:53
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: darki699 on Thu, 23 October 2008 19:56
|
|
|
Re: How to Setup ArrayCtrl colors ?
By: mirek on Sat, 01 November 2008 23:37
|
Goto Forum:
Current Time: Mon Apr 29 16:26:05 CEST 2024
Total time taken to generate the page: 0.01944 seconds
|