wxFormBuilder - how to specify Inherited Class name?

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
buttonsrtoys
Experienced Solver
Experienced Solver
Posts: 58
Joined: Mon Jul 03, 2017 12:03 am

wxFormBuilder - how to specify Inherited Class name?

Post by buttonsrtoys »

Using wxFB, I select Tools > Generate Inherited Class. The dialog has fields to specify the inherited class name, but they're grayed out.
CaptureWxFB.JPG
CaptureWxFB.JPG (23.55 KiB) Viewed 2808 times
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
buttonsrtoys
Experienced Solver
Experienced Solver
Posts: 58
Joined: Mon Jul 03, 2017 12:03 am

Re: wxFormBuilder - how to specify Inherited Class name?

Post by buttonsrtoys »

Oops! Wrong pic.
CaptureWxFormBuilder.JPG
CaptureWxFormBuilder.JPG (41.79 KiB) Viewed 2801 times
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: wxFormBuilder - how to specify Inherited Class name?

Post by New Pagodi »

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:
aftercheck.png
aftercheck.png (14.39 KiB) Viewed 2801 times
buttonsrtoys
Experienced Solver
Experienced Solver
Posts: 58
Joined: Mon Jul 03, 2017 12:03 am

Re: wxFormBuilder - how to specify Inherited Class name?

Post by buttonsrtoys »

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?
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: wxFormBuilder - how to specify Inherited Class name?

Post by New Pagodi »

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.
buttonsrtoys
Experienced Solver
Experienced Solver
Posts: 58
Joined: Mon Jul 03, 2017 12:03 am

Re: wxFormBuilder - how to specify Inherited Class name?

Post by buttonsrtoys »

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.
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: wxFormBuilder - how to specify Inherited Class name?

Post by New Pagodi »

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.
Post Reply