The information in this article applies to:
- Microsoft Visual FoxPro for Windows, versions 3.0, 5.0
- Microsoft FoxPro for Windows, version 2.5
SUMMARY
In some cases, you may want to use a screen other than a thermometer
bar to notify the user to wait while some commands are being executed.
The procedure below, which is divided into three parts, creates a
window that specifies what commands are being executed and animates a
wedge moving inside a circle. After all the commands are executed, the
window is cleared.
MORE INFORMATION
Creating the Bitmaps
- In the Accessories group in Program Manager, open Paintbrush.
- From the Options menu, choose Image Attributes.
- Set Width and Height to 2 inches, and choose OK.
- Draw a circle that takes up the majority of this 2-inch square.
- Draw two lines in a cross hair pattern so that the circle is split
into four equal parts.
- Save the image as SPIN.BMP.
- Color the upper-right fourth of the circle and save it as
SPIN1.BMP.
- Color the lower-right fourth of the circle and save it as
SPIN2.BMP.
- Repeat step 8 for the next two wedges in clockwise order and save
the next two pieces as SPIN3.BMP and SPIN4.BMP.
- Minimize Paintbrush and start FoxPro for Windows.
Creating the Database for the Bitmaps
- Create a database called SPIN.DBF that has one field named
SPINPICT of type general.
- Copy and paste bitmaps SPIN1.BMP, SPIN2.BMP, SPIN3.BMP, and
SPIN4.BMP into the corresponding general fields in the database
(order is important--SPIN1.BMP should be pasted into the first
record, SPIN2.BMP should be pasted into the second record, and so
on).
Creating the Screen
- Create a new screen.
- Use the Picture tool (see page U11-10 of the "User's Guide") to
draw a graphic object that is 2 inches by 2 inches (use the
ruler).
- When the Screen Picture dialog box appears, choose Field.
- In the Choose Field/Variable dialog box, select spin.spinpict, and
choose OK.
- Select the Scale Picture--Fill The Frame and Refresh Output Field
options. Choose OK.
- Select the Field tool (see page U11-10) and draw a field on the
screen.
- When the Field dialog box appears, select Output Field (Say) under
Field and type "waittext" (without the quotation marks) in the box
that is beside the Output button.
- Under Options, select Refresh Output Field, and choose OK.
- In the Screen Setup code for the screen, type:
PUBLIC waittext
waittext=" "
- In the Cleanup and Procedures code for the screen, type:
PROCEDURE spinit
FOR i=1 TO 3
GOTO 1
SHOW GETS
GOTO 2
SHOW GETS
GOTO 3
SHOW GETS
GOTO 4
SHOW GETS
ENDFOR
RETURN
- In the On Screen Entry (When)... code for the screen, type:
waittext="Executing Command 1" && Text that is displayed
&& telling user what
&& routine/command is being
&& executed.
DO spinit && Animate the wedge moving.
** The WAIT WINDOW command below is for the purpose of
** demonstrating where to put a command to be executed and
** should be replaced with actual command.
WAIT WINDOW 'Command 1'
waittext="Executing Command 2" && Text that is displayed
&& telling user what
&& routine/command is being
&& executed.
DO spinit && Animate the wedge moving.
** The WAIT WINDOW command below is for the purpose of
** demonstrating where to put a command to be executed and
** should be replaced with actual command.
WAIT WINDOW 'Command 2'
CLEAR READ && Clear Window/Read
- Select the Center and Modal Screens options before generating the
screen so that the window will come up centered and the user will
not be able to access other menu options.
|