You can look how wxSmith does it in the wxSmith->Add wxDialog menu.
Great Tried that before but gave up as nobody seemed to had any refernces to
wxNewWindowDlg. But now I found that its
OnCreate() handler does have the logic
cbProject* cProject = m_pProject->GetCBProject(); // seems to get the project to add files to
Then there is a larger Params structure set up used to create the target classes as a
wxsFrameRes, a
wxsDialogRes or
wxPanelRes These classes are then added. In my case I would not do that because that must be parsed from the cloned source files.
Next the files seem to be added to the project. Not sure where the Targets come from - maybe its an interactive call.. Not sure if thats already writing it to the project file, but a "File/SaveAll" should to that manually.
wxArrayInt vnTargets; // I guess build targets
Manager::Get()->GetProjectManager()->AddFileToProject( strHeaderFilename, cProject, vnTargets );
Manager::Get()->GetProjectManager()->AddFileToProject( strCppFilename, cProject, vnTargets );
Manager::Get()->GetProjectManager()->AddFileToProject( strWxrFilename, cProject, vnTargets );
Manager::Get()->GetProjectManager()->GetUi()->RebuildTree();
Then there is this section where I am not sure where that saves to. I an not sure I need that. At least the files were not written there. There are quire a few comments in the ConfigManager header but they do not tell what its supposed to do.
// save configuration
ConfigManager* Cfg = Manager::Get()->GetConfigManager( "wxsmith" );
Cfg->Werite( "/newresource/useinitfunc", m_InitFunc->GetValue() );
...
I guess the part to re-parse the files needs to be found elsewhere. but restarting the project should do that as well.
So that should be enough for some mindless trial and error
. Thanks a lot.