Home » Community » Newbie corner » Problem in example code (Tried SplitterFrame yet minor problem.)
Re: Problem in example code [message #45951 is a reply to message #45950] |
Sat, 30 January 2016 17:09   |
|
vegaonline wrote on Sat, 30 January 2016 16:37Probably you are right that dynamic_cast is not working. EditFields have dedicated names. Here "if (dynamic_cast<EditField *> (q)) { " is not true.
The dynamic_cast actually works correctly in the test application I attached in my previous post. Are you calling this function on the correct Ctrl? GetFirstChild iterates over Ctrls added directly to the one you are calling the function on. You can try to add DUMP(typeid(*q).name()) before the dynamic_cast condition to see the types over which you actually iterate to make sure it is really those that you want to save. Note that it will log mangled names, but they should still be readable, e.g. "N3Upp10EditMinMaxIiNS_10ConvertIntEEE" stands for Upp::EditMinMax<ConvertInt> which is just typedefed EditInt.
If you still speak about the application using ParentCtrls to switch layouts, I guess you just iterate over the ParentCtrl. You'll have to either a) call it on the actual layout (i.e. something like "for (Ctrl* q = doPlt->GetFirstChild(); ...") or b) iterate recursively over the controls to save all the Ctrls even when they lower layers of the hierarchy tree).
Honza
|
|
|
Goto Forum:
Current Time: Sun May 04 22:28:37 CEST 2025
Total time taken to generate the page: 0.02001 seconds
|