1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Generate sample VC++ project files
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "makeproj.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
19 #if defined(__BORLANDC__)
24 #include "wx/resource.h"
30 #include "projgenrc.h"
32 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
35 // the application icon
36 #if defined(__WXGTK__) || defined(__WXMOTIF__)
37 #include "mondrian.xpm"
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 // Define a new application type, each program should derive a class from wxApp
45 class MyApp
: public wxApp
48 // override base class virtuals
49 // ----------------------------
51 // this one is called on application startup and is a good place for the app
52 // initialization (doing it here and not in the ctor allows to have an error
53 // return: if OnInit() returns false, the application terminates)
54 virtual bool OnInit();
56 bool GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
57 const wxString
& path
, const wxStringList
& sourceFiles
);
58 void GenerateSamples(const wxString
& dir
); // Takes wxWindows directory path
61 // Define a new frame type: this is going to be our main frame
62 class MyFrame
: public wxFrame
66 MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
68 // event handlers (these functions should _not_ be virtual)
69 void OnQuit(wxCommandEvent
& event
);
70 void OnAbout(wxCommandEvent
& event
);
71 void OnGenerate(wxCommandEvent
& event
);
73 bool GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
74 const wxString
& path
, const wxStringList
& sourceFiles
);
77 // any class wishing to process wxWindows events must use this macro
81 // Define a dialog: this will be our main dialog
82 class MyDialog
: public wxDialog
86 MyDialog(const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
);
88 // event handlers (these functions should _not_ be virtual)
89 void OnQuit(wxCommandEvent
& event
);
90 void OnAbout(wxCommandEvent
& event
);
91 void OnGenerate(wxCommandEvent
& event
);
92 void OnGenerateSamples(wxCommandEvent
& event
);
95 // any class wishing to process wxWindows events must use this macro
100 // ----------------------------------------------------------------------------
102 // ----------------------------------------------------------------------------
104 // IDs for the controls and the menu commands
108 MakeProject_Quit
= 1,
110 MakeProject_Generate
,
111 MakeProject_GenerateSamples
,
113 // controls start here (the numbers are, of course, arbitrary)
114 MakeProject_Text
= 1000,
117 // ----------------------------------------------------------------------------
118 // event tables and other macros for wxWindows
119 // ----------------------------------------------------------------------------
121 // the event tables connect the wxWindows events with the functions (event
122 // handlers) which process them. It can be also done at run-time, but for the
123 // simple menu events like this the static method is much simpler.
124 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
125 EVT_MENU(MakeProject_Quit
, MyFrame::OnQuit
)
126 EVT_MENU(MakeProject_About
, MyFrame::OnAbout
)
127 EVT_MENU(MakeProject_Generate
, MyFrame::OnGenerate
)
130 // Create a new application object: this macro will allow wxWindows to create
131 // the application object during program execution (it's better than using a
132 // static object for many reasons) and also declares the accessor function
133 // wxGetApp() which will return the reference of the right type (i.e. MyApp and
137 // ============================================================================
139 // ============================================================================
141 // ----------------------------------------------------------------------------
142 // the application class
143 // ----------------------------------------------------------------------------
145 // 'Main program' equivalent: the program execution "starts" here
149 // Create the main application window
150 MyFrame
*frame
= new MyFrame("MakeProject wxWindows App",
151 wxPoint(50, 50), wxSize(450, 340));
156 wxResourceParseFile("projgenrc.wxr");
158 MyDialog
* dialog
= new MyDialog("VC++ MakeProject");
164 bool MyApp::GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
165 const wxString
& path
, const wxStringList
& sourceFiles
)
170 project
.SetIncludeDirs(wxStringList("../../include", 0));
171 project
.SetResourceIncludeDirs(wxStringList("../../include", 0));
172 project
.SetLibDirs(wxStringList("../../lib", 0));
173 project
.SetDebugLibDirs(wxStringList("../../src/Debug", 0));
174 project
.SetReleaseLibDirs(wxStringList("../../src/Release", 0));
176 project
.SetProjectName(projectName
);
177 project
.SetTargetName(targetName
);
178 project
.SetProjectPath(path
);
179 project
.SetSourceFiles(sourceFiles
);
181 if (!project
.GenerateVCProject())
183 wxString
msg("Could not generate ");
192 void MyApp::GenerateSamples(const wxString
& dir
)
194 // Small bug. Because we don't distinguish between Debug/DebugDLL, Release/ReleaseDLL,
195 // we can't yet make a sample that uses other wxWindows static libraries + the wxWindows DLL library.
197 GenerateSample("BombsVC", "bombs", dir
+ wxString("/samples/bombs"),
198 wxStringList("bombs.cpp", "bombs1.cpp", "game.cpp", "bombs.h", "game.h", 0));
199 GenerateSample("CaretVC", "caret", dir
+ wxString("/samples/caret"), wxStringList("caret.cpp", 0));
200 GenerateSample("CheckLstVC", "checklst", dir
+ wxString("/samples/checklst"), wxStringList("checklst.cpp", 0));
201 GenerateSample("ConfigVC", "conftest", dir
+ wxString("/samples/config"), wxStringList("conftest.cpp", 0));
202 GenerateSample("ControlsVC", "controls", dir
+ wxString("/samples/controls"), wxStringList("controls.cpp", 0));
203 GenerateSample("DbVC", "dbtest", dir
+ wxString("/samples/db"),
204 wxStringList("dbtest.cpp", "listdb.cpp", "dbtest.h", "listdb.h", 0));
205 GenerateSample("DialogsVC", "dialogs", dir
+ wxString("/samples/dialogs"),
206 wxStringList("dialogs.cpp", "dialogs.h", 0));
207 GenerateSample("DndVC", "dnd", dir
+ wxString("/samples/dnd"), wxStringList("dnd.cpp", 0));
208 GenerateSample("DocViewVC", "docview", dir
+ wxString("/samples/docview"),
209 wxStringList("docview.cpp", "doc.cpp", "view.cpp", "docview.h", "doc.h", "view.h", 0));
210 GenerateSample("DocVwMDIVC", "docview", dir
+ wxString("/samples/docvwmdi"),
211 wxStringList("docview.cpp", "doc.cpp", "view.cpp", "docview.h", "doc.h", "view.h", 0));
212 GenerateSample("DynamicVC", "dynamic", dir
+ wxString("/samples/dynamic"), wxStringList("dynamic.cpp", 0));
213 GenerateSample("FortyVC", "forty", dir
+ wxString("/samples/forty"),
214 wxStringList("forty.cpp", "canvas.cpp", "card.cpp", "game.cpp", "pile.cpp", "playerdg.cpp", "scoredg.cpp", "scorefil.cpp",
215 "canvas.h", "forty.h", "card.h", "game.h", "pile.h", "playerdg.h", "scoredg.h", "scorefil.h",
217 GenerateSample("FractalVC", "fractal", dir
+ wxString("/samples/fractal"), wxStringList("fractal.cpp", 0));
218 GenerateSample("GridVC", "test", dir
+ wxString("/samples/grid"), wxStringList("test.cpp", 0));
219 GenerateSample("NewGridVC", "griddemo", dir
+ wxString("/samples/newgrid"), wxStringList("griddemo.cpp", 0));
220 GenerateSample("HelpVC", "demo", dir
+ wxString("/samples/help"), wxStringList("demo.cpp", 0));
223 GenerateSample("AboutVC", "about", dir
+ wxString("/samples/html/about"), wxStringList("about.cpp", 0));
224 GenerateSample("HelpVC", "help", dir
+ wxString("/samples/html/help"), wxStringList("help.cpp", 0));
225 GenerateSample("PrintingVC", "printing", dir
+ wxString("/samples/html/printing"), wxStringList("printing.cpp", 0));
226 GenerateSample("TestVC", "test", dir
+ wxString("/samples/html/test"), wxStringList("test.cpp", 0));
227 GenerateSample("VirtualVC", "virtual", dir
+ wxString("/samples/html/virtual"), wxStringList("virtual.cpp", 0));
228 GenerateSample("WidgetVC", "widget", dir
+ wxString("/samples/html/widget"), wxStringList("widget.cpp", 0));
229 GenerateSample("ZipVC", "zip", dir
+ wxString("/samples/html/zip"), wxStringList("zip.cpp", 0));
231 GenerateSample("ImageVC", "image", dir
+ wxString("/samples/image"), wxStringList("image.cpp", 0));
232 GenerateSample("InternatVC", "internat", dir
+ wxString("/samples/internat"), wxStringList("internat.cpp", 0));
233 GenerateSample("JoytestVC", "joytest", dir
+ wxString("/samples/joytest"), wxStringList("joytest.cpp", "joytest.h", 0));
234 GenerateSample("LayoutVC", "layout", dir
+ wxString("/samples/layout"), wxStringList("layout.cpp", "layout.h", 0));
235 GenerateSample("ListctrlVC", "listtest", dir
+ wxString("/samples/listctrl"), wxStringList("listtest.cpp", "listtest.h", 0));
236 GenerateSample("MdiVC", "mdi", dir
+ wxString("/samples/mdi"), wxStringList("mdi.cpp", "mdi.h", 0));
237 GenerateSample("MemcheckVC", "memcheck", dir
+ wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0));
238 // Note: MFC sample will be different.
239 GenerateSample("MfcVC", "mfc", dir
+ wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0));
240 GenerateSample("MiniframVC", "test", dir
+ wxString("/samples/minifram"), wxStringList("test.cpp", "test.h", 0));
241 GenerateSample("MinimalVC", "minimal", dir
+ wxString("/samples/minimal"), wxStringList("minimal.cpp", 0));
242 GenerateSample("NativdlgVC", "nativdlg", dir
+ wxString("/samples/nativdlg"), wxStringList("nativdlg.cpp", "nativdlg.h", "resource.h", 0));
243 GenerateSample("NettestVC", "nettest", dir
+ wxString("/samples/nettest"), wxStringList("nettest.cpp", 0));
244 GenerateSample("NotebookVC", "test", dir
+ wxString("/samples/notebook"), wxStringList("test.cpp", "test.h", 0));
245 GenerateSample("OleautoVC", "oleauto", dir
+ wxString("/samples/oleauto"), wxStringList("oleauto.cpp", 0));
246 GenerateSample("OwnerdrwVC", "ownerdrw", dir
+ wxString("/samples/ownerdrw"), wxStringList("ownerdrw.cpp", 0));
247 GenerateSample("PngVC", "pngdemo", dir
+ wxString("/samples/png"), wxStringList("pngdemo.cpp", "pngdemo.h", 0));
248 GenerateSample("PrintingVC", "printing", dir
+ wxString("/samples/printing"), wxStringList("printing.cpp", "printing.h", 0));
249 GenerateSample("ProplistVC", "test", dir
+ wxString("/samples/proplist"), wxStringList("test.cpp", "test.h", 0));
250 GenerateSample("RegtestVC", "regtest", dir
+ wxString("/samples/regtest"), wxStringList("regtest.cpp", 0));
251 GenerateSample("ResourceVC", "resource", dir
+ wxString("/samples/resource"), wxStringList("resource.cpp", "resource.h", 0));
252 GenerateSample("RichEditVC", "wxLayout", dir
+ wxString("/samples/richedit"), wxStringList("wxLayout.cpp",
253 "kbList.cpp", "wxllist.cpp", "wxlparser.cpp", "wxlwindow.cpp", 0));
254 GenerateSample("SashtestVC", "sashtest", dir
+ wxString("/samples/sashtest"), wxStringList("sashtest.cpp", "sashtest.h", 0));
255 GenerateSample("ScrollVC", "scroll", dir
+ wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
256 GenerateSample("SplitterVC", "test", dir
+ wxString("/samples/splitter"), wxStringList("test.cpp", 0));
257 GenerateSample("TabVC", "test", dir
+ wxString("/samples/tab"), wxStringList("test.cpp", "test.h", 0));
258 GenerateSample("TaskbarVC", "tbtest", dir
+ wxString("/samples/taskbar"), wxStringList("tbtest.cpp", "tbtest.h", 0));
259 GenerateSample("TextVC", "text", dir
+ wxString("/samples/text"), wxStringList("text.cpp", 0));
260 GenerateSample("ThreadVC", "test", dir
+ wxString("/samples/thread"), wxStringList("test.cpp", 0));
261 GenerateSample("ToolbarVC", "test", dir
+ wxString("/samples/toolbar"), wxStringList("test.cpp", "test.h", 0));
262 GenerateSample("TreectrlVC", "treetest", dir
+ wxString("/samples/treectrl"), wxStringList("treetest.cpp", "treetest.h", 0));
263 GenerateSample("TypetestVC", "typetest", dir
+ wxString("/samples/typetest"), wxStringList("typetest.cpp", "typetest.h", 0));
264 GenerateSample("ValidateVC", "validate", dir
+ wxString("/samples/validate"), wxStringList("validate.cpp", "validate.h", 0));
265 GenerateSample("ClientVC", "client", dir
+ wxString("/samples/wxsocket"), wxStringList("client.cpp", 0));
266 GenerateSample("ServerVC", "server", dir
+ wxString("/samples/wxsocket"), wxStringList("server.cpp", 0));
267 GenerateSample("PoemVC", "wxpoem", dir
+ wxString("/samples/wxpoem"), wxStringList("wxpoem.cpp", "wxpoem.h", 0));
268 GenerateSample("ClientVC", "client", dir
+ wxString("/samples/dde"), wxStringList("client.cpp", "client.h", "ddesetup.h", 0));
269 GenerateSample("ServerVC", "server", dir
+ wxString("/samples/dde"), wxStringList("server.cpp", "server.h", "ddesetup.h", 0));
270 GenerateSample("CaretVC", "caret", dir
+ wxString("/samples/caret"), wxStringList("caret.cpp", 0));
271 GenerateSample("DrawingVC", "drawing", dir
+ wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
272 GenerateSample("ScrollVC", "scroll", dir
+ wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
279 project
.SetIncludeDirs(wxStringList("../../../include", 0));
280 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
281 project
.SetLibDirs(wxStringList("../../../lib", 0));
282 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", 0));
283 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", 0));
285 project
.SetProjectName("DialogEdVC");
286 project
.SetTargetName("dialoged");
287 project
.SetProjectPath(dir
+ wxString("/utils/dialoged/src"));
288 project
.SetSourceFiles(wxStringList("dialoged.cpp", "dlghndlr.cpp", "edlist.cpp", "edtree.cpp",
289 "reseditr.cpp", "reswrite.cpp", "symbtabl.cpp", "winstyle.cpp", "winprop.cpp",
290 "dialoged.h", "dlghndlr.h", "edlist.h", "edtree.h", "reseditr.h", "symbtabl.h", "winprop.h",
294 if (!project
.GenerateVCProject())
296 wxString
msg("Could not generate Dialog Editor project");
301 project
.SetIncludeDirs(wxStringList("../../../include", 0));
302 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
303 project
.SetLibDirs(wxStringList("../../../lib", 0));
304 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", 0));
305 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", 0));
307 project
.SetProjectName("Tex2RTFVC");
308 project
.SetTargetName("tex2rtf");
309 project
.SetProjectPath(dir
+ wxString("/utils/tex2rtf/src"));
310 project
.SetSourceFiles(wxStringList("tex2rtf.cpp", "htmlutil.cpp", "readshg.cpp", "rtfutils.cpp",
311 "table.cpp", "tex2any.cpp", "texutils.cpp", "xlputils.cpp",
312 "bmputils.h", "readshg.h", "rtfutils.h", "table.h", "tex2any.h", "tex2rtf.h", "wxhlpblk.h",
315 if (!project
.GenerateVCProject())
317 wxString
msg("Could not generate Tex2RTF project");
322 project
.SetIncludeDirs(wxStringList("../../../include", 0));
323 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
324 project
.SetLibDirs(wxStringList("../../../lib", 0));
325 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", 0));
326 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", 0));
328 project
.SetProjectName("HelpGenVC");
329 project
.SetTargetName("helpgen");
330 project
.SetProjectPath(dir
+ wxString("/utils/helpgen/src"));
331 project
.SetSourceFiles(wxStringList("helpgen.cpp", "cjparser.cpp", "docripper.cpp", "ifcontext.cpp",
332 "markup.cpp", "ripper_main.cpp", "scriptbinder.cpp", "sourcepainter.cpp",
334 "cjparser.h", "docripper.h", "ifcontext.h", "markup.h", "scriptbinder.h", "sourcepainter.h",
335 "srcparser.h", "wxstlac.h", "wxstllst.h", "wxstlvec.h", 0));
337 if (!project
.GenerateVCProject())
339 wxString
msg("Could not generate HelpGen project");
343 // wxTreeLayout sample
345 project
.SetIncludeDirs(wxStringList("../../../include", 0));
346 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
347 project
.SetLibDirs(wxStringList("../../../lib", 0));
348 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", 0));
349 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", 0));
351 project
.SetProjectName("TreeSampleVC");
352 project
.SetTargetName("test");
353 project
.SetProjectPath(dir
+ wxString("/utils/wxtree/src"));
354 project
.SetSourceFiles(wxStringList("test.cpp", "wxtree.cpp", "test.h", "wxtree.h", 0));
356 if (!project
.GenerateVCProject())
358 wxString
msg("Could not generate wxTreeLayout project");
364 project
.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0));
365 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
366 project
.SetLibDirs(wxStringList("../../../../lib", 0));
367 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", 0));
368 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", 0));
369 project
.SetExtraLibs(wxStringList("ogl.lib", 0));
371 project
.SetProjectName("OGLEditVC");
372 project
.SetTargetName("ogledit");
373 project
.SetProjectPath(dir
+ wxString("/utils/ogl/samples/ogledit"));
374 project
.SetSourceFiles(wxStringList("ogledit.cpp", "doc.cpp", "palette.cpp", "view.cpp",
375 "doc.h", "ogledit.h", "palette.h", "view.h",
378 if (!project
.GenerateVCProject())
380 wxString
msg("Could not generate OGLEdit project");
386 project
.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0));
387 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
388 project
.SetLibDirs(wxStringList("../../../../lib", 0));
389 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", 0));
390 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", 0));
391 project
.SetExtraLibs(wxStringList("ogl.lib", 0));
393 project
.SetProjectName("StudioVC");
394 project
.SetTargetName("studio");
395 project
.SetProjectPath(dir
+ wxString("/utils/ogl/samples/studio"));
396 project
.SetSourceFiles(wxStringList("studio.cpp", "cspalette.cpp", "dialogs.cpp", "view.cpp",
397 "doc.cpp", "mainfrm.cpp", "project.cpp", "shapes.cpp", "symbols.cpp", "csprint.cpp",
398 "studio.h", "cspalette.h", "dialogs.h", "view.h",
399 "doc.h", "mainfrm.h", "project.h", "shapes.h", "symbols.h",
402 if (!project
.GenerateVCProject())
404 wxString
msg("Could not generate OGL Studio project");
408 // GLCanvas cube sample
410 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
411 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
412 project
.SetLibDirs(wxStringList("../../../../lib", 0));
413 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0));
414 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0));
415 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
417 project
.SetProjectName("CubeVC");
418 project
.SetTargetName("cube");
419 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/cube"));
420 project
.SetSourceFiles(wxStringList("cube.cpp", "cube.h",
423 if (!project
.GenerateVCProject())
425 wxString
msg("Could not generate GLCanvas Cube project");
429 // GLCanvas isosurf sample
431 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
432 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
433 project
.SetLibDirs(wxStringList("../../../../lib", 0));
434 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0));
435 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0));
436 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
438 project
.SetProjectName("IsoSurfVC");
439 project
.SetTargetName("isosurf");
440 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/isosurf"));
441 project
.SetSourceFiles(wxStringList("isosurf.cpp", "isosurf.h",
444 if (!project
.GenerateVCProject())
446 wxString
msg("Could not generate GLCanvas IsoSurf project");
450 // GLCanvas penguin sample
452 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
453 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
454 project
.SetLibDirs(wxStringList("../../../../lib", 0));
455 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0));
456 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0));
457 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
459 project
.SetProjectName("PenguinVC");
460 project
.SetTargetName("penguin");
461 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/penguin"));
462 project
.SetSourceFiles(wxStringList("penguin.cpp", "penguin.h",
464 "trackball.c", "trackball.h",
467 if (!project
.GenerateVCProject())
469 wxString
msg("Could not generate GLCanvas Penguin project");
474 // ----------------------------------------------------------------------------
476 // ----------------------------------------------------------------------------
479 MyFrame::MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
)
480 : wxFrame((wxFrame
*)NULL
, -1, title
, pos
, size
)
482 // set the frame icon
483 SetIcon(wxICON(mondrian
));
486 wxMenu
*menuFile
= new wxMenu
;
488 menuFile
->Append(MakeProject_Generate
, "&Generate");
489 menuFile
->Append(MakeProject_About
, "&About...");
490 menuFile
->AppendSeparator();
491 menuFile
->Append(MakeProject_Quit
, "E&xit");
493 // now append the freshly created menu to the menu bar...
494 wxMenuBar
*menuBar
= new wxMenuBar
;
495 menuBar
->Append(menuFile
, "&File");
497 // ... and attach this menu bar to the frame
500 // create a status bar just for fun (by default with 1 pane only)
502 SetStatusText("Welcome to wxWindows!");
508 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
))
510 // TRUE is to force the frame to close
514 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
))
516 wxMessageBox("MakeProject: generates VC++ project files",
517 "About MakeProject", wxOK
| wxICON_INFORMATION
, this);
520 void MyFrame::OnGenerate(wxCommandEvent
& WXUNUSED(event
))
522 wxGetApp().GenerateSamples("d:/wx2/wxWindows");
525 bool MyFrame::GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
526 const wxString
& path
, const wxStringList
& sourceFiles
)
528 return wxGetApp().GenerateSample(projectName
, targetName
, path
, sourceFiles
);
535 wxProject::wxProject()
539 wxProject::~wxProject()
544 bool wxProject::GenerateVCProject()
546 wxString fullProjectName
= m_path
+ wxString("/") + m_projectName
+ ".dsp";
548 ofstream
stream(fullProjectName
);
552 /////////////////////// General stuff
554 stream
<< "# Microsoft Developer Studio Project File - Name=\"" << m_projectName
<< "\" - Package Owner=<4>\n";
555 stream
<< "# Microsoft Developer Studio Generated Build File, Format Version 5.00\n";
556 stream
<< "# (Actually, generated by MakeProject, (c) Julian Smart, 1998)\n";
557 stream
<< "# ** DO NOT EDIT **\n\n";
558 stream
<< "# TARGTYPE \"Win32 (x86) Application\" 0x0101\n\n";
559 stream
<< "CFG=" << m_projectName
<< " - Win32 Debug\n";
560 stream
<< "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n";
561 stream
<< "!MESSAGE use the Export Makefile command and run\n";
562 stream
<< "!MESSAGE\n";
563 stream
<< "!MESSAGE NMAKE /f \"" << m_projectName
<< ".mak\".\n";
564 stream
<< "!MESSAGE\n";
565 stream
<< "!MESSAGE You can specify a configuration when running NMAKE\n";
566 stream
<< "!MESSAGE by defining the macro CFG on the command line. For example:\n";
567 stream
<< "!MESSAGE\n";
568 stream
<< "!MESSAGE NMAKE /f \"" << m_projectName
<< ".mak\" CFG=\"" << m_projectName
<< " - Win32 Debug\"\n";
569 stream
<< "!MESSAGE\n";
570 stream
<< "!MESSAGE Possible choices for configuration are:\n";
571 stream
<< "!MESSAGE\n";
572 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Release\" (based on \"Win32 (x86) Application\")\n";
573 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Debug\" (based on \"Win32 (x86) Application\")\n";
574 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Debug DLL\" (based on \"Win32 (x86) Application\")\n";
575 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Release DLL\" (based on \"Win32 (x86) Application\")\n";
576 stream
<< "!MESSAGE\n";
578 stream
<< "# Begin Project\n";
579 stream
<< "# PROP Scc_ProjName \"\"\n";
580 stream
<< "# PROP Scc_LocalPath \"\"\n";
581 stream
<< "CPP=cl.exe\n";
582 stream
<< "MTL=midl.exe\n";
583 stream
<< "RSC=rc.exe\n";
586 /////////////////////// Win32 Release target
588 stream
<< "!IF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release\"\n";
590 stream
<< "# PROP BASE Use_MFC 0\n";
591 stream
<< "# PROP BASE Use_Debug_Libraries 0\n";
592 stream
<< "# PROP BASE Output_Dir \"Release\"\n";
593 stream
<< "# PROP BASE Intermediate_Dir \"Release\"\n";
594 stream
<< "# PROP BASE Target_Dir \"\"\n";
595 stream
<< "# PROP Use_MFC 0\n";
596 stream
<< "# PROP Use_Debug_Libraries 0\n";
597 stream
<< "# PROP Output_Dir \"Release\"\n";
598 stream
<< "# PROP Intermediate_Dir \"Release\"\n";
599 stream
<< "# PROP Ignore_Export_Lib 0\n";
600 stream
<< "# PROP Target_Dir \"\"\n";
601 stream
<< "# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
602 stream
<< "# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2";
604 int n
= m_includeDirs
.Number();
606 for (i
= 0; i
< n
; i
++)
608 wxString includeDir
= m_includeDirs
[i
];
609 stream
<< " /I \"" << includeDir
<< "\"";
612 stream
<< " /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /FD /c\n";
613 stream
<< "# SUBTRACT CPP /YX\n";
614 stream
<< "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
615 stream
<< "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
616 stream
<< "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\n";
617 stream
<< "# ADD RSC /l 0x809 /d \"NDEBUG\"\n";
618 stream
<< "BSC32=bscmake.exe\n";
619 stream
<< "# ADD BASE BSC32 /nologo\n";
620 stream
<< "# ADD BSC32 /nologo\n";
621 stream
<< "LINK32=link.exe\n";
622 stream
<< "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386\n";
623 stream
<< "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wxvc.lib ";
624 n
= m_extraLibs
.Number();
625 for (i
= 0; i
< n
; i
++)
627 wxString lib
= m_extraLibs
[i
];
628 stream
<< lib
<< " ";
631 stream
<< "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib\" /nodefaultlib:\"libci.lib\" /out:\"Release/" << m_targetName
<< ".exe\"";
633 n
= m_releaseLibDirs
.Number();
634 for (i
= 0; i
< n
; i
++)
636 wxString libDir
= m_releaseLibDirs
[i
];
637 stream
<< " /libpath:\"" << libDir
<< "\"";
639 n
= m_libDirs
.Number();
640 for (i
= 0; i
< n
; i
++)
642 wxString libDir
= m_libDirs
[i
];
643 stream
<< " /libpath:\"" << libDir
<< "\"";
648 /////////////////////// Win32 Debug target
650 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug\"\n";
652 stream
<< "# PROP BASE Use_MFC 0\n";
653 stream
<< "# PROP BASE Use_Debug_Libraries 1\n";
654 stream
<< "# PROP BASE Output_Dir \"Debug\"\n";
655 stream
<< "# PROP BASE Intermediate_Dir \"Debug\"\n";
656 stream
<< "# PROP BASE Target_Dir \"\"\n";
657 stream
<< "# PROP Use_MFC 0\n";
658 stream
<< "# PROP Use_Debug_Libraries 1\n";
659 stream
<< "# PROP Output_Dir \"Debug\"\n";
660 stream
<< "# PROP Intermediate_Dir \"Debug\"\n";
661 stream
<< "# PROP Ignore_Export_Lib 0\n";
662 stream
<< "# PROP Target_Dir \"\"\n";
663 stream
<< "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
664 stream
<< "# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od";
666 n
= m_includeDirs
.Number();
667 for (i
= 0; i
< n
; i
++)
669 wxString includeDir
= m_includeDirs
[i
];
670 stream
<< " /I \"" << includeDir
<< "\"";
673 stream
<< " /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D DEBUG=1 /D \"__WXDEBUG__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /Yu\"wx/wxprec.h\" /FD /c\n";
674 stream
<< "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
675 stream
<< "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
676 stream
<< "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\n";
677 stream
<< "# ADD RSC /l 0x809 /d \"_DEBUG\"\n";
678 stream
<< "BSC32=bscmake.exe\n";
679 stream
<< "# ADD BASE BSC32 /nologo\n";
680 stream
<< "# ADD BSC32 /nologo\n";
681 stream
<< "LINK32=link.exe\n";
682 stream
<< "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
683 stream
<< "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wxvc.lib ";
684 n
= m_extraLibs
.Number();
685 for (i
= 0; i
< n
; i
++)
687 wxString lib
= m_extraLibs
[i
];
688 stream
<< lib
<< " ";
690 stream
<< "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib,libcid.lib,msvcrt.lib\" /out:\"Debug/" << m_targetName
<< ".exe\" /pdbtype:sept";
692 n
= m_debugLibDirs
.Number();
693 for (i
= 0; i
< n
; i
++)
695 wxString libDir
= m_debugLibDirs
[i
];
696 stream
<< " /libpath:\"" << libDir
<< "\"";
698 n
= m_libDirs
.Number();
699 for (i
= 0; i
< n
; i
++)
701 wxString libDir
= m_libDirs
[i
];
702 stream
<< " /libpath:\"" << libDir
<< "\"";
706 // stream << "!ENDIF\n";
709 /////////////////////// Win32 Debug DLL target
711 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
713 stream
<< "# PROP BASE Use_MFC 0\n";
714 stream
<< "# PROP BASE Use_Debug_Libraries 1\n";
715 stream
<< "# PROP BASE Output_Dir \"DebugDLL\"\n";
716 stream
<< "# PROP BASE Intermediate_Dir \"DebugDLL\"\n";
717 stream
<< "# PROP BASE Target_Dir \"\"\n";
718 stream
<< "# PROP Use_MFC 0\n";
719 stream
<< "# PROP Use_Debug_Libraries 1\n";
720 stream
<< "# PROP Output_Dir \"DebugDLL\"\n";
721 stream
<< "# PROP Intermediate_Dir \"DebugDLL\"\n";
722 stream
<< "# PROP Ignore_Export_Lib 0\n";
723 stream
<< "# PROP Target_Dir \"\"\n";
724 stream
<< "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
725 stream
<< "# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od";
727 n
= m_includeDirs
.Number();
728 for (i
= 0; i
< n
; i
++)
730 wxString includeDir
= m_includeDirs
[i
];
731 stream
<< " /I \"" << includeDir
<< "\"";
734 stream
<< " /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D DEBUG=1 /D \"__WXDEBUG__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /D WXUSINGDLL=1 /Yu\"wx/wxprec.h\" /FD /c\n";
735 stream
<< "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
736 stream
<< "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
737 stream
<< "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\n";
738 stream
<< "# ADD RSC /l 0x809 /d \"_DEBUG\"\n";
739 stream
<< "BSC32=bscmake.exe\n";
740 stream
<< "# ADD BASE BSC32 /nologo\n";
741 stream
<< "# ADD BSC32 /nologo\n";
742 stream
<< "LINK32=link.exe\n";
743 stream
<< "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
744 stream
<< "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wxvc.lib ";
745 n
= m_extraLibs
.Number();
746 for (i
= 0; i
< n
; i
++)
748 wxString lib
= m_extraLibs
[i
];
749 stream
<< lib
<< " ";
751 stream
<< "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib\" /nodefaultlib:\"libcid.lib\" /out:\"DebugDLL/" << m_targetName
<< ".exe\" /pdbtype:sept";
753 n
= m_debugLibDirs
.Number();
754 for (i
= 0; i
< n
; i
++)
756 wxString libDir
= m_debugLibDirs
[i
];
757 libDir
+= "DLL"; // Assume that we have e.g. Debug so make it DebugDLL
758 stream
<< " /libpath:\"" << libDir
<< "\"";
760 n
= m_libDirs
.Number();
761 for (i
= 0; i
< n
; i
++)
763 wxString libDir
= m_libDirs
[i
];
764 stream
<< " /libpath:\"" << libDir
<< "\"";
768 // stream << "!ENDIF\n";
771 /////////////////////// Win32 Release DLL target
773 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release DLL\"\n";
775 stream
<< "# PROP BASE Use_MFC 0\n";
776 stream
<< "# PROP BASE Use_Debug_Libraries 0\n";
777 stream
<< "# PROP BASE Output_Dir \"ReleaseDLL\"\n";
778 stream
<< "# PROP BASE Intermediate_Dir \"ReleaseDLL\"\n";
779 stream
<< "# PROP BASE Target_Dir \"\"\n";
780 stream
<< "# PROP Use_MFC 0\n";
781 stream
<< "# PROP Use_Debug_Libraries 0\n";
782 stream
<< "# PROP Output_Dir \"ReleaseDLL\"\n";
783 stream
<< "# PROP Intermediate_Dir \"ReleaseDLL\"\n";
784 stream
<< "# PROP Ignore_Export_Lib 0\n";
785 stream
<< "# PROP Target_Dir \"\"\n";
786 stream
<< "# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
787 stream
<< "# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2";
789 n
= m_includeDirs
.Number();
790 for (i
= 0; i
< n
; i
++)
792 wxString includeDir
= m_includeDirs
[i
];
793 stream
<< " /I \"" << includeDir
<< "\"";
796 stream
<< " /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /D WXUSINGDLL=1 /FD /c\n";
797 stream
<< "# SUBTRACT CPP /YX\n";
798 stream
<< "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
799 stream
<< "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
800 stream
<< "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\n";
801 stream
<< "# ADD RSC /l 0x809 /d \"NDEBUG\"\n";
802 stream
<< "BSC32=bscmake.exe\n";
803 stream
<< "# ADD BASE BSC32 /nologo\n";
804 stream
<< "# ADD BSC32 /nologo\n";
805 stream
<< "LINK32=link.exe\n";
806 stream
<< "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386\n";
807 stream
<< "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wxvc.lib ";
808 n
= m_extraLibs
.Number();
809 for (i
= 0; i
< n
; i
++)
811 wxString lib
= m_extraLibs
[i
];
812 stream
<< lib
<< " ";
814 stream
<< "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib\" /nodefaultlib:\"libci.lib\" /out:\"ReleaseDLL/" << m_targetName
<< ".exe\"";
816 n
= m_releaseLibDirs
.Number();
817 for (i
= 0; i
< n
; i
++)
819 wxString libDir
= m_releaseLibDirs
[i
];
820 libDir
+= "DLL"; // Assume that we have e.g. Release so make it ReleaseDLL
821 stream
<< " /libpath:\"" << libDir
<< "\"";
823 n
= m_libDirs
.Number();
824 for (i
= 0; i
< n
; i
++)
826 wxString libDir
= m_libDirs
[i
];
827 stream
<< " /libpath:\"" << libDir
<< "\"";
831 stream
<< "!ENDIF\n";
834 /////////////////////// Source code for targets
836 stream
<< "# Begin Target\n";
838 stream
<< "# Name \"" << m_projectName
<< " - Win32 Release\"\n";
839 stream
<< "# Name \"" << m_projectName
<< " - Win32 Debug\"\n";
840 stream
<< "# Name \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
841 stream
<< "# Name \"" << m_projectName
<< " - Win32 Release DLL\"\n";
844 n
= m_sourceFiles
.Number();
845 for (i
= 0; i
< n
; i
++)
847 wxString sourceFile
= m_sourceFiles
[i
];
849 stream
<< "# Begin Source File\n";
851 stream
<< "SOURCE=.\\" << sourceFile
<< "\n";
853 stream
<< "!IF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release\"\n";
855 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug\"\n";
857 stream
<< "# SUBTRACT CPP /YX /Yc /Yu\n";
859 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
861 stream
<< "# SUBTRACT BASE CPP /YX /Yc /Yu\n";
862 stream
<< "# SUBTRACT CPP /YX /Yc /Yu\n";
864 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release DLL\"\n";
866 stream
<< "!ENDIF\n";
868 stream
<< "# End Source File\n";
871 // The .rc file: assume it has the target name + rc extension.
872 stream
<< "# Begin Source File\n";
874 stream
<< "SOURCE=.\\" << m_targetName
<< ".rc\n";
875 stream
<< "# ADD BASE RSC /l 0x809\n";
876 stream
<< "# ADD RSC /l 0x809";
878 n
= m_resourceIncludeDirs
.Number();
879 for (i
= 0; i
< n
; i
++)
881 wxString includeDir
= m_resourceIncludeDirs
[i
];
882 stream
<< " /i \"" << includeDir
<< "\"";
886 stream
<< "# End Source File\n";
887 stream
<< "# End Target\n";
888 stream
<< "# End Project\n";
890 // Now generate the .dsw workspace file
892 wxString fullWorkSpaceName
= m_path
+ wxString("/") + m_projectName
+ ".dsw";
894 ofstream
stream2(fullWorkSpaceName
);
898 stream2
<< "Microsoft Developer Studio Workspace File, Format Version 5.00\n";
899 stream2
<< "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n";
901 stream2
<< "###############################################################################\n";
903 stream2
<< "Project: \"" << m_projectName
<< "\"=.\\" << m_projectName
<< ".dsp - Package Owner=<4>\n";
905 stream2
<< "Package=<5>\n";
909 stream2
<< "Package=<4>\n";
913 stream2
<< "###############################################################################\n";
915 stream2
<< "Global:\n";
917 stream2
<< "Package=<5>\n";
921 stream2
<< "Package=<3>\n";
925 stream2
<< "###############################################################################\n";
931 BEGIN_EVENT_TABLE(MyDialog
, wxDialog
)
932 EVT_BUTTON(wxID_EXIT
, MyDialog::OnQuit
)
933 EVT_BUTTON(ID_GENERATE_PROJECT
, MyDialog::OnGenerate
)
934 EVT_BUTTON(ID_GENERATE_SAMPLES
, MyDialog::OnGenerateSamples
)
937 // ----------------------------------------------------------------------------
939 // ----------------------------------------------------------------------------
942 MyDialog::MyDialog(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
):
945 LoadFromResource((wxWindow
*) NULL
, "project_dialog");
949 void MyDialog::OnQuit(wxCommandEvent
& event
)
954 void MyDialog::OnAbout(wxCommandEvent
& event
)
958 void MyDialog::OnGenerate(wxCommandEvent
& event
)
962 void MyDialog::OnGenerateSamples(wxCommandEvent
& event
)
964 char* dir
= getenv("WXWIN");
968 wxTextEntryDialog
dialog(this, "Please enter the wxWindows directory", "Text entry", dirStr
, wxOK
|wxCANCEL
);
969 if (dialog
.ShowModal() == wxID_OK
)
971 if (wxDirExists(dialog
.GetValue()))
973 // wxGetApp().GenerateSample("MinimalVC", "minimal", dir + wxString("/samples/minimal"),
974 // wxStringList("minimal.cpp", 0));
976 wxGetApp().GenerateSamples(dialog
.GetValue());
980 wxMessageBox("This directory doesn't exist.");