Hello!
I recently started coding a wxWidgets app with Code::BLocks and wxSmith.
The problem is:
any change to wxSmith rewrites the constructor, which code i try to change (inserting my function call).
Is there a way to keep my changes to the code?
[SOLVED] How can i safely add my own code to the one generated by wxSmith?
[SOLVED] How can i safely add my own code to the one generated by wxSmith?
Last edited by IanPo on Wed Jun 12, 2019 6:53 pm, edited 1 time in total.
Re: How can i safely add my own code to the one generated by wxSmith?
Hi,
You could try to derive your own class from the one generated for you...
Thank you.
You could try to derive your own class from the one generated for you...
Thank you.
Re: How can i safely add my own code to the one generated by wxSmith?
I don't use wxSmith, but when i look at the source it generates, i would guess you can add your own code outside the code parts that are enclosed by these comments:
Code: Select all
//(*Initialize(testFrame)
wxMenuItem* MenuItem2;
wxMenuItem* MenuItem1;
wxMenu* Menu1;
wxMenuBar* MenuBar1;
wxMenu* Menu2;
// parts omitted
//*)
Try addding your own code here.
Use the source, Luke!
Re: How can i safely add my own code to the one generated by wxSmith?
doublemax, thanks!
I added FillStrings1(); in the end, it remains.
I added FillStrings1(); in the end, it remains.
Code: Select all
Connect(ID_TEXTCTRL3,wxEVT_COMMAND_TEXT_ENTER,(wxObjectEventFunction)&wxtestFrame::OnDigLenEnter);
Connect(ID_TEXTCTRL4,wxEVT_COMMAND_TEXT_ENTER,(wxObjectEventFunction)&wxtestFrame::OnPreTrigLenEnter);
Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxtestFrame::OnQuit);
Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxtestFrame::OnAbout);
//*)
FillStrings1();
}