There are those occasions when it is necessary to add an existing dialog from a CodeBlocks project. This tool adds a dialog the user selects to an existing project by copying the project and the dialog into memory. The CodeBlocks project is renamed to a .pbk file. The dialog file is then added to the project. The CodeClocks project file is modified to include the wxs, cpp and h (header file). The next invocation of the project and the newly added dialog is in place and ready for further development.
When the user clicks on the File menu item the following appears.
When the Add New Dialog option is selected the following process is presented to the user. The user will select an existing project file.
Next the user will select the desired dialog.
The project file is modified as depicted below.
[codesyntax lang=”cpp”]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_project_file> <FileVersion major="1" minor="6" /> <Project> <Option title="Tes03" /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> <Target title="Debug"> <Option output="bin/Debug/Tes03" prefix_auto="1" extension_auto="1" /> <Option object_output="obj/Debug/" /> <Option type="0" /> <Option compiler="gcc" /> <Option projectLinkerOptionsRelation="2" /> <Compiler> <Add option="-g" /> </Compiler> <Linker> <Add library="boost_system" /> <Add library="boost_filesystem" /> </Linker> </Target> <Target title="Release"> <Option output="bin/Release/Tes03" prefix_auto="1" extension_auto="1" /> <Option object_output="obj/Release/" /> <Option type="0" /> <Option compiler="gcc" /> <Option projectLinkerOptionsRelation="2" /> <Compiler> <Add option="-O2" /> </Compiler> <Linker> <Add option="-s" /> <Add library="boost_system" /> <Add library="boost_filesystem" /> </Linker> </Target> </Build> <Compiler> <Add option="`wx-config --cflags`" /> <Add option="-Wall" /> </Compiler> <Linker> <Add option="`wx-config --libs`" /> </Linker> <Unit filename="dlgEditCategories.cpp" /> <Unit filename="dlgEditCategories.h" /> <Unit filename="dlgLinkInfo.cpp" /> <Unit filename="dlgLinkInfo.h" /> <Unit filename="Tes03App.cpp" /> <Unit filename="Tes03App.h" /> <Unit filename="Tes03Main.cpp" /> <Unit filename="Tes03Main.h" /> <Unit filename="wxsmith/dlgLinkInfo.wxs" /> <Unit filename="wxsmith/dlgEditCategories.wxs" /> <Unit filename="wxsmith/Tes03frame.wxs" /> <Extensions> <code_completion /> <envvars /> <wxsmith version="1"> <gui name="wxWidgets" src="Tes03App.cpp" main="Tes03Frame" init_handlers="necessary" language="CPP" /> <resources> <wxFrame wxs="wxsmith/Tes03frame.wxs" src="Tes03Main.cpp" hdr="Tes03Main.h" fwddecl="0" i18n="1" name="Tes03Frame" language="CPP" /> <wxFrame wxs="wxsmith/dlgLinkInfo.wxs" src="dlgLinkInfo.cpp" hdr="dlgLinkInfo.h" fwddecl="0" i18n="1" name="dlgLinkInfo" language="CPP" /> <wxFrame wxs="wxsmith/dlgEditCategories.wxs" src="dlgEditCategories.cpp" hdr="dlgEditCategories.h" fwddecl="0" i18n="1" name="dlgEditCategories" language="CPP" /> </resources> </wxsmith> <debugger /> </Extensions> </Project> </CodeBlocks_project_file>
[/codesyntax]
Finally, the user is asked if the new project should be compiled?
Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.