Compiling the Sample

team bbl


You can compile your project from within DialogBlocks for a range of popular compilers including Visual C++, Borland C++, GCC, MinGW, and Digital Mars C++. DialogBlocks lets you to add as many configurations as you want, each based on a particular compiler. You will typically have debug and release configurations for each compiler you use. You could have separate configurations for different versions of wxWidgets, too.

The Acme sample has several configurations, one of which you can select via the second drop-down list on the toolbar. You can add more by clicking on the Configuration panel on the settings dialog (Figure C-2) and clicking on Add. Or, to quickly add standard Debug and Release configurations, click on Standard, and choose a compiler (Figure C-3). Configuration properties can be edited in the scrolling property panel: changing a high-level property (such as Build Mode) can change the default value for a low-level property (such as Preprocessor Flags).

Figure C-2. DialogBlocks configurations dialog


Figure C-3. DialogBlocks Standard Configurations Dialog


Before compiling, you'll need to set up some paths: click on the Paths panel on the settings dialog (Figure C-4) and browse for the top-level path for the appropriate compiler variable, such as MINGWDIR or MSVCDIR. (This is not necessary on Linux or Mac OS X.) Also specify the wxWidgets source tree for WXWIN.

Figure C-4. DialogBlocks paths dialog


When you've selected the appropriate configuration in the main DialogBlocks toolbar, you can choose Build wxWidgets on the Build menu to first make libraries that are consistent with the project configuration. This will take some time. On Windows, the build will be done in build\msw in the wxWidgets tree, and on Linux and Mac OS X, it will be done in a build directory under the wxWidgets tree. (If you need to stop a GCC build of wxWidgets, you can restart it manually by changing directory to the build directoryfor example, GCCDebugGTK2and typing make.)

Then click on the Build Project menu item (or F8) to build the Acme project. If all went well, you can click on Run Project (or F9) to run the application.

When run, the Acme project shows one of its dialogs by virtue of the Main Window property of the AcmeApp element. You can try changing this property to ID_FRAME and rebuilding to show the frame as the main window instead.

    team bbl



    Cross-Platform GUI Programming with wxWidgets
    Cross-Platform GUI Programming with wxWidgets
    ISBN: 0131473816
    EAN: 2147483647
    Year: 2005
    Pages: 262

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net