FastTips for FoxPro for Mac: Screen Builder Q&A

Last reviewed: December 12, 1996
Article ID: Q109071
The information in this article applies to:
  • Microsoft FoxPro for Macintosh, version 2.5b

      Microsoft(R) Technical Support Application Note (Text File)
             FC0961: SCREEN BUILDER QUESTIONS AND ANSWERS
                                                  Revision Date: 12/93
                                                      No Disk Included

The following information applies to Microsoft FoxPro(R) version 2.5 for Macintosh(R).

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application|
| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER     |
| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED     |
| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR      |
| PURPOSE. The user assumes the entire risk as to the accuracy and   |
| the use of this Application Note. This Application Note may be     |
| copied and distributed subject to the following conditions: 1) All |
| text must be copied without modification and all pages must be     |
| included; 2) If software is included, all files on the disk(s) must|
| be copied without modification (the MS-DOS(R) utility diskcopy is  |
| appropriate for this purpose); 3) All components of this           |
| Application Note must be distributed together; and 4) This         |
| Application Note may not be distributed for profit.                |
|                                                                    |
| Copyright (C) 1993 Microsoft Corporation. All Rights Reserved.     |
| Microsoft, FoxPro, and MS-DOS are registered trademarks and Windows|
| is a trademark of Microsoft Corporation.                           |
| Macintosh is a registered trademark and Finder is a trademark of   |
| Apple Computer, Inc.                                               |
|---------------------------------------------------------------------

