No. You have it inverted. MainFrm will call the parent constructor and create a wxFrame. As a result the parameters that are passed to MainFrm are used to create the wxFrame.
For example:
Code: Select all
HelperFrame::HelperFrame(wxFrame *frame, const wxString& title)
: wxFrame(frame, -1, title)
{
};
This will give the exact same outcome as using the create function after the function is called.
Code: Select all
HelperFrame::HelperFrame(wxFrame *frame, const wxString& title)
{
wxFrame::Create(frame, -1, title);
}
These BOTH create a frame. Even the first one without a body statement creates a frame because it calls the parent constructor.
It does produce the same thing but they are not the same. One inherits the parents constructor and calls it. When you declare your function / constructor inside the header, you can place the inheritance there as well. The other calls the wxFrame creation function. Even if both of these functions are the exact same, it's also been proven through advanced benchmarking that inheritance like this is faster than calling outside functions inside the blocks.
If you want to know more or have a better explanation, please consult
HERE