.

PowerBASIC Forms version 1.5

New Features

The Resize controls tool provides three options to resize controls uniformly. This tool examines the dimension(s) of the leading control in the selection group, and uses those dimensions to adjust the width, or height, or both width and height of the remaining controls in the selection group. This tool becomes available in the Tools menu once the selection group holds at least two controls.


The Align controls tool provides six options to uniformly align/reposition controls using methods that closely resemble text justification in a word processor. This tool examines the coordinates of the leading control in the selection group, and uses those coordinates to set the coordinates of the remaining controls in the selection group. The six alignment options feature Left-edge alignment, Right-edge, Top-edge, Bottom-edge, Horizontal Center, and Vertical Center. This tool becomes available in the Tools menu once the selection group holds at least two controls.

For example, using Left edge alignment on the controls in a selection group will reposition the controls so that their left edges line up to the left edge of the leading control. That is, all controls will be given the same horizontal coordinate as the leading control, but without affecting the size or the vertical coordinate of the controls. Similarly, Right edge alignment would result in the right side of the controls in the selection group becoming aligned with the right side of the lead control. Center alignment repositions the selected controls so they are vertically (or horizontally) "centered" relative to the leading control in the selection group.


The Space controls evenly tool repositions controls in the selection group so that the gap between each of the selected controls is as even or uniform as possible, either horizontally (across the dialog) or vertically (down the dialog). This tool calculates the distance between the two most widely separated controls in the selection group, calculates the best possible gap that can exist between each control, and then moves the controls. Controls are positioned to maintain relative tab order, with the exception of the first and last controls. For best results, edge-align the controls in the same plane before spacing them with this tool. This tool becomes available in the Tools menu once the selection group holds at least three controls.


The Arrange button controls tool repositions Button, ImgButton, and ImgButtonX controls in the selection group, ignoring all other types of controls in the selection group. Arrange buttons either distributes the buttons evenly across the bottom of the dialog, or it positions the first button near the top-right corner and proceeds to arrange the remainder in a downward direction. Provided the selection group contains at least one button control, this tool may be chosen from the Tools menu.


The Center in dialog tool enables a complete group of controls to be centered horizontally or vertically (or both) without disrupting the relative position of each control in the group. Hint: this tool is useful to polish up the final appearance of the dialogs in a project, ahead of final release. First choose the Select All (CTRL+A) function so that the selection group will contain every control on the dialog, then use the Center in dialog tool's Both option to neatly center all the child controls in one swift operation. This technique is often easier and faster at producing a tidy dialog appearance than can be achieved when adjusting the dialog size by eye. Provided the selection group contains at least one control, this tool will be available in the Tools menu.


Size grip behavior in design mode has been significantly revised to greatly improve accuracy when positioning and resizing controls with a mouse.


The resizing cursor is displayed when the mouse cursor hovers over selected controls (as opposed to showing only when a mouse button was depressed), resulting in improved interaction with ComboBox controls, etc.


Super-nudge mode extends the regular keyboard move/ resize operations to use grid-size increments (compared with single-unit increments in regular mode). Super-nudge mode is engaged by pressing and holding the SHIFT key down while using the regular arrow keys to move (and/or the CTRL key to resize) the controls in the selection group.


Move to (0,0) and Cancel options have been added to the auto-position "warning" dialog -- this dialog is displayed when auto-positioning code would result in the control extending beyond the edge of the dialog (clipped). Status bar controls are ignored when calculating the location of a control placed via auto-positioning.


Clipboard paste options now include an Always paste at (0,0) option, and a Paste Below Selected Control option. When a selection group is copied to the clipboard, the left-most control of the group is used to determine the origin of a subsequent paste operation (as opposed to using the lead controls position for the origin). Pasting below a selected Combo Box now pastes below the visible portion of the control instead of the drop-down portion.


The new View DDT Code button on the main toolbar permits instant access to the DDT Code Viewer window.


The Code Viewer now displays code using the keyword capitalization setting used by the PowerBASIC for Windows IDE. The Code Viewer also features improved scrolling with the top line number displayed in a popup dialog resembling a ToolTip.


The Code Viewer displays #PBFORMS COPY blocks in light gray, and all syntax highlighting is disabled if the PC is using high-contrast mode.


