The components of an IBM Common User Access (CUA) border include a title bar and a window border. The title bar can contain a system menu button, window-sizing buttons, and a title. In Vermont Views, the CUA title bar is placed in the form window's top border.
If you specify CUA system menu options, a system menu button is added to the title bar. Users can then select this button to display a pull-down menu containing actions that can be applied to the data form window. Vermont Views supports all of the following CUA-defined actions: Restore, Move, Size, Minimize, Maximize, and Close.
You can also add window-sizing buttons to the title bar that allow users to mimimize, maximize, and restore a window without accessing the system menu.
Users can access the title bar buttons using the form navigation keys (arrow keys, Tab, and Shift-Tab, by default) or the mouse (PCDOS only).
To add a CUA border to a data form, use the following steps:
Step 1: Include the CUA border header file vv_cuabd.h.
To add a CUA border to a data form, you must #include vv_cuabd.h in all modules that use CUA borders and in the main module before vv_main.h.
Step 2: Define a data form with a border.
Create a data form with a border. Do not use the border style BDR_NULLP. See Chapter 5, "Using Designer Data Forms," and Chapter 6, "Writing Forms in Code," for more information.
Step 3: Define the title bar with sfm_cuabdr().
Add a CUA border title bar to a data form with the set form CUA border function sfm_cuabdr():
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following explains what to specify for each argument:
menuitems: Specify the menu items to place in the CUA border system menu. Multiple items can be specified with the bitwise OR operator "|". If any items are specified, a system menu pushbutton is added to the top left corner of the CUA border. The available CUA menu items are listed below in the order that they will appear in the system menu:
| CUA_RESTORE | "Restore" | for restoring a form to its previous size and position |
| CUA_MOVE | "Move" | for moving the form with the keyboard. |
| CUA_SIZE | "Size" | for resizing the form with the keyboard. |
| CUA_MINIMIZE | "Minimize" | for minimizing a form |
| CUA_MAXIMIZE | "Maximize" | for maximizing a form. |
| CUA_CLOSE | "Close" | for quitting the form. |
| CUA_ALL | Place all of the system menu items in the system menu. | |
| CUA_NONE | Do not display a system menu button. | |
menuact_att: Specify the logical attribute to use when a system menu field is active.
menu_att: Specify the logical attribute to use to display the system menu.
mm_buttons: Specify one of the following:
| CUA_MINIMIZE | To display a minimize button. |
| CUA_MAXIMIZE | To display a maximize button. |
| CUA_ALL | To display both a minimize and a maximize button. |
| CUA_NONE | To display neither a minimize nor a maximize button |
The minimize and maximize pushbuttons are added to the top right corner of the CUA border.
act_att: Specify the logical attribute to use when a CUA border pushbutton is active.
inact_att: Specify the logical attribute to use when a CUA border pushbutton is inactive.
titlep: Specify a pointer to a null-terminated string containing the title text. The title is placed in the center of the title bar.
title_att: Specify the logical attribute to use for the CUA border title.
dfmp: Specify a pointer to the data form.
sfm_cuabdr() returns 1 on success and 0 on failure.
To remove a CUA border from a data form, specify CUA_NONE for menuitems and mm_buttons, and NULLP for titlep.