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
, const wxString
& relativeRootPath
= "../..");
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
, const wxString
& relativeRootPath
= "../..");
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
, const wxString
& relativeRootPath
)
167 wxString
relativeIncludePath(relativeRootPath
+ wxString("/include"));
168 wxString
relativeLibPath(relativeRootPath
+ wxString("/lib"));
169 wxString
relativeDebugPath(relativeRootPath
+ wxString("/src/Debug"));
170 wxString
relativeReleasePath(relativeRootPath
+ wxString("/src/Release"));
171 wxString
relativeDebugPathJPEG(relativeRootPath
+ wxString("/src/jpeg/Debug"));
172 wxString
relativeReleasePathJPEG(relativeRootPath
+ wxString("/src/jpeg/Release"));
177 project
.SetIncludeDirs(wxStringList((const char*) relativeIncludePath
, 0));
178 project
.SetResourceIncludeDirs(wxStringList((const char*) relativeIncludePath
, 0));
179 project
.SetLibDirs(wxStringList((const char*) relativeLibPath
, 0));
180 project
.SetDebugLibDirs(wxStringList((const char*) relativeDebugPath
, (const char*) relativeDebugPathJPEG
, 0));
181 project
.SetReleaseLibDirs(wxStringList((const char*) relativeReleasePath
, (const char*) relativeReleasePathJPEG
, 0));
183 project
.SetProjectName(projectName
);
184 project
.SetTargetName(targetName
);
185 project
.SetProjectPath(path
);
186 project
.SetSourceFiles(sourceFiles
);
188 if (!project
.GenerateVCProject())
190 wxString
msg("Could not generate ");
199 void MyApp::GenerateSamples(const wxString
& dir
)
201 // Small bug. Because we don't distinguish between Debug/DebugDLL, Release/ReleaseDLL,
202 // we can't yet make a sample that uses other wxWindows static libraries + the wxWindows DLL library.
204 GenerateSample("BombsVC", "bombs", dir
+ wxString("/samples/bombs"),
205 wxStringList("bombs.cpp", "bombs1.cpp", "game.cpp", "bombs.h", "game.h", 0));
206 GenerateSample("CaretVC", "caret", dir
+ wxString("/samples/caret"), wxStringList("caret.cpp", 0));
207 GenerateSample("CheckLstVC", "checklst", dir
+ wxString("/samples/checklst"), wxStringList("checklst.cpp", 0));
208 GenerateSample("ConfigVC", "conftest", dir
+ wxString("/samples/config"), wxStringList("conftest.cpp", 0));
209 GenerateSample("ControlsVC", "controls", dir
+ wxString("/samples/controls"), wxStringList("controls.cpp", 0));
210 GenerateSample("DbVC", "dbtest", dir
+ wxString("/samples/db"),
211 wxStringList("dbtest.cpp", "listdb.cpp", "dbtest.h", "listdb.h", 0));
212 GenerateSample("DialogsVC", "dialogs", dir
+ wxString("/samples/dialogs"),
213 wxStringList("dialogs.cpp", "dialogs.h", 0));
214 GenerateSample("DndVC", "dnd", dir
+ wxString("/samples/dnd"), wxStringList("dnd.cpp", 0));
215 GenerateSample("DocViewVC", "docview", dir
+ wxString("/samples/docview"),
216 wxStringList("docview.cpp", "doc.cpp", "view.cpp", "docview.h", "doc.h", "view.h", 0));
217 GenerateSample("DocVwMDIVC", "docview", dir
+ wxString("/samples/docvwmdi"),
218 wxStringList("docview.cpp", "doc.cpp", "view.cpp", "docview.h", "doc.h", "view.h", 0));
219 GenerateSample("DynamicVC", "dynamic", dir
+ wxString("/samples/dynamic"), wxStringList("dynamic.cpp", 0));
220 GenerateSample("DrawingVC", "drawing", dir
+ wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
221 GenerateSample("FortyVC", "forty", dir
+ wxString("/samples/forty"),
222 wxStringList("forty.cpp", "canvas.cpp", "card.cpp", "game.cpp", "pile.cpp", "playerdg.cpp", "scoredg.cpp", "scorefil.cpp",
223 "canvas.h", "forty.h", "card.h", "game.h", "pile.h", "playerdg.h", "scoredg.h", "scorefil.h",
225 GenerateSample("FractalVC", "fractal", dir
+ wxString("/samples/fractal"), wxStringList("fractal.cpp", 0));
226 GenerateSample("GridVC", "test", dir
+ wxString("/samples/grid"), wxStringList("test.cpp", 0));
227 GenerateSample("NewGridVC", "griddemo", dir
+ wxString("/samples/newgrid"), wxStringList("griddemo.cpp", 0));
228 GenerateSample("HelpVC", "demo", dir
+ wxString("/samples/help"), wxStringList("demo.cpp", 0));
231 GenerateSample("AboutVC", "about", dir
+ wxString("/samples/html/about"), wxStringList("about.cpp", 0),
233 GenerateSample("HelpVC", "help", dir
+ wxString("/samples/html/help"), wxStringList("help.cpp", 0),
235 GenerateSample("PrintingVC", "printing", dir
+ wxString("/samples/html/printing"), wxStringList("printing.cpp", 0),
237 GenerateSample("TestVC", "test", dir
+ wxString("/samples/html/test"), wxStringList("test.cpp", 0),
239 GenerateSample("VirtualVC", "virtual", dir
+ wxString("/samples/html/virtual"), wxStringList("virtual.cpp", 0),
241 GenerateSample("WidgetVC", "widget", dir
+ wxString("/samples/html/widget"), wxStringList("widget.cpp", 0),
243 GenerateSample("ZipVC", "zip", dir
+ wxString("/samples/html/zip"), wxStringList("zip.cpp", 0),
245 GenerateSample("HelpViewVC", "helpview", dir
+ wxString("/samples/html/helpview"), wxStringList("helpview.cpp", 0),
248 GenerateSample("ImageVC", "image", dir
+ wxString("/samples/image"), wxStringList("image.cpp", 0));
249 GenerateSample("InternatVC", "internat", dir
+ wxString("/samples/internat"), wxStringList("internat.cpp", 0));
250 GenerateSample("JoytestVC", "joytest", dir
+ wxString("/samples/joytest"), wxStringList("joytest.cpp", "joytest.h", 0));
251 GenerateSample("LayoutVC", "layout", dir
+ wxString("/samples/layout"), wxStringList("layout.cpp", "layout.h", 0));
252 GenerateSample("ListctrlVC", "listtest", dir
+ wxString("/samples/listctrl"), wxStringList("listtest.cpp", "listtest.h", 0));
253 GenerateSample("MdiVC", "mdi", dir
+ wxString("/samples/mdi"), wxStringList("mdi.cpp", "mdi.h", 0));
254 GenerateSample("MemcheckVC", "memcheck", dir
+ wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0));
255 // Note: MFC sample will be different.
256 GenerateSample("MfcVC", "mfc", dir
+ wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0));
257 GenerateSample("MiniframVC", "test", dir
+ wxString("/samples/minifram"), wxStringList("test.cpp", "test.h", 0));
258 GenerateSample("MinimalVC", "minimal", dir
+ wxString("/samples/minimal"), wxStringList("minimal.cpp", 0));
259 GenerateSample("NativdlgVC", "nativdlg", dir
+ wxString("/samples/nativdlg"), wxStringList("nativdlg.cpp", "nativdlg.h", "resource.h", 0));
260 GenerateSample("NettestVC", "nettest", dir
+ wxString("/samples/nettest"), wxStringList("nettest.cpp", 0));
261 GenerateSample("NotebookVC", "test", dir
+ wxString("/samples/notebook"), wxStringList("test.cpp", "test.h", 0));
262 GenerateSample("OleautoVC", "oleauto", dir
+ wxString("/samples/oleauto"), wxStringList("oleauto.cpp", 0));
263 GenerateSample("OwnerdrwVC", "ownerdrw", dir
+ wxString("/samples/ownerdrw"), wxStringList("ownerdrw.cpp", 0));
264 GenerateSample("PngVC", "pngdemo", dir
+ wxString("/samples/png"), wxStringList("pngdemo.cpp", "pngdemo.h", 0));
265 GenerateSample("PrintingVC", "printing", dir
+ wxString("/samples/printing"), wxStringList("printing.cpp", "printing.h", 0));
266 GenerateSample("ProplistVC", "test", dir
+ wxString("/samples/proplist"), wxStringList("test.cpp", "test.h", 0));
267 GenerateSample("RegtestVC", "regtest", dir
+ wxString("/samples/regtest"), wxStringList("regtest.cpp", 0));
268 GenerateSample("ResourceVC", "resource", dir
+ wxString("/samples/resource"), wxStringList("resource.cpp", "resource.h", 0));
269 GenerateSample("RichEditVC", "wxLayout", dir
+ wxString("/samples/richedit"), wxStringList("wxLayout.cpp",
270 "kbList.cpp", "wxllist.cpp", "wxlparser.cpp", "wxlwindow.cpp", 0));
271 GenerateSample("SashtestVC", "sashtest", dir
+ wxString("/samples/sashtest"), wxStringList("sashtest.cpp", "sashtest.h", 0));
272 GenerateSample("ScrollVC", "scroll", dir
+ wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
273 GenerateSample("SplitterVC", "test", dir
+ wxString("/samples/splitter"), wxStringList("test.cpp", 0));
274 GenerateSample("TabVC", "test", dir
+ wxString("/samples/tab"), wxStringList("test.cpp", "test.h", 0));
275 GenerateSample("TaskbarVC", "tbtest", dir
+ wxString("/samples/taskbar"), wxStringList("tbtest.cpp", "tbtest.h", 0));
276 GenerateSample("TextVC", "text", dir
+ wxString("/samples/text"), wxStringList("text.cpp", 0));
277 GenerateSample("ThreadVC", "test", dir
+ wxString("/samples/thread"), wxStringList("test.cpp", 0));
278 GenerateSample("ToolbarVC", "test", dir
+ wxString("/samples/toolbar"), wxStringList("test.cpp", "test.h", 0));
279 GenerateSample("TreectrlVC", "treetest", dir
+ wxString("/samples/treectrl"), wxStringList("treetest.cpp", "treetest.h", 0));
280 GenerateSample("TypetestVC", "typetest", dir
+ wxString("/samples/typetest"), wxStringList("typetest.cpp", "typetest.h", 0));
281 GenerateSample("ValidateVC", "validate", dir
+ wxString("/samples/validate"), wxStringList("validate.cpp", "validate.h", 0));
282 GenerateSample("ClientVC", "client", dir
+ wxString("/samples/wxsocket"), wxStringList("client.cpp", 0));
283 GenerateSample("ServerVC", "server", dir
+ wxString("/samples/wxsocket"), wxStringList("server.cpp", 0));
284 GenerateSample("PoemVC", "wxpoem", dir
+ wxString("/samples/wxpoem"), wxStringList("wxpoem.cpp", "wxpoem.h", 0));
285 GenerateSample("ClientVC", "client", dir
+ wxString("/samples/dde"), wxStringList("client.cpp", "client.h", "ddesetup.h", 0));
286 GenerateSample("ServerVC", "server", dir
+ wxString("/samples/dde"), wxStringList("server.cpp", "server.h", "ddesetup.h", 0));
287 GenerateSample("CaretVC", "caret", dir
+ wxString("/samples/caret"), wxStringList("caret.cpp", 0));
288 GenerateSample("DrawingVC", "drawing", dir
+ wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
289 GenerateSample("ScrollVC", "scroll", dir
+ wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
290 GenerateSample("WizardVC", "wizard", dir
+ wxString("/samples/wizard"), wxStringList("wiztest.cpp", 0));
297 project
.SetIncludeDirs(wxStringList("../../../include", 0));
298 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
299 project
.SetLibDirs(wxStringList("../../../lib", 0));
300 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", 0));
301 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", 0));
303 project
.SetProjectName("DialogEdVC");
304 project
.SetTargetName("dialoged");
305 project
.SetProjectPath(dir
+ wxString("/utils/dialoged/src"));
306 project
.SetSourceFiles(wxStringList("dialoged.cpp", "dlghndlr.cpp", "edlist.cpp", "edtree.cpp",
307 "reseditr.cpp", "reswrite.cpp", "symbtabl.cpp", "winstyle.cpp", "winprop.cpp",
308 "dialoged.h", "dlghndlr.h", "edlist.h", "edtree.h", "reseditr.h", "symbtabl.h", "winprop.h",
312 if (!project
.GenerateVCProject())
314 wxString
msg("Could not generate Dialog Editor project");
319 project
.SetIncludeDirs(wxStringList("../../../include", 0));
320 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
321 project
.SetLibDirs(wxStringList("../../../lib", 0));
322 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", 0));
323 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", 0));
325 project
.SetProjectName("Tex2RTFVC");
326 project
.SetTargetName("tex2rtf");
327 project
.SetProjectPath(dir
+ wxString("/utils/tex2rtf/src"));
328 project
.SetSourceFiles(wxStringList("tex2rtf.cpp", "htmlutil.cpp", "readshg.cpp", "rtfutils.cpp",
329 "table.cpp", "tex2any.cpp", "texutils.cpp", "xlputils.cpp",
330 "bmputils.h", "readshg.h", "rtfutils.h", "table.h", "tex2any.h", "tex2rtf.h", "wxhlpblk.h",
333 if (!project
.GenerateVCProject())
335 wxString
msg("Could not generate Tex2RTF project");
340 project
.SetIncludeDirs(wxStringList("../../../include", 0));
341 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
342 project
.SetLibDirs(wxStringList("../../../lib", 0));
343 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", 0));
344 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", 0));
346 project
.SetProjectName("HelpGenVC");
347 project
.SetTargetName("helpgen");
348 project
.SetProjectPath(dir
+ wxString("/utils/helpgen/src"));
349 project
.SetSourceFiles(wxStringList("helpgen.cpp", "cjparser.cpp", "docripper.cpp", "ifcontext.cpp",
350 "markup.cpp", "ripper_main.cpp", "scriptbinder.cpp", "sourcepainter.cpp",
352 "cjparser.h", "docripper.h", "ifcontext.h", "markup.h", "scriptbinder.h", "sourcepainter.h",
353 "srcparser.h", "wxstlac.h", "wxstllst.h", "wxstlvec.h", 0));
355 if (!project
.GenerateVCProject())
357 wxString
msg("Could not generate HelpGen project");
362 project
.SetIncludeDirs(wxStringList("../../include", 0));
363 project
.SetResourceIncludeDirs(wxStringList("../../include", 0));
364 project
.SetLibDirs(wxStringList("../../lib", 0));
365 project
.SetDebugLibDirs(wxStringList("../../src/Debug", 0));
366 project
.SetReleaseLibDirs(wxStringList("../../src/Release", 0));
368 project
.SetProjectName("ProjGenVC");
369 project
.SetTargetName("makeproj");
370 project
.SetProjectPath(dir
+ wxString("/utils/projgen"));
371 project
.SetSourceFiles(wxStringList("makeproj.cpp", "makeproj.h", 0));
373 if (!project
.GenerateVCProject())
375 wxString
msg("Could not generate ProjGen project");
379 // wxTreeLayout sample
381 project
.SetIncludeDirs(wxStringList("../../../include", 0));
382 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
383 project
.SetLibDirs(wxStringList("../../../lib", 0));
384 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", 0));
385 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", 0));
387 project
.SetProjectName("TreeSampleVC");
388 project
.SetTargetName("test");
389 project
.SetProjectPath(dir
+ wxString("/utils/wxtree/src"));
390 project
.SetSourceFiles(wxStringList("test.cpp", "wxtree.cpp", "test.h", "wxtree.h", 0));
392 if (!project
.GenerateVCProject())
394 wxString
msg("Could not generate wxTreeLayout project");
400 project
.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0));
401 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
402 project
.SetLibDirs(wxStringList("../../../../lib", 0));
403 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", 0));
404 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", 0));
405 project
.SetExtraLibs(wxStringList("ogl.lib", 0));
407 project
.SetProjectName("OGLEditVC");
408 project
.SetTargetName("ogledit");
409 project
.SetProjectPath(dir
+ wxString("/utils/ogl/samples/ogledit"));
410 project
.SetSourceFiles(wxStringList("ogledit.cpp", "doc.cpp", "palette.cpp", "view.cpp",
411 "doc.h", "ogledit.h", "palette.h", "view.h",
414 if (!project
.GenerateVCProject())
416 wxString
msg("Could not generate OGLEdit project");
422 project
.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0));
423 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
424 project
.SetLibDirs(wxStringList("../../../../lib", 0));
425 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", 0));
426 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", 0));
427 project
.SetExtraLibs(wxStringList("ogl.lib", 0));
429 project
.SetProjectName("StudioVC");
430 project
.SetTargetName("studio");
431 project
.SetProjectPath(dir
+ wxString("/utils/ogl/samples/studio"));
432 project
.SetSourceFiles(wxStringList("studio.cpp", "cspalette.cpp", "dialogs.cpp", "view.cpp",
433 "doc.cpp", "mainfrm.cpp", "project.cpp", "shapes.cpp", "symbols.cpp", "csprint.cpp",
434 "studio.h", "cspalette.h", "dialogs.h", "view.h",
435 "doc.h", "mainfrm.h", "project.h", "shapes.h", "symbols.h",
438 if (!project
.GenerateVCProject())
440 wxString
msg("Could not generate OGL Studio project");
444 // GLCanvas cube sample
446 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
447 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
448 project
.SetLibDirs(wxStringList("../../../../lib", 0));
449 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0));
450 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0));
451 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
453 project
.SetProjectName("CubeVC");
454 project
.SetTargetName("cube");
455 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/cube"));
456 project
.SetSourceFiles(wxStringList("cube.cpp", "cube.h",
459 if (!project
.GenerateVCProject())
461 wxString
msg("Could not generate GLCanvas Cube project");
465 // GLCanvas isosurf sample
467 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
468 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
469 project
.SetLibDirs(wxStringList("../../../../lib", 0));
470 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0));
471 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0));
472 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
474 project
.SetProjectName("IsoSurfVC");
475 project
.SetTargetName("isosurf");
476 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/isosurf"));
477 project
.SetSourceFiles(wxStringList("isosurf.cpp", "isosurf.h",
480 if (!project
.GenerateVCProject())
482 wxString
msg("Could not generate GLCanvas IsoSurf project");
486 // GLCanvas penguin sample
488 project
.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
489 project
.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
490 project
.SetLibDirs(wxStringList("../../../../lib", 0));
491 project
.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", 0));
492 project
.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", 0));
493 project
.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
495 project
.SetProjectName("PenguinVC");
496 project
.SetTargetName("penguin");
497 project
.SetProjectPath(dir
+ wxString("/utils/glcanvas/samples/penguin"));
498 project
.SetSourceFiles(wxStringList("penguin.cpp", "penguin.h",
500 "trackball.c", "trackball.h",
503 if (!project
.GenerateVCProject())
505 wxString
msg("Could not generate GLCanvas Penguin project");
510 // ----------------------------------------------------------------------------
512 // ----------------------------------------------------------------------------
515 MyFrame::MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
)
516 : wxFrame((wxFrame
*)NULL
, -1, title
, pos
, size
)
518 // set the frame icon
519 SetIcon(wxICON(mondrian
));
522 wxMenu
*menuFile
= new wxMenu
;
524 menuFile
->Append(MakeProject_Generate
, "&Generate");
525 menuFile
->Append(MakeProject_About
, "&About...");
526 menuFile
->AppendSeparator();
527 menuFile
->Append(MakeProject_Quit
, "E&xit");
529 // now append the freshly created menu to the menu bar...
530 wxMenuBar
*menuBar
= new wxMenuBar
;
531 menuBar
->Append(menuFile
, "&File");
533 // ... and attach this menu bar to the frame
536 // create a status bar just for fun (by default with 1 pane only)
538 SetStatusText("Welcome to wxWindows!");
544 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
))
546 // TRUE is to force the frame to close
550 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
))
552 wxMessageBox("MakeProject: generates VC++ project files",
553 "About MakeProject", wxOK
| wxICON_INFORMATION
, this);
556 void MyFrame::OnGenerate(wxCommandEvent
& WXUNUSED(event
))
558 wxGetApp().GenerateSamples("d:/wx2/wxWindows");
561 bool MyFrame::GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
562 const wxString
& path
, const wxStringList
& sourceFiles
, const wxString
& relativeRootPath
)
564 return wxGetApp().GenerateSample(projectName
, targetName
, path
, sourceFiles
, relativeRootPath
);
571 wxProject::wxProject()
575 wxProject::~wxProject()
580 bool wxProject::GenerateVCProject()
582 wxString fullProjectName
= m_path
+ wxString("/") + m_projectName
+ ".dsp";
584 ofstream
stream(fullProjectName
);
588 /////////////////////// General stuff
590 stream
<< "# Microsoft Developer Studio Project File - Name=\"" << m_projectName
<< "\" - Package Owner=<4>\n";
591 stream
<< "# Microsoft Developer Studio Generated Build File, Format Version 5.00\n";
592 stream
<< "# (Actually, generated by MakeProject, (c) Julian Smart, 1998)\n";
593 stream
<< "# ** DO NOT EDIT **\n\n";
594 stream
<< "# TARGTYPE \"Win32 (x86) Application\" 0x0101\n\n";
595 stream
<< "CFG=" << m_projectName
<< " - Win32 Debug\n";
596 stream
<< "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n";
597 stream
<< "!MESSAGE use the Export Makefile command and run\n";
598 stream
<< "!MESSAGE\n";
599 stream
<< "!MESSAGE NMAKE /f \"" << m_projectName
<< ".mak\".\n";
600 stream
<< "!MESSAGE\n";
601 stream
<< "!MESSAGE You can specify a configuration when running NMAKE\n";
602 stream
<< "!MESSAGE by defining the macro CFG on the command line. For example:\n";
603 stream
<< "!MESSAGE\n";
604 stream
<< "!MESSAGE NMAKE /f \"" << m_projectName
<< ".mak\" CFG=\"" << m_projectName
<< " - Win32 Debug\"\n";
605 stream
<< "!MESSAGE\n";
606 stream
<< "!MESSAGE Possible choices for configuration are:\n";
607 stream
<< "!MESSAGE\n";
608 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Release\" (based on \"Win32 (x86) Application\")\n";
609 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Debug\" (based on \"Win32 (x86) Application\")\n";
610 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Debug DLL\" (based on \"Win32 (x86) Application\")\n";
611 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Release DLL\" (based on \"Win32 (x86) Application\")\n";
612 stream
<< "!MESSAGE\n";
614 stream
<< "# Begin Project\n";
615 stream
<< "# PROP Scc_ProjName \"\"\n";
616 stream
<< "# PROP Scc_LocalPath \"\"\n";
617 stream
<< "CPP=cl.exe\n";
618 stream
<< "MTL=midl.exe\n";
619 stream
<< "RSC=rc.exe\n";
622 /////////////////////// Win32 Release target
624 stream
<< "!IF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release\"\n";
626 stream
<< "# PROP BASE Use_MFC 0\n";
627 stream
<< "# PROP BASE Use_Debug_Libraries 0\n";
628 stream
<< "# PROP BASE Output_Dir \"Release\"\n";
629 stream
<< "# PROP BASE Intermediate_Dir \"Release\"\n";
630 stream
<< "# PROP BASE Target_Dir \"\"\n";
631 stream
<< "# PROP Use_MFC 0\n";
632 stream
<< "# PROP Use_Debug_Libraries 0\n";
633 stream
<< "# PROP Output_Dir \"Release\"\n";
634 stream
<< "# PROP Intermediate_Dir \"Release\"\n";
635 stream
<< "# PROP Ignore_Export_Lib 0\n";
636 stream
<< "# PROP Target_Dir \"\"\n";
637 stream
<< "# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
638 stream
<< "# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2";
640 int n
= m_includeDirs
.Number();
642 for (i
= 0; i
< n
; i
++)
644 wxString includeDir
= m_includeDirs
[i
];
645 stream
<< " /I \"" << includeDir
<< "\"";
648 stream
<< " /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /FD /c\n";
649 stream
<< "# SUBTRACT CPP /YX\n";
650 stream
<< "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
651 stream
<< "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
652 stream
<< "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\n";
653 stream
<< "# ADD RSC /l 0x809 /d \"NDEBUG\"\n";
654 stream
<< "BSC32=bscmake.exe\n";
655 stream
<< "# ADD BASE BSC32 /nologo\n";
656 stream
<< "# ADD BSC32 /nologo\n";
657 stream
<< "LINK32=link.exe\n";
658 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 wsock32.lib /nologo /subsystem:windows /machine:I386\n";
659 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 wsock32.lib wxvc.lib jpeg.lib ";
660 n
= m_extraLibs
.Number();
661 for (i
= 0; i
< n
; i
++)
663 wxString lib
= m_extraLibs
[i
];
664 stream
<< lib
<< " ";
667 stream
<< "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib,libci.lib,msvcrtd.lib\" /out:\"Release/" << m_targetName
<< ".exe\"";
669 n
= m_releaseLibDirs
.Number();
670 for (i
= 0; i
< n
; i
++)
672 wxString libDir
= m_releaseLibDirs
[i
];
673 stream
<< " /libpath:\"" << libDir
<< "\"";
675 n
= m_libDirs
.Number();
676 for (i
= 0; i
< n
; i
++)
678 wxString libDir
= m_libDirs
[i
];
679 stream
<< " /libpath:\"" << libDir
<< "\"";
684 /////////////////////// Win32 Debug target
686 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug\"\n";
688 stream
<< "# PROP BASE Use_MFC 0\n";
689 stream
<< "# PROP BASE Use_Debug_Libraries 1\n";
690 stream
<< "# PROP BASE Output_Dir \"Debug\"\n";
691 stream
<< "# PROP BASE Intermediate_Dir \"Debug\"\n";
692 stream
<< "# PROP BASE Target_Dir \"\"\n";
693 stream
<< "# PROP Use_MFC 0\n";
694 stream
<< "# PROP Use_Debug_Libraries 1\n";
695 stream
<< "# PROP Output_Dir \"Debug\"\n";
696 stream
<< "# PROP Intermediate_Dir \"Debug\"\n";
697 stream
<< "# PROP Ignore_Export_Lib 0\n";
698 stream
<< "# PROP Target_Dir \"\"\n";
699 stream
<< "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
700 stream
<< "# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od";
702 n
= m_includeDirs
.Number();
703 for (i
= 0; i
< n
; i
++)
705 wxString includeDir
= m_includeDirs
[i
];
706 stream
<< " /I \"" << includeDir
<< "\"";
709 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";
710 stream
<< "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
711 stream
<< "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
712 stream
<< "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\n";
713 stream
<< "# ADD RSC /l 0x809 /d \"_DEBUG\"\n";
714 stream
<< "BSC32=bscmake.exe\n";
715 stream
<< "# ADD BASE BSC32 /nologo\n";
716 stream
<< "# ADD BSC32 /nologo\n";
717 stream
<< "LINK32=link.exe\n";
718 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 wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
719 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 wsock32.lib wxvc.lib jpeg.lib ";
720 n
= m_extraLibs
.Number();
721 for (i
= 0; i
< n
; i
++)
723 wxString lib
= m_extraLibs
[i
];
724 stream
<< lib
<< " ";
726 stream
<< "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib,libcid.lib,msvcrt.lib\" /out:\"Debug/" << m_targetName
<< ".exe\" /pdbtype:sept";
728 n
= m_debugLibDirs
.Number();
729 for (i
= 0; i
< n
; i
++)
731 wxString libDir
= m_debugLibDirs
[i
];
732 stream
<< " /libpath:\"" << libDir
<< "\"";
734 n
= m_libDirs
.Number();
735 for (i
= 0; i
< n
; i
++)
737 wxString libDir
= m_libDirs
[i
];
738 stream
<< " /libpath:\"" << libDir
<< "\"";
742 // stream << "!ENDIF\n";
745 /////////////////////// Win32 Debug DLL target
747 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
749 stream
<< "# PROP BASE Use_MFC 0\n";
750 stream
<< "# PROP BASE Use_Debug_Libraries 1\n";
751 stream
<< "# PROP BASE Output_Dir \"DebugDLL\"\n";
752 stream
<< "# PROP BASE Intermediate_Dir \"DebugDLL\"\n";
753 stream
<< "# PROP BASE Target_Dir \"\"\n";
754 stream
<< "# PROP Use_MFC 0\n";
755 stream
<< "# PROP Use_Debug_Libraries 1\n";
756 stream
<< "# PROP Output_Dir \"DebugDLL\"\n";
757 stream
<< "# PROP Intermediate_Dir \"DebugDLL\"\n";
758 stream
<< "# PROP Ignore_Export_Lib 0\n";
759 stream
<< "# PROP Target_Dir \"\"\n";
760 stream
<< "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
761 stream
<< "# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od";
763 n
= m_includeDirs
.Number();
764 for (i
= 0; i
< n
; i
++)
766 wxString includeDir
= m_includeDirs
[i
];
767 stream
<< " /I \"" << includeDir
<< "\"";
770 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";
771 stream
<< "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
772 stream
<< "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
773 stream
<< "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\n";
774 stream
<< "# ADD RSC /l 0x809 /d \"_DEBUG\"\n";
775 stream
<< "BSC32=bscmake.exe\n";
776 stream
<< "# ADD BASE BSC32 /nologo\n";
777 stream
<< "# ADD BSC32 /nologo\n";
778 stream
<< "LINK32=link.exe\n";
779 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 wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
780 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 wsock32.lib wxvc.lib ";
781 n
= m_extraLibs
.Number();
782 for (i
= 0; i
< n
; i
++)
784 wxString lib
= m_extraLibs
[i
];
785 stream
<< lib
<< " ";
787 stream
<< "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib\" /nodefaultlib:\"libcid.lib\" /out:\"DebugDLL/" << m_targetName
<< ".exe\" /pdbtype:sept";
789 n
= m_debugLibDirs
.Number();
790 for (i
= 0; i
< n
; i
++)
792 wxString libDir
= m_debugLibDirs
[i
];
793 libDir
+= "DLL"; // Assume that we have e.g. Debug so make it DebugDLL
794 stream
<< " /libpath:\"" << libDir
<< "\"";
796 n
= m_libDirs
.Number();
797 for (i
= 0; i
< n
; i
++)
799 wxString libDir
= m_libDirs
[i
];
800 stream
<< " /libpath:\"" << libDir
<< "\"";
804 // stream << "!ENDIF\n";
807 /////////////////////// Win32 Release DLL target
809 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release DLL\"\n";
811 stream
<< "# PROP BASE Use_MFC 0\n";
812 stream
<< "# PROP BASE Use_Debug_Libraries 0\n";
813 stream
<< "# PROP BASE Output_Dir \"ReleaseDLL\"\n";
814 stream
<< "# PROP BASE Intermediate_Dir \"ReleaseDLL\"\n";
815 stream
<< "# PROP BASE Target_Dir \"\"\n";
816 stream
<< "# PROP Use_MFC 0\n";
817 stream
<< "# PROP Use_Debug_Libraries 0\n";
818 stream
<< "# PROP Output_Dir \"ReleaseDLL\"\n";
819 stream
<< "# PROP Intermediate_Dir \"ReleaseDLL\"\n";
820 stream
<< "# PROP Ignore_Export_Lib 0\n";
821 stream
<< "# PROP Target_Dir \"\"\n";
822 stream
<< "# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
823 stream
<< "# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2";
825 n
= m_includeDirs
.Number();
826 for (i
= 0; i
< n
; i
++)
828 wxString includeDir
= m_includeDirs
[i
];
829 stream
<< " /I \"" << includeDir
<< "\"";
832 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";
833 stream
<< "# SUBTRACT CPP /YX\n";
834 stream
<< "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
835 stream
<< "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
836 stream
<< "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\n";
837 stream
<< "# ADD RSC /l 0x809 /d \"NDEBUG\"\n";
838 stream
<< "BSC32=bscmake.exe\n";
839 stream
<< "# ADD BASE BSC32 /nologo\n";
840 stream
<< "# ADD BSC32 /nologo\n";
841 stream
<< "LINK32=link.exe\n";
842 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 wsock32.lib /nologo /subsystem:windows /machine:I386\n";
843 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 wsock32.lib wxvc.lib ";
844 n
= m_extraLibs
.Number();
845 for (i
= 0; i
< n
; i
++)
847 wxString lib
= m_extraLibs
[i
];
848 stream
<< lib
<< " ";
850 stream
<< "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib\" /nodefaultlib:\"libci.lib\" /out:\"ReleaseDLL/" << m_targetName
<< ".exe\"";
852 n
= m_releaseLibDirs
.Number();
853 for (i
= 0; i
< n
; i
++)
855 wxString libDir
= m_releaseLibDirs
[i
];
856 libDir
+= "DLL"; // Assume that we have e.g. Release so make it ReleaseDLL
857 stream
<< " /libpath:\"" << libDir
<< "\"";
859 n
= m_libDirs
.Number();
860 for (i
= 0; i
< n
; i
++)
862 wxString libDir
= m_libDirs
[i
];
863 stream
<< " /libpath:\"" << libDir
<< "\"";
867 stream
<< "!ENDIF\n";
870 /////////////////////// Source code for targets
872 stream
<< "# Begin Target\n";
874 stream
<< "# Name \"" << m_projectName
<< " - Win32 Release\"\n";
875 stream
<< "# Name \"" << m_projectName
<< " - Win32 Debug\"\n";
876 stream
<< "# Name \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
877 stream
<< "# Name \"" << m_projectName
<< " - Win32 Release DLL\"\n";
880 n
= m_sourceFiles
.Number();
881 for (i
= 0; i
< n
; i
++)
883 wxString sourceFile
= m_sourceFiles
[i
];
885 stream
<< "# Begin Source File\n";
887 stream
<< "SOURCE=.\\" << sourceFile
<< "\n";
889 stream
<< "!IF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release\"\n";
891 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug\"\n";
893 stream
<< "# SUBTRACT CPP /YX /Yc /Yu\n";
895 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
897 stream
<< "# SUBTRACT BASE CPP /YX /Yc /Yu\n";
898 stream
<< "# SUBTRACT CPP /YX /Yc /Yu\n";
900 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release DLL\"\n";
902 stream
<< "!ENDIF\n";
904 stream
<< "# End Source File\n";
907 // The .rc file: assume it has the target name + rc extension.
908 stream
<< "# Begin Source File\n";
910 stream
<< "SOURCE=.\\" << m_targetName
<< ".rc\n";
911 stream
<< "# ADD BASE RSC /l 0x809\n";
912 stream
<< "# ADD RSC /l 0x809";
914 n
= m_resourceIncludeDirs
.Number();
915 for (i
= 0; i
< n
; i
++)
917 wxString includeDir
= m_resourceIncludeDirs
[i
];
918 stream
<< " /i \"" << includeDir
<< "\"";
922 stream
<< "# End Source File\n";
923 stream
<< "# End Target\n";
924 stream
<< "# End Project\n";
926 // Now generate the .dsw workspace file
928 wxString fullWorkSpaceName
= m_path
+ wxString("/") + m_projectName
+ ".dsw";
930 ofstream
stream2(fullWorkSpaceName
);
934 stream2
<< "Microsoft Developer Studio Workspace File, Format Version 5.00\n";
935 stream2
<< "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n";
937 stream2
<< "###############################################################################\n";
939 stream2
<< "Project: \"" << m_projectName
<< "\"=.\\" << m_projectName
<< ".dsp - Package Owner=<4>\n";
941 stream2
<< "Package=<5>\n";
945 stream2
<< "Package=<4>\n";
949 stream2
<< "###############################################################################\n";
951 stream2
<< "Global:\n";
953 stream2
<< "Package=<5>\n";
957 stream2
<< "Package=<3>\n";
961 stream2
<< "###############################################################################\n";
967 BEGIN_EVENT_TABLE(MyDialog
, wxDialog
)
968 EVT_BUTTON(wxID_EXIT
, MyDialog::OnQuit
)
969 EVT_BUTTON(ID_GENERATE_PROJECT
, MyDialog::OnGenerate
)
970 EVT_BUTTON(ID_GENERATE_SAMPLES
, MyDialog::OnGenerateSamples
)
973 // ----------------------------------------------------------------------------
975 // ----------------------------------------------------------------------------
978 MyDialog::MyDialog(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
):
981 LoadFromResource((wxWindow
*) NULL
, "project_dialog");
985 void MyDialog::OnQuit(wxCommandEvent
& event
)
990 void MyDialog::OnAbout(wxCommandEvent
& event
)
994 void MyDialog::OnGenerate(wxCommandEvent
& event
)
998 void MyDialog::OnGenerateSamples(wxCommandEvent
& event
)
1000 char* dir
= getenv("WXWIN");
1004 wxTextEntryDialog
dialog(this, "Please enter the wxWindows directory", "Text entry", dirStr
, wxOK
|wxCANCEL
);
1005 if (dialog
.ShowModal() == wxID_OK
)
1007 if (wxDirExists(dialog
.GetValue()))
1009 // wxGetApp().GenerateSample("MinimalVC", "minimal", dir + wxString("/samples/minimal"),
1010 // wxStringList("minimal.cpp", 0));
1012 wxGetApp().GenerateSamples(dialog
.GetValue());
1016 wxMessageBox("This directory doesn't exist.");