Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » How to Setup ArrayCtrl colors ?
Re: How to Setup ArrayCtrl colors ? [message #18811 is a reply to message #16874] |
Thu, 23 October 2008 19:56 |
darki699
Messages: 3 Registered: October 2008 Location: Hell
|
Junior Member |
|
|
sergeynikitin wrote on Fri, 18 July 2008 19:20 | How to Setup ArrayCtrl colors?
I need to setup ArrayCtrl color and current line color.
|
This is pretty simple if you are willing to change ArrayCtrl just a bit...
Step 1: In ArrayCtrl.h add this:
void SetRowDisplay(int i, const Display& d);
void SetColDisplay(int j, const Display& d);
Step 2: In ArrayCtrl.cpp add this:
void ArrayCtrl::SetRowDisplay(int i, const Display& d)
{
if(i >= 0 && i < GetCount())
for (int j = 0 ; j < GetSize().cx ; j++)
cellinfo.At(i).At(j).Set(d);
RefreshRow(i);
}
void ArrayCtrl::SetColDisplay(int j, const Display& d)
{
if (j >= 0 && j < column.GetCount())
column[j].SetDisplay(d);
}
Step 3: In your program add this:
struct MyJDisplay : Display {
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
{
PaintBackground(w, r, q, Blend(ink, Color(0,0,0)) , Blend(paper, Color(0,0,0)), style);
w.DrawText(r.left, r.top, q.ToString());
}
};
For example... You can choose any color of course, but I really suggest you use Blend unless you want your Selected row to not-show.
and that's about it... Add your SetRowDisplay or SetColDisplay any way you like it. =)
If you want a nice look use this
Quote: |
[your ArrayCtrl].AddColumn(column, column, columnSize).Margin(0)
|
when you add your column.
And an example of how I used it:
UserMovies.SetRowDisplay(j , Single<MyJDisplay>());
NJoy and remember that the code is not a god.
If you need to improve it, don't be afraid to add (backup everything first lol)
Darki699
[Updated on: Thu, 23 October 2008 19:57] 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 10:51:45 CEST 2024
Total time taken to generate the page: 0.02874 seconds
|