The Control/Dialog Properties dialog is now movable and resizable, and the tab order of the controls on the tab pages has been improved. PowerBASIC Forms now tracks and stores any changes made to the positions/sizes of those dialogs, and automatically uses the revised position/size for subsequent launches.


By default, the Menu Editor, Version Editor, and Tab Editor are displayed as centered dialogs, however, these dialogs may now be moved freely to other positions on the screen. PowerBASIC Forms automatically tracks the new positions of each dialog, and automatically uses the new positions for each subsequent launch.


Import from Clipboard dialog now includes a Refresh button to reload the clipboard contents.


Test mode now supports dialogs with the %WS_CHILD style.


Test mode has improved support for controls with the %WS_EX_TRANSPARENT extended style.


New option: Display on reload enables or disables the project statistics display when reloading a project.


New option: Reload previous file at start can be a time-saver when working constantly on a single project. Projects reloaded from the Most Recently Used (MRU) section of the File menu will load up and display same dialog as when the file was saved/closed last.


New option: Remember dialog after reload reselects the current dialog after reloading a project.


PowerBASIC Forms now supports the status bar control. Only one status bar control can be added to a dialog. The status bar control automatically displays a size grip on the lower-right corner if the parent dialog includes the %WS_THICKFRAME style (which makes it resizable). If the dialog contains both a menu and a status bar, the prompt string of a highlighted menu item will be automatically displayed in the status bar control via a %WM_MENUSELECT handler. Prompt strings will also be displayed in test mode.


PowerBASIC Forms now supports transparent background color for most types of controls. Control color properties can also be set for a wider range of standard and common controls, including Progress, ListView, TreeView, DateTime, Month, RichEdit, and Statusbar.


The code generation engine now offers improved code and comment block formatting, along with improvements in whitespace to increase readability of generated source code. Long source code lines are also wrapped with improved precision.


While working with existing projects, the code generation engine inserts new CASE message handler blocks for each control added to a dialog. These handlers are inserted at the top of the SELECT CASE AS LONG CBCTL block, which must be located within the CASE %WM_COMMAND handler block. Similar CASE statements may also be inserted for existing controls, if an associated CASE statement appears absent. If code comments are enabled, the inserted CASE statements will have a leading comment line that denotes the time and date of the insertion, plus a trailing comment line indicating the end of the insertion.


In Callback Functions, the code generation engine positions variable declaration statements within the CASE block that uses the variable, instead of amassing all declaration statements at a central point at the top of the Callback Function block. This strategy enables the code generator to insert complete CASE handler blocks as a single insertion of code, and similarly, it allows the programmer to copy and paste complete CASE blocks with a single clipboard operation.


Depending upon the requirements of each dialog, the code generator engine may add and/or insert a selection of new CASE handler blocks at the top of the SELECT CASE AS LONG CBMSG block. The following standard window/dialog message handlers (and support code) are currently supported by PowerBASIC Forms and can be inserted as required: _%WM_INITDIALOG, %WM_DESTROY, %WM_DROPFILES, %WM_MENUSELECT, %WM_NCACTIVATE, and %WM_SIZE. Note that the code generator engine cannot insert a new message handler if that message handler already exists in the dialogs Callback Function.


A dialog with the extended style %WS_EX_ACCEPTFILES enables it to receive files via the Windows Drag-n-Drop interface. In this situation, the code generator engine adds/inserts CASE %WM_INITDIALOG and CASE %WM_DROPFILES message handlers (with the appropriate support code in each handler) into the Callback Function used by the dialog. The code in these handlers will activate the Drag-n-Drop interface for the dialog, and process the names of the file(s) that are dropped onto the dialog.


The %WM_NCACTIVATE handler and support code is inserted into all new dialogs, and inserted into existing projects that lack the handler. This message handler block maintains and restores control focus after task-switch operations. This code in this handler uses a STATIC variable to store the handle of the control that has focus at the point the application deactivates, and it restores control focus when the application is activated again.


The %WM_MENUSELECT handler block is created/inserted into the Callback Function of each dialog that contains both a status bar control and a menu. As menu items are highlighted by the user, the default %WM_MENUSELECT handler code will automatically display the menu items associated Prompt string in the status bar control.


The %WM_SIZE handler block is created/inserted into the Callback Function of dialogs that contain a status bar control. This handler passes the %WM_SIZE message to the status bar control so that it will update its size and position within the dialog.


