Using wxFB, I select Tools > Generate Inherited Class. The dialog has fields to specify the inherited class name, but they're grayed out.
So, the default file name is using the project name and top frame name, which isn't the end of the world, but it would be nice to explicitly set the name. Is there somewhere else the inherited class name can be specified?
Windows 10, wxWidgets 3.0, wxFB 3.6.1
wxFormBuilder - how to specify Inherited Class name?
-
- Experienced Solver
- Posts: 58
- Joined: Mon Jul 03, 2017 12:03 am
-
- Experienced Solver
- Posts: 58
- Joined: Mon Jul 03, 2017 12:03 am
Re: wxFormBuilder - how to specify Inherited Class name?
Oops! Wrong pic.
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxFormBuilder - how to specify Inherited Class name?
if you select the form name in the listbox, the options for the class name and file name will ungray and you can enter whatever you want:
-
- Experienced Solver
- Posts: 58
- Joined: Mon Jul 03, 2017 12:03 am
Re: wxFormBuilder - how to specify Inherited Class name?
Thanks for the thoughts. I had selected the checkbox for my form in the list, but as you can see in my screengrab, the fields for entering the inherited class name are grayed out. I tried clicking on them to enter a class name, but the field's disabled. Is there something else I need to do?
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxFormBuilder - how to specify Inherited Class name?
You need to actually select the item in the checklist box. When the item is selected it will have a blue background like in the screenshot I posted.
When the item has a white background with a dotted border, like in your screenshot, the item is not actually selected.
When the item has a white background with a dotted border, like in your screenshot, the item is not actually selected.
-
- Experienced Solver
- Posts: 58
- Joined: Mon Jul 03, 2017 12:03 am
Re: wxFormBuilder - how to specify Inherited Class name?
Oooohhh... Thanks!
Related question - I did a few fests with modifying the generated code of the inherited class and wxFB seemed to do a good job of preserving my changes while generating new code. (For clarity, I'm referring to code in the inherited class, not the base class, which I'm not touching.)
I read a few posts that people use the "generate inherited class" once and then edit manually from then on. Makes sense, though if it's safe, it would be nice to continue using the Generate Inherited Class tool.
My question is, are there caveats around using this tool? E.g., I did a quick test and see that if I change an event name, the tool generate the new name and moves the old name c/w changes to the end of the cpp file, which is greate b/c now I can just move the changes into the new name. Regardless, I I'd back up changed inherited code before regenerating, but am interested to here about whether there are issues or concerns using this really cool, powerful tool.
Related question - I did a few fests with modifying the generated code of the inherited class and wxFB seemed to do a good job of preserving my changes while generating new code. (For clarity, I'm referring to code in the inherited class, not the base class, which I'm not touching.)
I read a few posts that people use the "generate inherited class" once and then edit manually from then on. Makes sense, though if it's safe, it would be nice to continue using the Generate Inherited Class tool.
My question is, are there caveats around using this tool? E.g., I did a quick test and see that if I change an event name, the tool generate the new name and moves the old name c/w changes to the end of the cpp file, which is greate b/c now I can just move the changes into the new name. Regardless, I I'd back up changed inherited code before regenerating, but am interested to here about whether there are issues or concerns using this really cool, powerful tool.
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: wxFormBuilder - how to specify Inherited Class name?
The code for generating inherited classes is very rudimentary and should definitely only be used once. If you try to use it a second time, it can easily lose or mangle the existing code.