Home |
Source Page |
Source PageWindow Builder organizes the application program possibly containing hundreds of unique application windows into unique modules. Each module corresponds to one window or dialog and produces one source file and one include file. The Source page of the Project window notebook control contains a PegTreeView depicting each of the modules included in the current project. Each top-level node of the PegTreeView control represents a top level class constructed with Window Builder. If you expand a top-level node, you will see the corresponding source and header file associated with that top level class. If you select a source module by left clicking with the mouse, the Target window will display the objects defined within that source module. The Target Window always operates on the selected module. If no module is selected, none of the Target Window editing commands are operational. Therefore the very first thing you must do after creating a new project is add at least one module to your project. You can at any time create a new module by selecting the Project | Add Module command. The right-hand side of the program window, the target window, is not operational until a module has been added to the project and selected. The Filename field allows you to specify the output filename for the source file Window Builder will generate for this new module. Any valid filename may be entered into this field. You do not need to specify an extension, as Window Builder will automatically write both a .cpp and a .hpp file for this module. The ClassName field allows you to specify a name for the PegWindow derived class you are creating, i.e. the name of the class which will define the window or screen you are developing. The Parameters field allows you to specify any user-defined parameters you would like to pass to the class constructor (in addition to the parameters Window Builder will always pass to the constructor). If you wish to pass extra parameters, you should type them on this line exactly as they should appear in the constructor prototype, i.e. Type-Name, Type Name, etc. for each parameter. The Startup Window checkbox specifies that this window will be the first displayed when your application executes. When this checkbox is selected, Window Builder automatically writes the PegAppInitialize function in this module such that this window is created and added to PegPresentationManager during program startup. The Base Class field allows you to specify which RTPEG-32 library class will be the base class for your new Window. This will usually be PegDialog, but could also be PegWindow, for example. The Overrides group is used to tell Window Builder which function of the base class will be overridden by the class you are defining. Only two options are supported by Window Builder (although you can, of course, add your own function overrides to the completed class). These are the Message function and the Draw function. The default setting of this field indicates that you will override the Message() function (to catch signals from child controls) but will not override the Draw() function. This is the most common situation. The Absolute Position checkbox allows you to use an alternate form for the class definition. Normally, Window Builder produces a class that accepts a left-top corner position as the first two incoming parameters. The window and all child controls are positioned relative to this left-top position. If desired, you can produce a class that is absolutely positioned, i.e. there is no top-left incoming parameters and the window and child controls use absolute pixel positioning. When you have completed entering the required information, a new object of the selected type is created and displayed in the Target window, and the new source file is added to the source page tree view control. To remove a source module and its associated objects from your project, select the source module in the tree control and press the Delete key on your keyboard. Following confirmation, the source module is removed from the current project. Note that the actual source files corresponding to the selected node are not deleted. Window Builder simply removes all information about the source file from the current project. To modify the parameters associated with a source module after the module has been created, you can right-click with the mouse on the module in the Source notebook page. This will bring up a dialog window allowing you to change the module name, file name, and other module parameters. Note that you are not allowed to delete sub-nodes from the PegTreeView displayed within the source page of the notebook. This is accomplished by individually deleting objects from within the Target window as described below.
|