Getting Started with PowerBASIC Forms

PowerBASIC Forms is a visual design tool for Rapid Application Development (RAD) that makes PowerBASIC For Windows development tasks faster and easier. PowerBASIC Forms enables developers to quickly and easily design the user interface for their applications. Easily "drag and drop" controls, select fonts, colors, styles, Create Menus, Version Resource Files, and set the tab order of controls. Historically, RAD systems have tended to emphasize reducing development time, sometimes at the expense of generating slow and bloated executable code. Not so with PowerBASIC Forms! It creates pure Dynamic Dialog Tools (DDT) code.

The easiest way to develop your Graphical User Interface (GUI) application is to start with PowerBASIC Forms. This way PowerBASIC Forms creates the entire application shell (all the necessary constants and equates, the PBMain function, and all the dialog Callback Functions) in PowerBASIC. In other words, just creating your form in PowerBASIC Forms writes all the BASIC you'll need for a complete compilable program. You'll only need to add your functional code. For instance you'll need to insert the code you want to have happen when the user clicks your OK button. It doesn't get easier than this!

PowerBASIC Forms is also a great learning tool. Look at the PowerBASIC source code it creates and see how to code DDT and Callbacks functions manually. PowerBASIC Forms will also create sample code for many controls, such as the TreeView control. This allows you to examine the PowerBASIC source code to see how to populate the control with text.

After creating and saving a Dialog (as a .BAS file) created with PowerBASIC Forms you can open the file up in PowerBASIC For Windows and add functionality, such as what occurs when a button is clicked. All compiling and editing is done within the PowerBASIC For Windows Integrated Development Environment (IDE). If you need to make changes to your applications Dialog just open up PBForms from the IDE by selecting "Tools | PowerBASIC Forms" from the PowerBASIC For Windows IDE menu. You can then make any necessary changes to your dialog(s). Simply save the changes you made in PBForms, then go back to the IDE. A prompt will inform you that the source file has been changed (by PBForms) and ask if you want to load these changes. Select yes to load the changes you made in PBForms.

The PowerBASIC source code PBForms generates contains named blocks (#PBFORMS metastatement blocks) to define sections of code that hold special meaning for PowerBASIC Forms, but are ignored by PowerBASIC during compilation. These blocks are marked with the #PBFORMS metastatement. Code within these blocks should never be manually edited. This ensures that any changes you make using PBForms do not interfere with the PowerBASIC source code you add manually.