All %WM_COMMAND handlers for Button controls with an ID Name = %IDOK or %IDCANCEL, and a ID Value =1 or 2 (respectively) will contain a DIALOG END statement, as opposed to a MSGBOX statement.


%WM_COMMAND handlers for Menu items with an IDNAME = %IDCANCEL and ID Value = 2 will contain a DIALOG END statement instead of MSGBOX.


New option: %USEMACROS instructs PowerBASIC Forms to generate the project source code so that it uses the various Macros in the .INC files sets, rather than the traditional Function wrappers. This option mainly affects common control code.


Generated source code is saved to disk using the same keyword capitalization setting as the PowerBASIC for Windows IDE.


New option: Include Code Comments enables or disables code comment generation in new projects, in addition and code inserted into existing projects.


New option: Constants (equates) may appear in the generated code in unsorted order (the default), or they may be sorted by ID Name, or sorted by ID Value, as set in the Options dialog. ID Values in the definition statements is now right justified for improved readability, and obsolete/unused equate definition statements are flagged with a brief comment: '*


MSGBOX statements in new project code will display modally, due to the %MB_TASKMODAL flag.


The CREATED named-block header includes version number in format "v#.##". PowerBASIC Forms produces a warning if a project seems to have been created with a more recent version of PowerBASIC Forms.


A new named-block titled CLEANUP is placed after the DIALOG SHOW statement in generated code, and inserted into existing projects when they are saved. Code in the CLEANUP block releases resources associated with customized control fonts, and the code is automatically updated as font requirements change.


Projects containing a RichEdit control now use an updated version of PBFORMS.INC which dynamically loads the very latest version of the RichEdit control that is installed, up to and including Windows XP's RichEdit50W control.


If Code Comments are enabled, generated code will include a commented %WS_GROUP "flag" ahead of any control with the %WS_GROUP style.


%DM_SETDEFID support is added to each dialog that includes a default button.


ID Names and Captions derived from class names with numeric suffixes and custom controls will now include an underscore to separate the class name from the ID Value. For example, %IDC_MSCTLS_STATUSBAR32_2, %IDC_CUSTOMCONTROL_1, etc.


The %DS_CENTER style is automatically assigned to loaded/imported dialogs with an X origin of -1, and to dialogs where both X and Y origins are zero. In addition, origin values for all %DS_CENTER dialogs are adjusted during loading/importing to ensure all such dialogs remain visible if the %DS_CENTER style is subsequently removed.


The sample code functions included in generated code have been updated. The changes include formatting improvements, code refinements, and optimizations, etc.


Corrections/Changes to Existing Features

PowerBASIC Forms About dialog has been updated dramatically!


Select Dialog (SelDlg) dialog now works correctly in all display and font combinations, and the SelDlg button on the Toolbar now includes a drop-down dialog selector menu.


When editing a new project, selecting the Open File in IDE menu item (Tools menu) will present a SAVE AS dialog before launching the PowerBASIC IDE.


Save As and Save As New dialogs use the current file/path as the default, and offer Platform 5 functionality where possible.


The Toolbox is now resizable, and offers its own large buttons option in the Options dialog (independent of the Toolbar button size).


When visible, the Toolbox is maintained as a top-most window (above the design-mode dialog). Selections are now automatically canceled if a task-switch or other mode change occurs. ToolTips for both the Toolbox and main Toolbar also maintain topmost settings.


The Options dialog has been extended to three pages: page one deals with IDE behavior; page two covers code generation options; page three handles ID Prefixes. The Options dialog now includes a help button in the caption for improved UI consistency.


Using the keyboard, Test mode can be both started and stopped by the CTRL+T accelerator, even if the design mode dialog defines CTRL+T in its accelerator table. Test mode can also be canceled by pressing either the ENTER key or the ESCAPE key (in addition to clicking on the Exit Test Mode button, etc).


If a keyboard accelerator is used to trigger a notification message box in test mode (i.e., for a button control or menu item), the caption of the message box will indicate the use of the accelerator.


The keyboard Context key displays the context-menu of selected control(s) in design mode.


