Home |
Source Code Generation |
Source Code GenerationThe final goal of running Window Builder is to produce the C++ source code you will use to display your application screens. You will need to edit and add your own program logic to the source files produced by Window Builder. Most significantly you will need to add program logic to catch signals generated by your child controls. You may also need to make any number of other additions and changes to the source files produced by Window Builder. At the same time, you will want to be able to run Window Builder again and again to modify your screens and update the source files without losing any of your hand-coded changes. This is not difficult to do as long as you understand how Window Builder updates your source files and follow a few simple rules. When you instruct Window Builder to produce/update the source files using the Project | Update | Source command, Window Builder first looks to see if the source file already exists. If it does, Window Builder enters Merge Mode. In Merge Mode, Window Builder is very careful not to lose any of your custom modifications. Window Builder will find and re-write the section of the source file delimited by the start of the constructor and the comment line which reads: /* WB End Construction */ To avoid losing your changes, never make any manual edits between the start of the class constructor and this comment delimiter. Window Builder also searches for the Message() member function, if present, and updates this function to contain any new SIGNAL cases not already present. Window Builder will NOT remove case statements from your Message function, even if the control which generated a specific SIGNAL is no longer a child of the window. In short, deleting obsolete sections from your source files is your responsibility; in the interest of safety Window Builder will not delete source lines from your Message function. Any and all code outside of the class constructor and Message function is maintained without modification during the source code merge process. That is, any other editing that you have done will be preserved entirely during the source file update process.
|