wxSmith change autogenerated constructor?

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
ValeV

wxSmith change autogenerated constructor?

Post by ValeV »

Hi,

is it possible to change wxSmith's autogenerated code?

For instance, when I add new wxPanel, wxSmith puts

Code: Select all

Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY"));
into panel's constructor. Is it possible for me to change what arguments are in Create()?

If I change it in the code, for example, to

Code: Select all

Create(parent)
wxSmith will change it back the next time I build the project.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxSmith change autogenerated constructor?

Post by ONEEYEMAN »

Hi,
You can manually create a descendant class and do whatever you want.
Or don't change the project
Or create you GUI manually.

Thank you.
ValeV

Re: wxSmith change autogenerated constructor?

Post by ValeV »

ONEEYEMAN wrote: Thu Jan 28, 2021 4:24 pm Hi,
You can manually create a descendant class and do whatever you want.
Or don't change the project
Or create you GUI manually.

Thank you.
Thank you for your answer.

What is the difference between first and third option? Isn't creating GUI manually same as writing wxWidgets code, in my descendant class?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxSmith change autogenerated constructor?

Post by ONEEYEMAN »

Hi,
With the first option you create a class that will contain business logic leaving the auto-generated file alone.

Something like this:

Code: Select all

class Auto-generated: public wxFrame 
{
》;

class Logic : public Auto-generated
《》;
The third option - you create the layout yourself.

Thank you.
Post Reply