Combo boxes used in PowerBASIC Forms own dialogs and windows utilize Extended UI mode. In extended mode, the first press of the either the cursor Up or cursor Down keys will open the drop-down list (as opposed to the unintuitive F4 key used in standard-mode). To add extended-mode operation to combo boxes in your own programs, just send a %CB_SETEXTENDEDUI message to the control at run-time, with CBWPARAM=1 and CBLPARAM=0. The CASE %WM_INITDIALOG message handler is usually the best location from which to send this kind of message.


PowerBASIC Forms own menus and popup menus now display bitmaps for many menu items. Menu bitmaps can be disabled or enabled through the Options dialog.


Keyboard accelerators now work with menus in Test Mode even if the dialog has no child controls.


In design mode, selecting a control with the TAB key always brings it to the foreground to ensure it is visible. SHIFT+TAB support has also been improved.


When deleted, menu prompt strings and image files are now removed from the associated resource file.


Multi-line menu handling is improved for Dialog resizing operations in design mode.


Dialog and control fonts are now parsed correctly when .BAS projects are loaded/reloaded. The FONT block in a DIALOGEX structure is now imported correctly.


Resource files containing embedded TAB characters and escaped-quote characters in string tables may be imported. PowerBASIC Forms also offers improved support for escaped-characters that use octal notation.


Labels can show %SS_SUNKEN style in design mode.


Button controls in imported code get %BS_CENTER and %BS_VCENTER styles if the controls are using just %WS_TABSTOP, or no styles at all. Buttons support %BS_MULTILINE in design mode.


%BS_AUTORADIOBUTTON style removed from Button, ImgButton, and ImgButtonX controls due to conflicts with the supposedly obsolete %BS_USERBUTTON style.


The ListBox control styles %LBS_STANDARD, %LBS_SORT, and %LBS_NOTIFY now interact to clarify Windows actual behavior with these styles. For example, removing %LBS_SORT is only effective if %LBS_STANDARD is also removed, etc.


The IP Address control now supports a custom font, and the font remains consistent in design-mode.


The default width of a Spin Control is now 8 dialog units, matching Windows automatic resize behavior.


The ListView control is displayed correctly in all modes, such as %LVS_REPORT and %LVS_NOSCROLL.


ListView Styles list now uses radio controls to select the View mode, and %WS_EX_TRANSPARENT mode is now supported.


The Animate and Progress controls no longer include font options in their respective Properties dialogs.


Animate controls now include the %ACS_CENTER style by default, which enables the control to be resized independently of the animation size.


The default RichEdit control styles now includes %WS_EX_CLIENTEDGE.


Open Image now defaults to displaying both *.BMP and *.ICO files, and defaults to Zoom mode.


The Open Image Preview window displays the image size in both Pixels and Dialog Units, and image controls are now redrawn correctly when the image is changed.


Attempting to duplicate an existing ID Value in the Properties dialog or ID Editor produces a warning message.


PowerBASIC Forms design mode also offers significant improvements in speed and flicker reduction when resizing/moving multiple controls using the keyboard. This is primarily achieved by hiding all size grips in the selection group at the point where a cursor arrow key is held down to produce a continuous resizing/moving operation (i.e., utilizing the keyboard auto-repeat mode). The resizing/moving operation ceases when the cursor arrow key is released, and the Size grips are redisplayed automatically.


The ID Editor has been extended to include a Prune Unused IDs function (CTRL+P). While similar in concept to the Order by Use function, Prune Unused IDs deletes unused IDs without altering the relative position of the remaining ID Names in the project.


The ID Editor's context-menu now includes an explicit Close function to complete the has also been added to the


The ID Editor now displays up to 25 characters of menu strings, image file names, etc.


The ID Editor identifies ID Names that are only referenced in user-code in a project, and the ID Editor actively prevents the destruction of these ID Names to avoid compile-time errors.


The ID Editor appends an asterisk to resource names listed in the Accelerator, Dialog, and Menu columns if the ID Name is referenced more than once by that resource. In the past, previous version (the resource name could appear repeatedly over and over again. This reduction in clutter helps isolate the so that the resource names helps reduce the contents of those columns so that they contain only unique


If a Matrox(tm) dual-display graphics card is detected, PowerBASIC Forms can optionally disable the Matrox PowerDesk CenterPOPUP mode. If left enabled, CenterPOPUP can interfere with resizing and positioning operations in design mode.


. .