I have a problem when I want to inherit from my custom panel. wxSmith add automatically this Create function:
Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id"));
But my constructor is:
myNewPanel::myNewPanel(wxWindow* parent, wxWindowID id): myPanel(parent, id)
so I need each time to comment the bad Create line.
Is it possible to add an option to prevent this line from being added automatically, such as the "Lay-out the window" option?
And another point, is it possible to add another option for the "Lay-out the window" option to have the choice beetwen SetSizeHints(this) and Fit(this) ?
Not exactly, in my case it's about inherited classes.
For example, we have a first class that inherits from wxPanel: wxMyPanel. Then a second class that inherits from wxMyPanel with different parameters. For this second class, we don't want to use the Create function but inheritance directly in the constructor.
This is also possible with first class. For example:
Header:
class wxMyPanel: public wxPanel
{
public:
wxMyPanel(wxWindow* parent, wxWindowID id);
virtual ~wxMyPanel();
protected:
// Other declarations
};
Code:
wxMyPanel::wxMyPanel(wxWindow* parent, wxWindowID id)
{
//(*Initialize(wxMyPanel)
Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id"));
// Other declarations
}
Or directly:
wxMyPanel::wxMyPanel(wxWindow* parent, wxWindowID id): wxPanel(parent, id)
{
//(*Initialize(wxMyPanel)
// Other declarations
}