Session #2
You should load the project into Turbo C++ and run it. The code should be easy to follow. Most of the added code pertains to making sure that changes made to a file are not accidentally discarded. This can happen, for example, if the user changes a file and then chooses File | New from the menu. The application must ask the user if the modified file should be saved before discarding the current file. There is a variable named Dirty_ which keeps track of the state of the text. This is how the rest of the code knows that the file has been modified. There are still things that need to be fixed before moving on (and are exercises for the reader).
Exercises
Some screenshots of the project at design time:
| The Form at Design Time | ActionList Editor | Menu Designer | Panels Editor |
|---|---|---|---|
|
|
|
|
| The application showing some information | Some components used to build the application |
|---|---|
|
|
| The main menu with images | A toolbar with images |
|---|---|
|
|
Additional Information: Project Settings
By default, Turbo C++ builds applications to use runtime libraries (RTL) and packages. Since most people don't have Turbo C++ installed on their computers, they won't be able to run the executables without these additional dependencies. The preferred way to build applications is statically, so that all necessary components and libraries are included in the executable. It will make the executable larger, but that's no longer an issue these days. To build static executables, you have to change two settings in the project options. From the menu in Turbo C++, go to Project | Options... or press Ctrl-Shift-F11 to open the Project Options dialog box. You may want to collapse the "C++ Compiler (bcc32)" options, as it takes up all of the dialog box's list space.
| Disable "Use dynamic RTL" under the Linker options | Disable "Build with runtime packages" under the Packages option |
|---|---|
|
|
| File size when using the RTL and packages | File size without the RTL and packages |
|---|---|
|
|
Yes, it's larger, but it will work on any computer now.