You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the derived_class, and derived_params properties to generate a base class for my main frame window that inherits from something other than wxFrame (such as wxDocParentFrame). Specifiying derived_class works, the new base class name is used. Unfortunately, the generated base class won't compile.
The derived_params property seems to be broken. Nothing I enter here gets added to the generated code anywhere. For instance, I set the property to wxDocManager* manager, so that the Create() signature will be compatible with the base class, but this doesn't result in any new parameters being inserted anywhere in the ctor/Create() or anywhere else. It seems this setting is completely ignored during code generation. In fact, adding text here and then trying to generate code tells me that "All classes are up to date".
derived_params not being used is kind of a show-stopper, because it means I have to hand-edit the base class every time it's regenerated to fix up the Create parameters.
The text was updated successfully, but these errors were encountered:
Unlike controls, forms have two different ways to handle derived classes. The most common is to create your class and derive it from the generated class which in turn derives from the wxWidgets form (e.g., wxFrame). This has the advantage that you can create your own constructor with whatever parameters you want and override the base Create function with your own Create function. E.g., given you creating MyFrame from a generated MyFrameBase, you can create MyFrame::Create(foo, parent, id, bar) and call MyFrameBase::Create(parent, id) from it.
The second way is to specify the derived class and initial parameters. In this case you have no control over the constructor, and you can only insert parameters before the official set. You create an instance of the generated class instead of your own class, and then call the generated class's Create function with the parameters you want rather than calling your own Create function.
My question is, what is the scenario where it is better to use the second way for forms? You have to do that for controls, but I'm having trouble thinking of a scenario where it is better to generate a class that derives from your class rather than creating your class which derives from the generated class.
I realize I can't remove the second method, since importing from wxFormBuiilder, CodeBlocks, and others require it, but it certainly strikes me as an odd way to create a derived class since you are so much more limited in what you can do (no option for additional construction arguments, fixed placement of additional parameters for Create()).
Hi,
I'm trying to use the
derived_class
, andderived_params
properties to generate a base class for my main frame window that inherits from something other thanwxFrame
(such aswxDocParentFrame
). Specifiyingderived_class
works, the new base class name is used. Unfortunately, the generated base class won't compile.The
derived_params
property seems to be broken. Nothing I enter here gets added to the generated code anywhere. For instance, I set the property towxDocManager* manager,
so that the Create() signature will be compatible with the base class, but this doesn't result in any new parameters being inserted anywhere in the ctor/Create() or anywhere else. It seems this setting is completely ignored during code generation. In fact, adding text here and then trying to generate code tells me that "All classes are up to date".derived_params
not being used is kind of a show-stopper, because it means I have to hand-edit the base class every time it's regenerated to fix up the Create parameters.The text was updated successfully, but these errors were encountered: