Home » Community » Newbie corner » Problem in example code (Tried SplitterFrame yet minor problem.)
Re: Problem in example code [message #45946 is a reply to message #45944] |
Sat, 30 January 2016 09:33 |
|
Hi,
I'm still not sure it is really good idea to this dynamically, but here is a working method: void StoreToJson() {
Json json;
for (Ctrl *q = GetFirstChild(); q; q=q->GetNext()) {
if (dynamic_cast<EditField *> (q)) {
String id = q->GetLayoutId();
if (id.GetCount())
json(id, ~*q);
}
}
SelectFileOut out("*.*");
if (out.IsOpen())
out << json << "\n";
}
It is actually almost the same as the code you posted. Full code is in the attached archive. Just click anywhere in the window to trigger the save as dialog. I'm not sure why it didn't work for you. Only thing I can think of is that you didn't assign names to the editfields in the layout.
Honza
|
|
|
Goto Forum:
Current Time: Fri Nov 01 00:42:23 CET 2024
Total time taken to generate the page: 0.03473 seconds
|