4

The LA Fox Developer Newsletter
July 1995
From the Quill of Bill....
More GENSCRNX
by Bill Anderson
Here’s another trick that uses GENSCRNX. The
example below is specific to the Macintosh environ-
ment (Ed Leafe, Steven Black, Bruce Onder, does
this trick work for you?), though the same idea will
work under Windows.

In one of my applications I built a generic Find
screen. These screen(s) would have one or two
data entry fields, four pushbuttons and a list box.
The data entry field(s) were used as a filter enter-
ing “T” in the data entry field would just display
those results beginning with ‘T, etc. The four
pushbuttons are designated Find, New, Select and
Close. The Find button places the records which
match the filter condition into the list box. New
represents a new record. Select is used to select a
record from the list box (double clicking on an entry
in the list béx works as well), and the Close
pushbutton1is the bailout mechanism. So far, so
good.

When first entering this screen only the data entry
field(s), Find and Close pushbutton are enabled.
When Find button is pushed, the list box is enabled
(and filled) as well as the New and Select buttons.
This forces the user to browse the records before
selecting the New pushbutton. The Find button is
left enabled in case the user wishes to enter a new
filter condition. Again, it’s pretty straightforward.

Now the catch. The users wanted the ability to use
the Enter key to select the Find key before list box
was filled and have the Enter key work on the Select
pushbutton after the list box was filled ** with the
corresponding visual cues lOW, the Find key
should have the thick default border before the list
box was filled with the Select key having the thick
default border after the list box is filled -- a movable
visual default cue.

Here’s how I solved it:

First, the issues needed to make the Enter key work
is tangential to this discussion. Second, I only use
Chicago, 12 Normal for my pushbutton font and I
think I hardcoded the SYSMETRIC values for this
font. To make it work with different fonts would
require functions for these hardcoded values. Also
this would have to be modified for the Windows
platform because the pushbutton curvature is differ-
ent.

The Find and Select buttons should not be the
default pushbuttons in the Screen Builder -- neither
of them have the thick border. In the comment
button of the Find button I placed the following:


The Select button has the same function in the
comment snippet but it’s called FUNCTION
Def_Sskirt.
4
What does this function do? Depending on the
setting of the logical variable (Enable), a black border
is painted around the pushbutton or a border the
same color as the screen is painted around the
pushbutton. This function calls a UDF called SKIRT,
listed below. SKIRT is a common UDF.
(Con't page 5)
Page 4

4