Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mrjt is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MenuItem Chameleon bug report & question
Next Topic: OS X Aqua look and feel?
Goto Forum:
  


Current Time: Tue May 07 20:01:49 CEST 2024

Total time taken to generate the page: 0.01664 seconds