Migrating changes

Editing dialogs or controls in an existing project may require code to be manually added to the source code, for example, to implement event handling for new controls.

PowerBASIC Forms offers several ways to generate a "fresh" code for the project, and this can be exploited for the purposes of merging portions of the newly generated code into an existing project. This is achieved by firstly opening and editing the existing project in PowerBASIC Forms (for example, adding controls, dialogs, etc), and then saving the project back to disk.

The source code is then opened in the PowerBASIC IDE, while still loaded in PowerBASIC Forms at the same time. A variation of this strategy involves creating a new project in PowerBASIC Forms, adding a new dialog, and finally adding controls to the appropriate type to the dialog. Either way, portions of the generated code can be extracted from PowerBASIC Forms and merged into the existing project loaded in the IDE.

The actual migration involves using the clipboard to copy portions of "fresh" code from PowerBASIC Forms into the PowerBASIC IDE. This can be performed in several ways:

  1. Use the File | Save As New option to create a second "fresh" set of project files. These can be opened in the PowerBASIC IDE, and portions copied from the fresh files, and pasted into the existing project files.

  2. Open the PowerBASIC Forms View menu, then select New DDT Code. This brings up the View New DDT Code window. From there, relevant portions of the code can be highlighted using a standard click+drag mouse operations, then copied to the clipboard with standard clipboard keystrokes, such as CTRL+C, or CTRL+INS. Finally, the clipboard data can be pasted into the existing project files.

  3. Open the File menu, then select Save To Clipboard - DDT and then choose from the various clipboard options. This method is ideal when creating a new dummy project, just for the purposes of extracting a portion of the generated code.

ALL

The entire code template if copied to the clipboard

Accelerators Only

The code necessary to add accelerator tables is placed in the clipboard, including the "helper" function AssignAccel. This function is required only once per application, regardless of the number of accelerator tables it contains.

Constants/Equates Only

All Constants and Equates for the project are placed on the clipboard. These include user-defined equates, and all PowerBASIC Forms generated equates for dialogs, controls, menus, etc.

Dialog Only

The clipboard is filled with a set of functions that create and populate the project dialogs and their controls. Each dialog is contained in its own function.

Menu Only

The clipboard is filled with a set of functions that create and populate the menus for the dialogs in the project. Each menu is contained in its own function.

Basic Integration Code Only

The clipboard is filled with a set of Callback Functions for the project dialogs.

 

See Also

Handling new vs. existing files

Saving a project

New PowerBASIC Forms projects

Parent and child dialogsNamed blocks

Opening existing project code

Viewing the project code

Importing code