General Screen Builder Features

  1. Q. I created a screen that uses many different types of

           controls. When I generate the screen and execute it, I find
           that the TAB key cycles through text fields only. I would like
           to be able to cycle through all the controls using the TAB key,
           including buttons, popups, list boxes, and check boxes. How can
           I do this?
    

        A. The behavior of the TAB key during a READ command is determined
           by the KEYCOMP setting. In FoxPro for Macintosh, the default
           setting of KEYCOMP is MAC. When KEYCOMP is set to MAC, the TAB
           key cycles through text fields only, which is standard behavior
           for Macintosh dialog boxes.
    

           You can change this behavior from the Command window or from
           within a program by issuing the SET KEYCOMP TO WINDOWS or SET
           KEYCOMP TO DOS command. Either of these KEYCOMP settings allows
           the user to cycle through all objects, not just text fields,
           using the TAB key. For details about the keystroke differences,
           refer to the FoxPro online help system.
    

  2. Q. I know how to click and drag objects within the Screen

           Design window using the Selection Pointer tool. Is there an
           easy way to move objects a small distance?
    

        A. Yes. Select the object using the Selection Pointer tool and
           then use the arrow keys to move the object one pixel at a time.
    

  3. Q. I created a screen for my application that displays a

           number of fields. When I run the application, the order in
           which the cursor moves through the fields isn't what I expect.
           How can I change the keyboard access order without changing the
           physical position of the fields?
    

        A. Open your original screen in the Screen Builder. From the
           Screen menu, choose Object Order. This opens the Object Order
           dialog box, which lists screen objects according to their
           keyboard access order. To change the access order, click the
           button to the left of an object and drag the object to its new
           keyboard access position. When you're done, rebuild your
           application.
    

  4. Q. When I choose the Window Style button in the Screen Layout

           dialog box, I see that one of the options for window type is
           Desktop. What is a desktop window?
    

        A. A window defined as Desktop will become the main FoxPro screen.
           If you look at the generated code for a desktop window, you
           will see that a new window is not defined. Rather, a MODIFY
           WINDOW SCREEN command is generated to modify the attributes of
           the main FoxPro screen. Any subsequent windows that are created
           by using the DEFINE WINDOW ... IN SCREEN command will be
           children of the desktop window.
    

  5. Q. When I'm generating screens, I don't see any code-

           generation options. Do these options exist?
    

        A. Yes. The Generate Screen dialog box contains a More button.
           Choose this button to view the code-generation options.
    

  6. Q. Every time I run my screen, it seems that certain

           databases are opened and closed automatically. How can I
           prevent this from happening?
    

        A. When you save a screen for the first time, you have the option
           of saving environment information. If you choose to save this
           information, the screen file will record all open databases,
           active indexes, and active relations. When the screen is
           generated and run, the databases, indexes, and relations in the
           screen's environment will be restored. If you inadvertently
           saved the environment information when you created the screen,
           the screen program will restore an environment that you may not
           want.
    

           To clear a screen's environment, choose Layout from the Screen
           menu. In the Screen Layout dialog box, choose the Environment
           button, and then choose the Clear button.
    

           If you do not want to clear the environment but want to prevent
           the opening and closing of environment files, choose the More
           button in the Generate Screen dialog box. Clear the Open Files
           and Close Files check boxes.
    

  7. Q. I've designed a screen and would now like to add color to

           my screen objects. How can I do this?
    

        A. To specify colors, first select the object or a group of
           objects. To modify the background color of the object, choose
           Fill Color from the Object menu. To modify the outline and text
           of an object, choose Pen Color from the Object menu. Setting
           Fill Color or Pen Color to Automatic means the Macintosh
           default color sets will be used.
    

           To change the background of the entire screen, choose Layout
           from the Screen menu, and then choose the Color button. You can
           select a color, or you can select a wallpaper pattern by
           choosing the Wallpaper button, and then selecting a PICT or
           .BMP (bitmap) file.
    

  8. Q. Why can't I type as many characters in an input field as

           it appears will fit?
    

        A. The input field is using a proportional font. In a proportional
           font, each character is given as much horizontal space as it
           needs and no more. For example, a lowercase ''f'' requires much
           less space than an uppercase ''W.''
    

           When an input field displays in a screen, FoxPro calculates the
           display width of the field by multiplying the number of
           characters in the table field structure by the average size of
           a character in the specified font. If the field is filled with
           characters that are wider than average, the characters don't
           all fit within the display width of the input field, and
           therefore the characters scroll. If the field is filled with
           characters that are narrower than average, the characters don't
           fill the display width of the input field.
    

  9. Q. How do I control the type of data a memory variable will

           contain, including its length?
    

        A. In the Field dialog box, you can use the Format button to set
           the characteristics of the data entered, including its length.
           For more specific information, see the FUNCTION and PICTURE
           clauses portion of the documentation about the @ ... SAY
           command in the "Language Reference".
    

Working with Pictures

  1. Q. When I select the Push Button tool in the Screen Design

           window, I have the option of selecting pictures for my buttons.
           What file formats are supported?
    

        A. FoxPro for Macintosh allows you to use PICT and bitmap (.BMP)
           files. You can also use pictures in place of radio button and
           check box prompts.
    

  2. Q. How can I display a .BMP (bitmap) or a PICT object stored

           in a general field?
    

        A. Use the Picture tool to display the contents of a general
           field. The Field tool can't be used to display a picture.
    

  3. Q. I used the Picture tool to add a picture field to my

           screen. How do the options under If Picture And Frame Different
           Size affect the display of the picture?
    

        A. The following options apply only when the picture and frame are
           different sizes:
    

           - Clip Picture retains the original dimensions of the picture.
    
             If the picture is larger than the frame, only a portion of
             the image is displayed, beginning with the top-left portion
             of the picture. Any portion of the picture that extends
             beyond the frame is hidden.
    
           - Scale Picture - Retain Shape retains the overall shape of the
             picture but fills as much of the frame as possible. The
             picture is protected from vertical or horizontal distortion.
    
           - Scale Picture - Fill The Frame fills the frame completely.
             The picture fills the frame even at the cost of horizontal
             and vertical distortion.
    


Additional reference words: FoxMac 2.50b ivrfax fasttips
KBCategory: kbprg kbfasttip kbappnote
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.