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");
166 bool MyApp::GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
167 const wxString
& path
, const wxStringList
& sourceFiles
, const wxString
& relativeRootPath
)
169 wxString
relativeIncludePath(relativeRootPath
+ wxString("/include"));
170 wxString
relativeLibPath(relativeRootPath
+ wxString("/lib"));
171 wxString
relativeDebugPath(relativeRootPath
+ wxString("/src/Debug"));
172 wxString
relativeReleasePath(relativeRootPath
+ wxString("/src/Release"));
173 wxString
relativeDebugPathJPEG(relativeRootPath
+ wxString("/src/jpeg/Debug"));
174 wxString
relativeReleasePathJPEG(relativeRootPath
+ wxString("/src/jpeg/Release"));
175 wxString
relativeDebugPathTIFF(relativeRootPath
+ wxString("/src/tiff/Debug"));
176 wxString
relativeReleasePathTIFF(relativeRootPath
+ wxString("/src/tiff/Release"));
181 project
.SetIncludeDirs(wxStringList((const char*) relativeIncludePath
, 0));
182 project
.SetResourceIncludeDirs(wxStringList((const char*) relativeIncludePath
, 0));
183 project
.SetLibDirs(wxStringList((const char*) relativeLibPath
, 0));
184 project
.SetDebugLibDirs(wxStringList((const char*) relativeDebugPath
, (const char*) relativeDebugPathJPEG
, (const char*) relativeDebugPathTIFF
, 0));
185 project
.SetReleaseLibDirs(wxStringList((const char*) relativeReleasePath
, (const char*) relativeReleasePathJPEG
, (const char*) relativeReleasePathTIFF
, 0));
186 project
.SetExtraLibs(wxStringList("opengl32.lib", "glu32.lib", 0));
188 project
.SetProjectName(projectName
);
189 project
.SetTargetName(targetName
);
190 project
.SetProjectPath(path
);
191 project
.SetSourceFiles(sourceFiles
);
193 if (!project
.GenerateVCProject())
195 wxString
msg("Could not generate ");
204 void MyApp::GenerateSamples(const wxString
& dir
)
206 // Small bug. Because we don't distinguish between Debug/DebugDLL, Release/ReleaseDLL,
207 // we can't yet make a sample that uses other wxWindows static libraries + the wxWindows DLL library.
211 GenerateSample("CalendarVC", "calendar", dir
+ wxString("/samples/calendar"), wxStringList("calendar.cpp", 0));
212 GenerateSample("CaretVC", "caret", dir
+ wxString("/samples/caret"), wxStringList("caret.cpp", 0));
213 GenerateSample("CheckLstVC", "checklst", dir
+ wxString("/samples/checklst"), wxStringList("checklst.cpp", 0));
214 GenerateSample("ConfigVC", "conftest", dir
+ wxString("/samples/config"), wxStringList("conftest.cpp", 0));
215 GenerateSample("ControlsVC", "controls", dir
+ wxString("/samples/controls"), wxStringList("controls.cpp", 0));
216 GenerateSample("DbVC", "dbtest", dir
+ wxString("/samples/db"),
217 wxStringList("dbtest.cpp", "listdb.cpp", "dbtest.h", "listdb.h", 0));
218 GenerateSample("DialogsVC", "dialogs", dir
+ wxString("/samples/dialogs"),
219 wxStringList("dialogs.cpp", "dialogs.h", 0));
220 GenerateSample("DndVC", "dnd", dir
+ wxString("/samples/dnd"), wxStringList("dnd.cpp", 0));
221 GenerateSample("DocViewVC", "docview", dir
+ wxString("/samples/docview"),
222 wxStringList("docview.cpp", "doc.cpp", "view.cpp", "docview.h", "doc.h", "view.h", 0));
223 GenerateSample("DocVwMDIVC", "docview", dir
+ wxString("/samples/docvwmdi"),
224 wxStringList("docview.cpp", "doc.cpp", "view.cpp", "docview.h", "doc.h", "view.h", 0));
225 GenerateSample("DynamicVC", "dynamic", dir
+ wxString("/samples/dynamic"), wxStringList("dynamic.cpp", 0));
226 GenerateSample("DrawingVC", "drawing", dir
+ wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
227 GenerateSample("ExecVC", "exec", dir
+ wxString("/samples/exec"), wxStringList("exec.cpp", 0));
228 GenerateSample("GridVC", "test", dir
+ wxString("/samples/grid"), wxStringList("test.cpp", 0));
229 GenerateSample("NewGridVC", "griddemo", dir
+ wxString("/samples/newgrid"), wxStringList("griddemo.cpp", 0));
230 GenerateSample("HelpVC", "demo", dir
+ wxString("/samples/help"), wxStringList("demo.cpp", 0));
233 GenerateSample("CubeVC", "cube", dir
+ wxString("/samples/opengl/cube"), wxStringList("cube.cpp", "cube.h", 0),
235 GenerateSample("IsosurfVC", "isosurf", dir
+ wxString("/samples/opengl/isosurf"), wxStringList("isosurf.cpp", "isousrf.h", 0),
237 GenerateSample("PenguinVC", "penguin", dir
+ wxString("/samples/opengl/penguin"), wxStringList("penguin.cpp", "penguin.h",
238 "lw.cpp", "lw.h", "trackball.c", "trackball.h", 0), "../../..");
241 GenerateSample("AboutVC", "about", dir
+ wxString("/samples/html/about"), wxStringList("about.cpp", 0),
243 GenerateSample("HelpVC", "help", dir
+ wxString("/samples/html/help"), wxStringList("help.cpp", 0),
245 GenerateSample("PrintingVC", "printing", dir
+ wxString("/samples/html/printing"), wxStringList("printing.cpp", 0),
247 GenerateSample("TestVC", "test", dir
+ wxString("/samples/html/test"), wxStringList("test.cpp", 0),
249 GenerateSample("VirtualVC", "virtual", dir
+ wxString("/samples/html/virtual"), wxStringList("virtual.cpp", 0),
251 GenerateSample("WidgetVC", "widget", dir
+ wxString("/samples/html/widget"), wxStringList("widget.cpp", 0),
253 GenerateSample("ZipVC", "zip", dir
+ wxString("/samples/html/zip"), wxStringList("zip.cpp", 0),
255 GenerateSample("HelpViewVC", "helpview", dir
+ wxString("/samples/html/helpview"), wxStringList("helpview.cpp", 0),
258 GenerateSample("ImageVC", "image", dir
+ wxString("/samples/image"), wxStringList("image.cpp", 0));
259 GenerateSample("InternatVC", "internat", dir
+ wxString("/samples/internat"), wxStringList("internat.cpp", 0));
260 GenerateSample("JoytestVC", "joytest", dir
+ wxString("/samples/joytest"), wxStringList("joytest.cpp", "joytest.h", 0));
261 GenerateSample("LayoutVC", "layout", dir
+ wxString("/samples/layout"), wxStringList("layout.cpp", "layout.h", 0));
262 GenerateSample("ListctrlVC", "listtest", dir
+ wxString("/samples/listctrl"), wxStringList("listtest.cpp", "listtest.h", 0));
263 GenerateSample("MdiVC", "mdi", dir
+ wxString("/samples/mdi"), wxStringList("mdi.cpp", "mdi.h", 0));
264 GenerateSample("MemcheckVC", "memcheck", dir
+ wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0));
265 // Note: MFC sample will be different.
266 GenerateSample("MfcVC", "mfc", dir
+ wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0));
267 GenerateSample("MiniframVC", "test", dir
+ wxString("/samples/minifram"), wxStringList("test.cpp", "test.h", 0));
268 GenerateSample("MinimalVC", "minimal", dir
+ wxString("/samples/minimal"), wxStringList("minimal.cpp", 0));
269 GenerateSample("NativdlgVC", "nativdlg", dir
+ wxString("/samples/nativdlg"), wxStringList("nativdlg.cpp", "nativdlg.h", "resource.h", 0));
270 GenerateSample("DialupVC", "nettest", dir
+ wxString("/samples/dialup"), wxStringList("nettest.cpp", 0));
271 GenerateSample("NotebookVC", "test", dir
+ wxString("/samples/notebook"), wxStringList("test.cpp", "test.h", 0));
272 GenerateSample("OleautoVC", "oleauto", dir
+ wxString("/samples/oleauto"), wxStringList("oleauto.cpp", 0));
273 GenerateSample("OwnerdrwVC", "ownerdrw", dir
+ wxString("/samples/ownerdrw"), wxStringList("ownerdrw.cpp", 0));
274 GenerateSample("PngVC", "pngdemo", dir
+ wxString("/samples/png"), wxStringList("pngdemo.cpp", "pngdemo.h", 0));
275 GenerateSample("PrintingVC", "printing", dir
+ wxString("/samples/printing"), wxStringList("printing.cpp", "printing.h", 0));
276 GenerateSample("ProplistVC", "test", dir
+ wxString("/samples/proplist"), wxStringList("test.cpp", "test.h", 0));
277 GenerateSample("PropsizeVC", "propsize", dir
+ wxString("/samples/propsize"), wxStringList("propsize.cpp", 0));
278 GenerateSample("RegtestVC", "regtest", dir
+ wxString("/samples/regtest"), wxStringList("regtest.cpp", 0));
279 GenerateSample("ResourceVC", "resource", dir
+ wxString("/samples/resource"), wxStringList("resource.cpp", "resource.h", 0));
280 GenerateSample("RichEditVC", "wxLayout", dir
+ wxString("/samples/richedit"), wxStringList("wxLayout.cpp",
281 "kbList.cpp", "wxllist.cpp", "wxlparser.cpp", "wxlwindow.cpp", 0));
282 GenerateSample("SashtestVC", "sashtest", dir
+ wxString("/samples/sashtest"), wxStringList("sashtest.cpp", "sashtest.h", 0));
283 GenerateSample("ScrollVC", "scroll", dir
+ wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
284 GenerateSample("ScrollsubVC", "scrollsub", dir
+ wxString("/samples/scrollsub"), wxStringList("scrollsub.cpp", 0));
285 GenerateSample("SplitterVC", "test", dir
+ wxString("/samples/splitter"), wxStringList("test.cpp", 0));
286 GenerateSample("TabVC", "test", dir
+ wxString("/samples/tab"), wxStringList("test.cpp", "test.h", 0));
287 GenerateSample("TaskbarVC", "tbtest", dir
+ wxString("/samples/taskbar"), wxStringList("tbtest.cpp", "tbtest.h", 0));
288 GenerateSample("TextVC", "text", dir
+ wxString("/samples/text"), wxStringList("text.cpp", 0));
289 GenerateSample("ThreadVC", "test", dir
+ wxString("/samples/thread"), wxStringList("test.cpp", 0));
290 GenerateSample("ToolbarVC", "toolbar", dir
+ wxString("/samples/toolbar"), wxStringList("toolbar.cpp", 0));
291 GenerateSample("TreectrlVC", "treetest", dir
+ wxString("/samples/treectrl"), wxStringList("treetest.cpp", "treetest.h", 0));
292 GenerateSample("TypetestVC", "typetest", dir
+ wxString("/samples/typetest"), wxStringList("typetest.cpp", "typetest.h", 0));
293 GenerateSample("ValidateVC", "validate", dir
+ wxString("/samples/validate"), wxStringList("validate.cpp", "validate.h", 0));
294 GenerateSample("ClientVC", "client", dir
+ wxString("/samples/sockets"), wxStringList("client.cpp", 0));
295 GenerateSample("ServerVC", "server", dir
+ wxString("/samples/sockets"), wxStringList("server.cpp", 0));
296 GenerateSample("ClientVC", "client", dir
+ wxString("/samples/ipc"), wxStringList("client.cpp", "client.h", "ddesetup.h", 0));
297 GenerateSample("ServerVC", "server", dir
+ wxString("/samples/ipc"), wxStringList("server.cpp", "server.h", "ddesetup.h", 0));
298 GenerateSample("CaretVC", "caret", dir
+ wxString("/samples/caret"), wxStringList("caret.cpp", 0));
299 GenerateSample("DrawingVC", "drawing", dir
+ wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
300 GenerateSample("ScrollVC", "scroll", dir
+ wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
301 GenerateSample("WizardVC", "wiztest", dir
+ wxString("/samples/wizard"), wxStringList("wiztest.cpp", 0));
302 GenerateSample("RotateVC", "rotate", dir
+ wxString("/samples/rotate"), wxStringList("rotate.cpp", 0));
303 GenerateSample("ExecVC", "exec", dir
+ wxString("/samples/exec"), wxStringList("exec.cpp", 0));
304 GenerateSample("FontVC", "font", dir
+ wxString("/samples/font"), wxStringList("font.cpp", 0));
305 GenerateSample("MenuVC", "menu", dir
+ wxString("/samples/menu"), wxStringList("menu.cpp", 0));
306 GenerateSample("TreelayVC", "test", dir
+ wxString("/samples/treelay"), wxStringList("test.cpp", "test.h", 0));
307 GenerateSample("DragimagVC", "test", dir
+ wxString("/samples/dragimag"), wxStringList("test.cpp", "test.h", 0));
311 GenerateSample("BombsVC", "bombs", dir
+ wxString("/demos/bombs"),
312 wxStringList("bombs.cpp", "bombs1.cpp", "game.cpp", "bombs.h", "game.h", 0));
314 GenerateSample("FortyVC", "forty", dir
+ wxString("/demos/forty"),
315 wxStringList("forty.cpp", "canvas.cpp", "card.cpp", "game.cpp", "pile.cpp", "playerdg.cpp", "scoredg.cpp", "scorefil.cpp",
316 "canvas.h", "forty.h", "card.h", "game.h", "pile.h", "playerdg.h", "scoredg.h", "scorefil.h",
319 GenerateSample("FractalVC", "fractal", dir
+ wxString("/demos/fractal"), wxStringList("fractal.cpp", 0));
321 GenerateSample("LifeVC", "life", dir
+ wxString("/demos/life"),
322 wxStringList("life.cpp", "game.cpp", "dialogs.cpp", "life.h", "game.h", "dialogs.h", 0));
324 GenerateSample("PoemVC", "wxpoem", dir
+ wxString("/demos/poem"), wxStringList("wxpoem.cpp", "wxpoem.h", 0));
326 GenerateSample("DbbrowseVC", "dbbrowse", dir
+ wxString("/demos/dbbrowse"),
327 wxStringList("dbbrowse.cpp", "browsedb.cpp", "dbgrid.cpp", "dbtree.cpp", "dlguser.cpp", "doc.cpp",
328 "pgmctrl.cpp", "tabpgwin.cpp",
329 "dbbrowse.h", "browsedb.h", "dbgrid.h", "dbtree.h", "dlguser.h", "doc.h", "pgmctrl.h", "std.h", "tabpgwin.h",
337 project
.SetIncludeDirs(wxStringList("../../../include", 0));
338 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
339 project
.SetLibDirs(wxStringList("../../../lib", 0));
340 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
341 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
343 project
.SetProjectName("DialogEdVC");
344 project
.SetTargetName("dialoged");
345 project
.SetProjectPath(dir
+ wxString("/utils/dialoged/src"));
346 project
.SetSourceFiles(wxStringList("dialoged.cpp", "dlghndlr.cpp", "edlist.cpp", "edtree.cpp",
347 "reseditr.cpp", "reswrite.cpp", "symbtabl.cpp", "winstyle.cpp", "winprop.cpp",
348 "dialoged.h", "dlghndlr.h", "edlist.h", "edtree.h", "reseditr.h", "symbtabl.h", "winprop.h",
352 if (!project
.GenerateVCProject())
354 wxString
msg("Could not generate Dialog Editor project");
359 project
.SetIncludeDirs(wxStringList("../../../include", 0));
360 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
361 project
.SetLibDirs(wxStringList("../../../lib", 0));
362 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
363 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
365 project
.SetProjectName("Tex2RTFVC");
366 project
.SetTargetName("tex2rtf");
367 project
.SetProjectPath(dir
+ wxString("/utils/tex2rtf/src"));
368 project
.SetSourceFiles(wxStringList("tex2rtf.cpp", "htmlutil.cpp", "readshg.cpp", "rtfutils.cpp",
369 "table.cpp", "tex2any.cpp", "texutils.cpp", "xlputils.cpp",
370 "bmputils.h", "readshg.h", "rtfutils.h", "table.h", "tex2any.h", "tex2rtf.h", "wxhlpblk.h",
373 if (!project
.GenerateVCProject())
375 wxString
msg("Could not generate Tex2RTF project");
380 project
.SetIncludeDirs(wxStringList("../../../include", 0));
381 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
382 project
.SetLibDirs(wxStringList("../../../lib", 0));
383 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
384 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
386 project
.SetProjectName("HelpGenVC");
387 project
.SetTargetName("helpgen");
388 project
.SetProjectPath(dir
+ wxString("/utils/helpgen/src"));
389 project
.SetSourceFiles(wxStringList("helpgen.cpp", "cjparser.cpp", "docripper.cpp", "ifcontext.cpp",
390 "markup.cpp", "ripper_main.cpp", "scriptbinder.cpp", "sourcepainter.cpp",
392 "cjparser.h", "docripper.h", "ifcontext.h", "markup.h", "scriptbinder.h", "sourcepainter.h",
393 "srcparser.h", "wxstlac.h", "wxstllst.h", "wxstlvec.h", 0));
395 if (!project
.GenerateVCProject())
397 wxString
msg("Could not generate HelpGen project");
402 project
.SetIncludeDirs(wxStringList("../../include", 0));
403 project
.SetResourceIncludeDirs(wxStringList("../../include", 0));
404 project
.SetLibDirs(wxStringList("../../lib", 0));
405 project
.SetDebugLibDirs(wxStringList("../../src/Debug", "../../src/jpeg/Debug", "../../src/tiff/Debug", 0));
406 project
.SetReleaseLibDirs(wxStringList("../../src/Release", "../../src/jpeg/Release", "../../src/tiff/Release", 0));
408 project
.SetProjectName("ProjGenVC");
409 project
.SetTargetName("makeproj");
410 project
.SetProjectPath(dir
+ wxString("/utils/projgen"));
411 project
.SetSourceFiles(wxStringList("makeproj.cpp", "makeproj.h", 0));
413 if (!project
.GenerateVCProject())
415 wxString
msg("Could not generate ProjGen project");
420 project
.SetIncludeDirs(wxStringList("../../include", 0));
421 project
.SetResourceIncludeDirs(wxStringList("../../include", 0));
422 project
.SetLibDirs(wxStringList("../../lib", 0));
423 project
.SetDebugLibDirs(wxStringList("../../src/Debug", "../../src/jpeg/Debug", "../../src/tiff/Debug", 0));
424 project
.SetReleaseLibDirs(wxStringList("../../src/Release", "../../src/jpeg/Release", "../../src/tiff/Release", 0));
426 project
.SetProjectName("hhp2cachedVC");
427 project
.SetTargetName("hhp2cached");
428 project
.SetProjectPath(dir
+ wxString("/utils/hhp2cached"));
429 project
.SetSourceFiles(wxStringList("hhp2cached.cpp", 0));
431 if (!project
.GenerateVCProject())
433 wxString
msg("Could not generate hhp2cached project");
437 // wxTreeLayout sample
439 project
.SetIncludeDirs(wxStringList("../../../include", 0));
440 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
441 project
.SetLibDirs(wxStringList("../../../lib", 0));
442 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
443 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
445 project
.SetProjectName("TreeSampleVC");
446 project
.SetTargetName("test");
447 project
.SetProjectPath(dir
+ wxString("/utils/wxtree/src"));
448 project
.SetSourceFiles(wxStringList("test.cpp", "wxtree.cpp", "test.h", "wxtree.h", 0));
450 if (!project
.GenerateVCProject())
452 wxString
msg("Could not generate wxTreeLayout project");
457 // OGLEdit. We have to do it the long way because we need to add the extra ogl.lib.
459 project
.SetIncludeDirs(wxStringList("../../../include", 0));
460 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
461 project
.SetLibDirs(wxStringList("../../../lib", 0));
462 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/ogl/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
463 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/ogl/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
465 project
.SetExtraLibs(wxStringList("ogl.lib", 0));
467 project
.SetProjectName("OGLEditVC");
468 project
.SetTargetName("ogledit");
469 project
.SetProjectPath(dir
+ wxString("/samples/ogl/ogledit"));
470 project
.SetSourceFiles(wxStringList("ogledit.cpp", "doc.cpp", "palette.cpp", "view.cpp",
471 "doc.h", "ogledit.h", "palette.h", "view.h",
474 if (!project
.GenerateVCProject())
476 wxString
msg("Could not generate OGLEdit project");
482 project
.SetIncludeDirs(wxStringList("../../../include", 0));
483 project
.SetResourceIncludeDirs(wxStringList("../../../include", 0));
484 project
.SetLibDirs(wxStringList("../../../lib", 0));
485 project
.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/ogl/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
486 project
.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/ogl/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
488 project
.SetExtraLibs(wxStringList("ogl.lib", 0));
490 project
.SetProjectName("StudioVC");
491 project
.SetTargetName("studio");
492 project
.SetProjectPath(dir
+ wxString("/samples/ogl/studio"));
493 project
.SetSourceFiles(wxStringList("studio.cpp", "cspalette.cpp", "dialogs.cpp", "view.cpp",
494 "doc.cpp", "mainfrm.cpp", "project.cpp", "shapes.cpp", "symbols.cpp", "csprint.cpp",
495 "studio.h", "cspalette.h", "dialogs.h", "view.h",
496 "doc.h", "mainfrm.h", "project.h", "shapes.h", "symbols.h",
499 if (!project
.GenerateVCProject())
501 wxString
msg("Could not generate OGL Studio project");
506 // ----------------------------------------------------------------------------
508 // ----------------------------------------------------------------------------
511 MyFrame::MyFrame(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
)
512 : wxFrame((wxFrame
*)NULL
, -1, title
, pos
, size
)
514 // set the frame icon
515 SetIcon(wxICON(mondrian
));
518 wxMenu
*menuFile
= new wxMenu
;
520 menuFile
->Append(MakeProject_Generate
, "&Generate");
521 menuFile
->Append(MakeProject_About
, "&About...");
522 menuFile
->AppendSeparator();
523 menuFile
->Append(MakeProject_Quit
, "E&xit");
525 // now append the freshly created menu to the menu bar...
526 wxMenuBar
*menuBar
= new wxMenuBar
;
527 menuBar
->Append(menuFile
, "&File");
529 // ... and attach this menu bar to the frame
532 // create a status bar just for fun (by default with 1 pane only)
534 SetStatusText("Welcome to wxWindows!");
540 void MyFrame::OnQuit(wxCommandEvent
& WXUNUSED(event
))
542 // TRUE is to force the frame to close
546 void MyFrame::OnAbout(wxCommandEvent
& WXUNUSED(event
))
548 wxMessageBox("MakeProject: generates VC++ project files",
549 "About MakeProject", wxOK
| wxICON_INFORMATION
, this);
552 void MyFrame::OnGenerate(wxCommandEvent
& WXUNUSED(event
))
554 wxGetApp().GenerateSamples("d:/wx2/wxWindows");
557 bool MyFrame::GenerateSample(const wxString
& projectName
, const wxString
& targetName
,
558 const wxString
& path
, const wxStringList
& sourceFiles
, const wxString
& relativeRootPath
)
560 return wxGetApp().GenerateSample(projectName
, targetName
, path
, sourceFiles
, relativeRootPath
);
567 wxProject::wxProject()
571 wxProject::~wxProject()
576 bool wxProject::GenerateVCProject()
578 wxString fullProjectName
= m_path
+ wxString("/") + m_projectName
+ ".dsp";
580 ofstream
stream(fullProjectName
);
584 /////////////////////// General stuff
586 stream
<< "# Microsoft Developer Studio Project File - Name=\"" << m_projectName
<< "\" - Package Owner=<4>\n";
587 stream
<< "# Microsoft Developer Studio Generated Build File, Format Version 5.00\n";
588 stream
<< "# (Actually, generated by MakeProject, (c) Julian Smart, 1998)\n";
589 stream
<< "# ** DO NOT EDIT **\n\n";
590 stream
<< "# TARGTYPE \"Win32 (x86) Application\" 0x0101\n\n";
591 stream
<< "CFG=" << m_projectName
<< " - Win32 Debug\n";
592 stream
<< "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n";
593 stream
<< "!MESSAGE use the Export Makefile command and run\n";
594 stream
<< "!MESSAGE\n";
595 stream
<< "!MESSAGE NMAKE /f \"" << m_projectName
<< ".mak\".\n";
596 stream
<< "!MESSAGE\n";
597 stream
<< "!MESSAGE You can specify a configuration when running NMAKE\n";
598 stream
<< "!MESSAGE by defining the macro CFG on the command line. For example:\n";
599 stream
<< "!MESSAGE\n";
600 stream
<< "!MESSAGE NMAKE /f \"" << m_projectName
<< ".mak\" CFG=\"" << m_projectName
<< " - Win32 Debug\"\n";
601 stream
<< "!MESSAGE\n";
602 stream
<< "!MESSAGE Possible choices for configuration are:\n";
603 stream
<< "!MESSAGE\n";
604 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Release\" (based on \"Win32 (x86) Application\")\n";
605 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Debug\" (based on \"Win32 (x86) Application\")\n";
606 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Debug DLL\" (based on \"Win32 (x86) Application\")\n";
607 stream
<< "!MESSAGE \"" << m_projectName
<< " - Win32 Release DLL\" (based on \"Win32 (x86) Application\")\n";
608 stream
<< "!MESSAGE\n";
610 stream
<< "# Begin Project\n";
611 stream
<< "# PROP Scc_ProjName \"\"\n";
612 stream
<< "# PROP Scc_LocalPath \"\"\n";
613 stream
<< "CPP=cl.exe\n";
614 stream
<< "MTL=midl.exe\n";
615 stream
<< "RSC=rc.exe\n";
618 /////////////////////// Win32 Release target
620 stream
<< "!IF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release\"\n";
622 stream
<< "# PROP BASE Use_MFC 0\n";
623 stream
<< "# PROP BASE Use_Debug_Libraries 0\n";
624 stream
<< "# PROP BASE Output_Dir \"Release\"\n";
625 stream
<< "# PROP BASE Intermediate_Dir \"Release\"\n";
626 stream
<< "# PROP BASE Target_Dir \"\"\n";
627 stream
<< "# PROP Use_MFC 0\n";
628 stream
<< "# PROP Use_Debug_Libraries 0\n";
629 stream
<< "# PROP Output_Dir \"Release\"\n";
630 stream
<< "# PROP Intermediate_Dir \"Release\"\n";
631 stream
<< "# PROP Ignore_Export_Lib 0\n";
632 stream
<< "# PROP Target_Dir \"\"\n";
633 stream
<< "# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
634 stream
<< "# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2";
636 int n
= m_includeDirs
.Number();
638 for (i
= 0; i
< n
; i
++)
640 wxString includeDir
= m_includeDirs
[i
];
641 stream
<< " /I \"" << includeDir
<< "\"";
644 stream
<< " /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"__WINDOWS__\" /D \"__WXMSW__\" /D \"__WIN95__\" /D \"__WIN32__\" /D WINVER=0x0400 /D \"STRICT\" /FD /c\n";
645 stream
<< "# SUBTRACT CPP /YX\n";
646 stream
<< "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
647 stream
<< "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
648 stream
<< "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\n";
649 stream
<< "# ADD RSC /l 0x809 /d \"NDEBUG\"\n";
650 stream
<< "BSC32=bscmake.exe\n";
651 stream
<< "# ADD BASE BSC32 /nologo\n";
652 stream
<< "# ADD BSC32 /nologo\n";
653 stream
<< "LINK32=link.exe\n";
654 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";
655 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 tiff.lib ";
656 n
= m_extraLibs
.Number();
657 for (i
= 0; i
< n
; i
++)
659 wxString lib
= m_extraLibs
[i
];
660 stream
<< lib
<< " ";
663 stream
<< "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib,libci.lib,msvcrtd.lib\" /out:\"Release/" << m_targetName
<< ".exe\"";
665 n
= m_releaseLibDirs
.Number();
666 for (i
= 0; i
< n
; i
++)
668 wxString libDir
= m_releaseLibDirs
[i
];
669 stream
<< " /libpath:\"" << libDir
<< "\"";
671 n
= m_libDirs
.Number();
672 for (i
= 0; i
< n
; i
++)
674 wxString libDir
= m_libDirs
[i
];
675 stream
<< " /libpath:\"" << libDir
<< "\"";
680 /////////////////////// Win32 Debug target
682 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug\"\n";
684 stream
<< "# PROP BASE Use_MFC 0\n";
685 stream
<< "# PROP BASE Use_Debug_Libraries 1\n";
686 stream
<< "# PROP BASE Output_Dir \"Debug\"\n";
687 stream
<< "# PROP BASE Intermediate_Dir \"Debug\"\n";
688 stream
<< "# PROP BASE Target_Dir \"\"\n";
689 stream
<< "# PROP Use_MFC 0\n";
690 stream
<< "# PROP Use_Debug_Libraries 1\n";
691 stream
<< "# PROP Output_Dir \"Debug\"\n";
692 stream
<< "# PROP Intermediate_Dir \"Debug\"\n";
693 stream
<< "# PROP Ignore_Export_Lib 0\n";
694 stream
<< "# PROP Target_Dir \"\"\n";
695 stream
<< "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
696 stream
<< "# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od";
698 n
= m_includeDirs
.Number();
699 for (i
= 0; i
< n
; i
++)
701 wxString includeDir
= m_includeDirs
[i
];
702 stream
<< " /I \"" << includeDir
<< "\"";
705 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";
706 stream
<< "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
707 stream
<< "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
708 stream
<< "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\n";
709 stream
<< "# ADD RSC /l 0x809 /d \"_DEBUG\"\n";
710 stream
<< "BSC32=bscmake.exe\n";
711 stream
<< "# ADD BASE BSC32 /nologo\n";
712 stream
<< "# ADD BSC32 /nologo\n";
713 stream
<< "LINK32=link.exe\n";
714 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";
715 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 tiff.lib ";
716 n
= m_extraLibs
.Number();
717 for (i
= 0; i
< n
; i
++)
719 wxString lib
= m_extraLibs
[i
];
720 stream
<< lib
<< " ";
722 stream
<< "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib,libcid.lib,msvcrt.lib\" /out:\"Debug/" << m_targetName
<< ".exe\" /pdbtype:sept";
724 n
= m_debugLibDirs
.Number();
725 for (i
= 0; i
< n
; i
++)
727 wxString libDir
= m_debugLibDirs
[i
];
728 stream
<< " /libpath:\"" << libDir
<< "\"";
730 n
= m_libDirs
.Number();
731 for (i
= 0; i
< n
; i
++)
733 wxString libDir
= m_libDirs
[i
];
734 stream
<< " /libpath:\"" << libDir
<< "\"";
738 // stream << "!ENDIF\n";
741 /////////////////////// Win32 Debug DLL target
743 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
745 stream
<< "# PROP BASE Use_MFC 0\n";
746 stream
<< "# PROP BASE Use_Debug_Libraries 1\n";
747 stream
<< "# PROP BASE Output_Dir \"DebugDLL\"\n";
748 stream
<< "# PROP BASE Intermediate_Dir \"DebugDLL\"\n";
749 stream
<< "# PROP BASE Target_Dir \"\"\n";
750 stream
<< "# PROP Use_MFC 0\n";
751 stream
<< "# PROP Use_Debug_Libraries 1\n";
752 stream
<< "# PROP Output_Dir \"DebugDLL\"\n";
753 stream
<< "# PROP Intermediate_Dir \"DebugDLL\"\n";
754 stream
<< "# PROP Ignore_Export_Lib 0\n";
755 stream
<< "# PROP Target_Dir \"\"\n";
756 stream
<< "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
757 stream
<< "# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od";
759 n
= m_includeDirs
.Number();
760 for (i
= 0; i
< n
; i
++)
762 wxString includeDir
= m_includeDirs
[i
];
763 stream
<< " /I \"" << includeDir
<< "\"";
766 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";
767 stream
<< "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
768 stream
<< "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /o NUL /win32\n";
769 stream
<< "# ADD BASE RSC /l 0x809 /d \"_DEBUG\"\n";
770 stream
<< "# ADD RSC /l 0x809 /d \"_DEBUG\"\n";
771 stream
<< "BSC32=bscmake.exe\n";
772 stream
<< "# ADD BASE BSC32 /nologo\n";
773 stream
<< "# ADD BSC32 /nologo\n";
774 stream
<< "LINK32=link.exe\n";
775 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";
776 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 ";
777 n
= m_extraLibs
.Number();
778 for (i
= 0; i
< n
; i
++)
780 wxString lib
= m_extraLibs
[i
];
781 stream
<< lib
<< " ";
783 stream
<< "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib\" /nodefaultlib:\"libcid.lib\" /out:\"DebugDLL/" << m_targetName
<< ".exe\" /pdbtype:sept";
785 n
= m_debugLibDirs
.Number();
786 for (i
= 0; i
< n
; i
++)
788 wxString libDir
= m_debugLibDirs
[i
];
789 libDir
+= "DLL"; // Assume that we have e.g. Debug so make it DebugDLL
790 stream
<< " /libpath:\"" << libDir
<< "\"";
792 n
= m_libDirs
.Number();
793 for (i
= 0; i
< n
; i
++)
795 wxString libDir
= m_libDirs
[i
];
796 stream
<< " /libpath:\"" << libDir
<< "\"";
800 // stream << "!ENDIF\n";
803 /////////////////////// Win32 Release DLL target
805 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release DLL\"\n";
807 stream
<< "# PROP BASE Use_MFC 0\n";
808 stream
<< "# PROP BASE Use_Debug_Libraries 0\n";
809 stream
<< "# PROP BASE Output_Dir \"ReleaseDLL\"\n";
810 stream
<< "# PROP BASE Intermediate_Dir \"ReleaseDLL\"\n";
811 stream
<< "# PROP BASE Target_Dir \"\"\n";
812 stream
<< "# PROP Use_MFC 0\n";
813 stream
<< "# PROP Use_Debug_Libraries 0\n";
814 stream
<< "# PROP Output_Dir \"ReleaseDLL\"\n";
815 stream
<< "# PROP Intermediate_Dir \"ReleaseDLL\"\n";
816 stream
<< "# PROP Ignore_Export_Lib 0\n";
817 stream
<< "# PROP Target_Dir \"\"\n";
818 stream
<< "# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /YX /FD /c\n";
819 stream
<< "# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2";
821 n
= m_includeDirs
.Number();
822 for (i
= 0; i
< n
; i
++)
824 wxString includeDir
= m_includeDirs
[i
];
825 stream
<< " /I \"" << includeDir
<< "\"";
828 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";
829 stream
<< "# SUBTRACT CPP /YX\n";
830 stream
<< "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
831 stream
<< "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /o NUL /win32\n";
832 stream
<< "# ADD BASE RSC /l 0x809 /d \"NDEBUG\"\n";
833 stream
<< "# ADD RSC /l 0x809 /d \"NDEBUG\"\n";
834 stream
<< "BSC32=bscmake.exe\n";
835 stream
<< "# ADD BASE BSC32 /nologo\n";
836 stream
<< "# ADD BSC32 /nologo\n";
837 stream
<< "LINK32=link.exe\n";
838 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";
839 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 ";
840 n
= m_extraLibs
.Number();
841 for (i
= 0; i
< n
; i
++)
843 wxString lib
= m_extraLibs
[i
];
844 stream
<< lib
<< " ";
846 stream
<< "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib\" /nodefaultlib:\"libci.lib\" /out:\"ReleaseDLL/" << m_targetName
<< ".exe\"";
848 n
= m_releaseLibDirs
.Number();
849 for (i
= 0; i
< n
; i
++)
851 wxString libDir
= m_releaseLibDirs
[i
];
852 libDir
+= "DLL"; // Assume that we have e.g. Release so make it ReleaseDLL
853 stream
<< " /libpath:\"" << libDir
<< "\"";
855 n
= m_libDirs
.Number();
856 for (i
= 0; i
< n
; i
++)
858 wxString libDir
= m_libDirs
[i
];
859 stream
<< " /libpath:\"" << libDir
<< "\"";
863 stream
<< "!ENDIF\n";
866 /////////////////////// Source code for targets
868 stream
<< "# Begin Target\n";
870 stream
<< "# Name \"" << m_projectName
<< " - Win32 Release\"\n";
871 stream
<< "# Name \"" << m_projectName
<< " - Win32 Debug\"\n";
872 stream
<< "# Name \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
873 stream
<< "# Name \"" << m_projectName
<< " - Win32 Release DLL\"\n";
876 n
= m_sourceFiles
.Number();
877 for (i
= 0; i
< n
; i
++)
879 wxString sourceFile
= m_sourceFiles
[i
];
881 stream
<< "# Begin Source File\n";
883 stream
<< "SOURCE=.\\" << sourceFile
<< "\n";
885 stream
<< "!IF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release\"\n";
887 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug\"\n";
889 stream
<< "# SUBTRACT CPP /YX /Yc /Yu\n";
891 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Debug DLL\"\n";
893 stream
<< "# SUBTRACT BASE CPP /YX /Yc /Yu\n";
894 stream
<< "# SUBTRACT CPP /YX /Yc /Yu\n";
896 stream
<< "!ELSEIF \"$(CFG)\" == \"" << m_projectName
<< " - Win32 Release DLL\"\n";
898 stream
<< "!ENDIF\n";
900 stream
<< "# End Source File\n";
903 // The .rc file: assume it has the target name + rc extension.
904 stream
<< "# Begin Source File\n";
906 stream
<< "SOURCE=.\\" << m_targetName
<< ".rc\n";
907 stream
<< "# ADD BASE RSC /l 0x809\n";
908 stream
<< "# ADD RSC /l 0x809";
910 n
= m_resourceIncludeDirs
.Number();
911 for (i
= 0; i
< n
; i
++)
913 wxString includeDir
= m_resourceIncludeDirs
[i
];
914 stream
<< " /i \"" << includeDir
<< "\"";
918 stream
<< "# End Source File\n";
919 stream
<< "# End Target\n";
920 stream
<< "# End Project\n";
922 // Now generate the .dsw workspace file
924 wxString fullWorkSpaceName
= m_path
+ wxString("/") + m_projectName
+ ".dsw";
926 ofstream
stream2(fullWorkSpaceName
);
930 stream2
<< "Microsoft Developer Studio Workspace File, Format Version 5.00\n";
931 stream2
<< "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n";
933 stream2
<< "###############################################################################\n";
935 stream2
<< "Project: \"" << m_projectName
<< "\"=.\\" << m_projectName
<< ".dsp - Package Owner=<4>\n";
937 stream2
<< "Package=<5>\n";
941 stream2
<< "Package=<4>\n";
945 stream2
<< "###############################################################################\n";
947 stream2
<< "Global:\n";
949 stream2
<< "Package=<5>\n";
953 stream2
<< "Package=<3>\n";
957 stream2
<< "###############################################################################\n";
963 BEGIN_EVENT_TABLE(MyDialog
, wxDialog
)
964 EVT_BUTTON(wxID_EXIT
, MyDialog::OnQuit
)
965 EVT_BUTTON(ID_GENERATE_PROJECT
, MyDialog::OnGenerate
)
966 EVT_BUTTON(ID_GENERATE_SAMPLES
, MyDialog::OnGenerateSamples
)
969 // ----------------------------------------------------------------------------
971 // ----------------------------------------------------------------------------
974 MyDialog::MyDialog(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
):
977 LoadFromResource((wxWindow
*) NULL
, "project_dialog");
981 void MyDialog::OnQuit(wxCommandEvent
& event
)
983 this->EndModal(wxID_OK
);
986 void MyDialog::OnAbout(wxCommandEvent
& event
)
990 void MyDialog::OnGenerate(wxCommandEvent
& event
)
994 void MyDialog::OnGenerateSamples(wxCommandEvent
& event
)
996 char* dir
= getenv("WXWIN");
1000 wxTextEntryDialog
dialog(this, "Please enter the wxWindows directory", "Text entry", dirStr
, wxOK
|wxCANCEL
);
1001 if (dialog
.ShowModal() == wxID_OK
)
1003 if (wxDirExists(dialog
.GetValue()))
1005 // wxGetApp().GenerateSample("MinimalVC", "minimal", dir + wxString("/samples/minimal"),
1006 // wxStringList("minimal.cpp", 0));
1008 wxGetApp().GenerateSamples(dialog
.GetValue());
1012 wxMessageBox("This directory doesn't exist.");