Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » How to Setup ArrayCtrl colors ?
Re: How to Setup ArrayCtrl colors ? [message #18589 is a reply to message #18588] |
Fri, 10 October 2008 16:15 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
You can set the display for individual cells in an ArrayCtrl with
void SetDisplay(int i, int col, const Display& d);
then you just have to iterate through the columns to set each cell on a row.
And an easier way of getting colored displays:
template <const int COLOR>
class ColorDisplayTemplate : public Display
{
virtual void Paint(Draw& w, const Rect& r, const Value& q,
Color ink, Color paper, dword style) const
{ StdDisplay().Paint(w, r, q, ink, Color::FromRaw(COLOR), style); }
};
const Display &RedDisplay() { return Single< ColorDisplayTemplate<RGB(255, 0, 0)> >(); }
const Display &BlueDisplay() { return Single< ColorDisplayTemplate<RGB(0, 0, 255)> >(); }
const Display &GreenDisplay() { return Single< ColorDisplayTemplate<RGB(0, 255, 0)> >(); }
A template? Is not it a bit brutal?
What about a nice little Color attribute (and perhaps global variables instead of Single)?
Mirek
[Updated on: Sat, 11 October 2008 00:10] by Moderator Report message to a moderator
|
|
|
|
|
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:16:35 CEST 2024
Total time taken to generate the page: 0.02785 seconds
|