Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl: how to set label for embedded controls?
Re: ArrayCtrl: how to set label for embedded controls? [message #13916 is a reply to message #13915] |
Fri, 01 February 2008 17:42   |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Well, there is the obvious way 
arrayCtrl.AddColumn();
arrayCtrl.AddColumn().Ctrls<Option>();
arrayCtrl.Add("Option 1", true);
arrayCtrl.Add("Option 2", true);
arrayCtrl.Add("Option 3", false);
But if you want ot make things difficult for yourself:
// Members
ArrayCtrl array;
Array<Option> options;
...
array.AddColumn("Options");
array.Add(true);
array.Add(true);
array.Add(false);
array.SetCtrl(0, 0, options.Create<Option>().SetLabel("Option 1"), true);
array.SetCtrl(1, 0, options.Create<Option>().SetLabel("Option 2"), true);
array.SetCtrl(2, 0, options.Create<Option>().SetLabel("Option 3"), true);
I believe there are also others (you could use a factory for instance).
[Updated on: Fri, 01 February 2008 17:44] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Jun 25 05:22:53 CEST 2025
Total time taken to generate the page: 0.03992 seconds
|