Home » U++ Library support » Look and Chameleon Technology » Styles and Widgets
Re: Styles and Widgets [message #9126 is a reply to message #9121] |
Wed, 18 April 2007 12:24 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
It sounds to me like you could do this using something as simple as:
Vector<Value> GetAllData(Ctrl *parent) throw (ValidationException)
{
Vector<Value> data;
for (Ctrl *c = parent->GetFirstChild(); c; c->GetNext()) {
if (c->GetFirstChild())
data.Append(GetAllData(c));
else {
Value v = c->GetData();
if (v.IsError())
throw ValidationException(c);
else if (!v.IsVoid) // Prevents empty values
data.Add(v);
}
}
return data;
}
I just typed that in so no guarantees it will actually work (and the use of exceptions is slightly dubious) but I think the principle is correct. AFAIK only input ctrls ever return non-empty Values from GetData(). See TopWindow::Serialize() for another example (though not heirarchical).
[Updated on: Wed, 18 April 2007 12:28] Report message to a moderator
|
|
|
|
|
Styles and Widgets
By: WebChaot on Wed, 14 March 2007 12:15
|
|
|
Re: Styles and Widgets
By: mirek on Wed, 14 March 2007 14:54
|
|
|
Re: Styles and Widgets
By: WebChaot on Wed, 18 April 2007 11:24
|
|
|
Re: Styles and Widgets
By: mirek on Wed, 18 April 2007 12:02
|
|
|
Re: Styles and Widgets
By: mrjt on Wed, 18 April 2007 12:24
|
|
|
Re: Styles and Widgets
By: WebChaot on Thu, 15 March 2007 09:14
|
|
|
Re: Styles and Widgets
By: mirek on Thu, 15 March 2007 12:11
|
|
|
Re: Styles and Widgets
By: WebChaot on Thu, 15 March 2007 12:39
|
|
|
Re: Styles and Widgets
By: mirek on Thu, 15 March 2007 14:59
|
|
|
Re: Styles and Widgets
By: WebChaot on Wed, 18 April 2007 12:08
|
Goto Forum:
Current Time: Tue May 07 20:01:49 CEST 2024
Total time taken to generate the page: 0.01664 seconds
|