801.TXT
=====================================================================
Working With Forms in R:BASE 5.0
=====================================================================
PRODUCT: R:BASE VERSION: 5.X
=====================================================================
AREA : Forms CATEGORY: Forms, Reports & Labels
=====================================================================
Forms in R:BASE 5.0 have a whole new look. Now you can use fonts in
addition to colors to emphasize fields and add interest to your
forms. Your old forms will run and look pretty much as they did in
earlier versions of R:BASE. When you modify an existing form or build
a new form in 5.0, you can change the fonts, add colors to field
labels, and place Windows style lines and boxes.
Designing a Form
You can create forms quicker and easier with the new Form Designer.
It's easy to change the look of your form by dragging and dropping
fields using the mouse. You can't move multiple fields at one time
yet_that'll be in the next version. A form is still divided into 5
pages or screens for you to work with.
Text is no longer typed directly onto a form. Instead, you place the
text as a field. The text box field has font and color capabilities
just like the column and variable fields making it easy to
differentiate text and titles. You can right click on a highlighted
field to open a pop-up menu with formatting options for fonts and
colors.
With the ability to use different fonts and sizes, fields on a form
are no longer located using column and row coordinates. The concept
of character position by columns and rows is relevant to a DOS
character based interface, not to a Windows interface. Each character
no longer uses one space or column. Proportional spaced fonts and
different sized fonts mean that different characters take up a
different amount of space on the screen. For example, an l takes up
less space than a w. Instead of a column and row position displayed
on the status bar, you'll see the coordinate position and size of the
located field based on pixels. Use the pixel coordinates and the grid
to line up fields placed on the form.
The X, Y coordinates locate the upper left corner of a selected field.
The X coordinate is the horizontal position, the number of pixels
from the left edge of the form. The Y coordinate is the vertical
position, the number of pixels from the top edge of the form. The cx,
cy coordinates indicate the size of the selected field. The cx
coordinate is the width of the field, the cy coordinate is the height
of the field.
Placing Text on the Form
All text on a form in R:BASE 5.0 is placed in a text box and located
just like a column or variable. The text is left justified in the
box. You can drag the corners of the box to resize it, and use the
grid and snap features to line up text. As you change the font or
pitch size, the box is automatically resized. The text displays
WYSIWYG_what you see is what you get. To remove white space, resize
the box to fit more closely around the text.
Placing Lines and Boxes
Certain features from DOS versions of R:BASE do not translate well to
the Windows version. For example, lines in a form from the DOS
version of R:BASE were created by placing line draw characters on the
form just like text was placed on the form by typing letters on the
form. When this form is opened in R:BASE 5.0, each space in a
vertical line becomes a separate field. Therefore, a DOS-style line
that is 20 characters high becomes 20 fields in an R:BASE 5.0 form.
When you modify a form created with an earlier version of R:BASE, you
are asked whether you want to remove these DOS style lines_by doing
so, you free up system resources needed to accommodate the extra
fields. Choose options from the Layout menu to draw Windows-style
lines and boxes. The line or box is placed in the upper left corner
of the form. Click on the object and move it to the new location,
then drag the corners of the object to change its size. You can also
use boxes for shading fields. For example, draw a box (choose Layout:
Draw Box), change its color (choose Layout: Format Field Color), and
place it under the field (choose Layout: Send to Back).
Place a box and set the background color to black. Move the box
slightly to the right and lower than the field. Choose Layout: Send
to Back to place the box under the field.
The column or variable field.
Boxes can placed in layers. Place the largest box first. When the
form is run, the boxes are drawn in the order they were placed on
the form.
Running a Form
You will notice some differences when running a form. For example,
the menus you see when running a form are different. You now have an
Edit menu with cut, copy, and paste capabilities. The Add and Edit
menus have been combined with the Go to menu into a Forms menu. When
you customize the menus in your form, you change the options on the
Forms menu.
Field pop-up menus are different also. They'll always come up as
black text on a white background. The highlight color is set by the
Windows Control Panel, so it can vary. Select an item from a field
pop-up menu using the keyboard and then [Enter], or by clicking on
a item with the mouse. When you click on an item in a pop-up menu
with the mouse, the item is immediately selected and the menu closed.
In addition to the menu differences, there are some hot key
differences when running a form. For example,
The zoom key is now [Shift][F2], the old key,
[Shift][F4], tiles the open windows.
Press [F2] to add a new row, the old key, [F10] is the
Windows key to take you to the main menu.
Press either [Tab] or [Enter] to move between the fields in a form.
Press [Shift][Tab] to move backwards between fields.
Pressing [Enter] on the last field of a form no longer takes you to
the Forms menu, it adds the row and brings up the next row for
entry.
For a list of the available hot keys, press [Shift][F1], then click
the Hot Keys button.
Questions about Forms
We have compiled a list of questions about designing and using forms,
and about differences with earlier versions of R:BASE.
Question: I made a new form, and now I can't figure out how to save
the form and exit the Form Designer. I choose Exit from the File menu
and it exits me from R:BASE 5.0.
Answer: The Form Designer is an MDI child window within R:BASE 5.0.
To save a form, select Save Form from the File menu. To leave the
Form Designer, double click on the system menu for the Form Designer
window. You will be prompted to save or discard form changes when you
close the window.
Question: A single-table entry form works differently than it did
4.5++. When I press [Enter] from the last field of the table, the
menu does not appear. Instead, the row is added and a new blank row
is presented for entry.
Answer: In Windows, pressing the [Enter] key indicates completion.
You can move between fields by pressing either the [Enter] or the
[Tab] keys, but on the last field, pressing [Enter] adds the row.
Question: Pressing [Shift][F4] no longer works to zoom in on a note
field.
Answer: [Shift][F4] is the standard Windows hot key to tile open
windows. Press [Shift][F2] to zoom in on text and note fields in
forms and in the Data Browser. The Zoom feature now takes you into a
viewer window where you have full search and replace capabilities
in addition to editing.
Question: In a form, I zoomed in on a note field and the form went
away. The field expanded to cover the area encompassed by the form.
I expected the field to expand on top of the form with some of my
form still visible.
Answer: When you zoom in on a field in a form, a modal viewer window
is opened. You cannot access other fields in the form until you
finish looking at or editing this zoomed field.
Question: My forms always take up the full screen and I can't resize
the window to make it smaller. I can't bring up more than one form at
a time, either.
Answer: By default, forms open maximized and modal. You must complete
entering or editing data before doing any other action in the
database. This ensures compatibility with existing applications. You
can open a form from the R> prompt as non-modal and thus in a sizable
window. To run a form as non-modal, use the MDI keyword instead of
the USING keyword. For example, enter one of the following commands
at the R> prompt:
EDIT MDI custform
ENTER MDI custform
Question: I have forms where I used EEPs to allow my users to click
on a field with the mouse and select the next row or the previous
row. These EEPs aren't working the same way any more; they only move
forward or backward for one row.
Answer: You must add the command SKIP TO fieldname1 to the EEP. In
R:BASE 5.0, the mouse can now be used to place the cursor inside a
field for editing. In previous versions, the mouse selected a field,
but to move around in the field you could only use the arrow keys.
Now that the mouse can be used to move around inside a field, adding
the SKIP TO command moves the cursor out of the field running the
next row EEP and allows you to use the EEP to scroll through many
rows.
Question: My EEPs that call a form-in-a-form are working differently.
I am getting exited from the first form when I shouldn't. The EEP
checks for the [Esc] key and that seems to be where the problem is.
The EEP thinks I press [Esc] when I didn't.
Answer: In 4.5++, when you left a form, there were two keystrokes
involved. First, [Esc] was pressed to go to the menu, then [Enter] to
leave the form. In R:BASE 5.0, pressing [Esc] immediately leaves the
form. If you are checking keystrokes using the LASTKEY function, the
EEP may see an [Esc] as the last key pressed instead of an [Enter]
when leaving the form-in-a-form and executing differently. Add a SET
VAR command at the end of the EEP to reset the LASTKEY variable to
[Enter].
Question: I used to be able to locate and define a variable at the
same time when creating a form. I can't do that anymore.
Answer: In R:BASE 5.0, you can be working in the Forms Designer and
the R> prompt at the same time. Switch to an R> prompt window, define
your variable there, and then place it on your form.
Question: When creating a form, pressing the [Shift][F4] key no
longer works to edit an entry/exit procedure from the Field Settings
menu.
Answer: In R:BASE 5.0, you can be working in the Forms Designer and
the Text Editor at the same time. Open the Text Editor as another
window and create or edit your entry/exit procedure code.
Question: When I define a new pop-up menu in a form, the columns are
not placed on the menu in the order I select them. It looks like they
are placed in the order they appear on the menu. How can I get them
in a different order?
Answer: By default, the columns are listed in the order they are
defined in the table. The columns are placed based on the order in
the list, not on the selected order. To change the order, edit the
Menu Values field after selecting the columns for the menu. You might
also notice this column order when selecting columns for a quick form
or report.
Question: I created a form in my test database and now I want to
transfer the form to my production database. I unloaded the data from
the new system table, SYS_FORMS2, but when I try to load the form
data into the new database, I get an error message about "file not
found."
Answer: The data for new forms is stored as a VARBIT data type. When
VARBIT data is unloaded, it is unloaded into a separate file from the
unload file named in the OUTPUT command. The filename is the same and
the extension is .LOB. You must have both files to transfer a form
between databases.
Question: Is there any way other than setting colors or putting boxes
around every single field to make the fields stand out more when
running the form?
Answer. A new Microrim variable, MICRORIM_FIELD_BOX, places a box
around each field when a new form is run. Simply set the variable to
an integer value, for example; SET MICRORIM_FIELD_BOX = 1.
Question: Sometimes when I get an error about an invalid expression
in my form, the form opens in the Forms Designer and I can fix the
error, other times I get a message saying R:BASE is unable to open
the form and the form does not open in the Form Designer. What is the
difference?
Answer: Forms created in earlier versions of R:BASE are converted
when they are first opened in the R:BASE 5.0 Forms Designer. An old
form cannot have any errors in it. If any errors, such as undefined
variables, are detected, you get the message "Unable to open form."
The Form Designer can modify a new form that has errors in variables.
Question: I modified an old form in 5.0, but now want to go back to
my original 4.5++ form. Is my original form completely gone?
Answers: Forms created or modified in R:BASE 5.0 are stored in a new
system table, SYS_FORMS2. These forms are differentiated from forms
created in earlier versions of R:BASE that are stored in the system
table SYS_FORMS. Deleting a form through the Object Manager deletes
both the new and old copies of the form. To delete just the new copy
of a form, delete it at the R> prompt using the command DELETE ROWS
FROM SYS_FORMS2 WHERE SYS_FORM_NAME = 'formname'
Question: When I set the font for a field in a form, the current font
is not displayed. The space where it would normally appear is blank.
Answer: The default font for text and fields on a form is Helvetica.
If your installation of Windows does not have this font, the font
selection box displays a blank for the current font. After selecting
a different font from the list box, that font name is then displayed
in the font selection box.