Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl cell color
Re: ArrayCtrl cell color [message #3812 is a reply to message #3808] |
Wed, 28 June 2006 00:49 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
hojtsy wrote on Tue, 27 June 2006 22:06 |
forlano wrote on Tue, 27 June 2006 14:13 |
1) This line is very important:
array.AddColumn("value").SetDisplay(Single<NumbersOnRed>());
Now, SetDisplay is the method with arguments:
SetDisplay(int i¸ int j¸ const Display& d)
Instead I see "Single<NumbersOnRed>()" that does the job... but HOW? What is it?
|
A different SetDisplay is called there. This one:
ArrayCtrl::Column& ArrayCtrl::Column::SetDisplay(const Display& d);
The reason for that is that AddColumn does not return a reference to the array, but to the newly added column. You are setting the Display object for the newly added column, and not the whole array.
So this trick is not done by the Single template method. What it does instead is that it returns a reference to an internally stored "singleton" instance of a given type. Search for "singleton pattern" on google for more info about singletons.
|
Thank you for your answer.
I googled "Singleton pattern" and at the end I decided that it is better to use the code without to understand . The topic seems for advanced C++ users while I've started a few monthes ago.
I am a simple user that need widgets that can dialog among them easily and that their properties can be set the same easily. After few monthes U++ thought me to think in the easier, lazier and non verbose way to reach the goal. For this reason sometimes I feel unconfortable and a bit angry, , when some operation need to be done in a too elegant, powerfull and smart way but that I do not understand.
In our case, for example, I would instinctively think about some method like array.SetBgColor(int i, int j) or array.SetPaper(int i, int j) to set the background color of a cell.
Of course I do not know all the environment and my point of view is simply faulty. Nevertheless I am sure that such a direct methods one day not to far will appear .
Luigi
[Updated on: Wed, 28 June 2006 00:51] Report message to a moderator
|
|
|
|
|
ArrayCtrl cell color
By: hojtsy on Wed, 01 February 2006 16:29
|
|
|
Re: ArrayCtrl cell color
By: mirek on Wed, 01 February 2006 17:59
|
|
|
Re: ArrayCtrl cell color
By: hojtsy on Thu, 02 February 2006 16:51
|
|
|
Re: ArrayCtrl cell color
By: mirek on Thu, 02 February 2006 20:43
|
|
|
Re: ArrayCtrl cell color
By: hojtsy on Thu, 02 February 2006 21:46
|
|
|
Re: ArrayCtrl cell color
By: mirek on Thu, 02 February 2006 22:10
|
|
|
Re: ArrayCtrl cell color
By: hojtsy on Thu, 02 February 2006 22:46
|
|
|
Re: ArrayCtrl cell color
By: mirek on Thu, 02 February 2006 23:11
|
|
|
Re: ArrayCtrl cell color
By: hojtsy on Fri, 03 February 2006 00:06
|
|
|
Re: ArrayCtrl cell color
By: mirek on Fri, 03 February 2006 14:29
|
|
|
Re: ArrayCtrl cell color
By: hojtsy on Fri, 03 February 2006 15:28
|
|
|
Re: ArrayCtrl cell color
By: mirek on Fri, 03 February 2006 16:38
|
|
|
Re: ArrayCtrl cell color
By: hojtsy on Fri, 03 February 2006 16:48
|
|
|
Re: ArrayCtrl cell color
By: mirek on Fri, 03 February 2006 17:56
|
|
|
Re: ArrayCtrl cell color
By: fudadmin on Mon, 06 February 2006 06:20
|
|
|
Re: ArrayCtrl cell color
By: hojtsy on Tue, 07 February 2006 13:43
|
|
|
Re: ArrayCtrl cell color
By: forlano on Tue, 27 June 2006 20:13
|
|
|
Re: ArrayCtrl cell color
By: hojtsy on Tue, 27 June 2006 22:06
|
|
|
Re: ArrayCtrl cell color
By: forlano on Wed, 28 June 2006 00:49
|
|
|
Re: ArrayCtrl cell color
|
|
|
Re: ArrayCtrl cell color
By: mirek on Wed, 28 June 2006 14:13
|
|
|
Re: ArrayCtrl cell color
By: forlano on Wed, 28 June 2006 16:26
|
|
|
Re: ArrayCtrl cell color
|
|
|
Re: ArrayCtrl cell color
By: mirek on Sun, 19 February 2006 23:48
|
Goto Forum:
Current Time: Tue May 14 14:24:39 CEST 2024
Total time taken to generate the page: 0.02185 seconds
|