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.
buttonsrtoys
Knows some wx things
Knows some wx things
Posts: 42
Joined: Mon Jul 03, 2017 12:03 am

wxFormBuilder - how to specify Inherited Class name?

Postby buttonsrtoys » Fri Feb 09, 2018 9:45 pm

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 470 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
Knows some wx things
Knows some wx things
Posts: 42
Joined: Mon Jul 03, 2017 12:03 am

Re: wxFormBuilder - how to specify Inherited Class name?

Postby buttonsrtoys » Fri Feb 09, 2018 10:02 pm

Oops! Wrong pic.
CaptureWxFormBuilder.JPG
CaptureWxFormBuilder.JPG (41.79 KiB) Viewed 463 times

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 252
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: wxFormBuilder - how to specify Inherited Class name?

Postby New Pagodi » Fri Feb 09, 2018 10:09 pm

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 463 times

buttonsrtoys
Knows some wx things
Knows some wx things
Posts: 42
Joined: Mon Jul 03, 2017 12:03 am

Re: wxFormBuilder - how to specify Inherited Class name?

Postby buttonsrtoys » Sun Feb 11, 2018 1:56 am

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: 252
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: wxFormBuilder - how to specify Inherited Class name?

Postby New Pagodi » Sun Feb 11, 2018 3:35 am

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
Knows some wx things
Knows some wx things
Posts: 42
Joined: Mon Jul 03, 2017 12:03 am

Re: wxFormBuilder - how to specify Inherited Class name?

Postby buttonsrtoys » Sun Feb 11, 2018 12:17 pm

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: 252
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: wxFormBuilder - how to specify Inherited Class name?

Postby New Pagodi » Sun Feb 11, 2018 5:57 pm

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.


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 3 guests