How to Have Macintosh Behavior in Push Buttons Only

Last reviewed: May 28, 1996
Article ID: Q124632
The information in this article applies to:
  • Microsoft FoxPro for Macintosh, version 2.6a

SUMMARY

This article shows by example how to set up an application so that a user can press TAB and ENTER to move between GETs in a screen and not move between PUSH BUTTON GETs in the same screen.

To accomplish this task, place code in the WHEN clause of the PUSH BUTTONs to reset KEYCOMP.

MORE INFORMATION

Step-by-Step Procedure

  1. Choose Open from the File menu and open the CUSTOMER table in the TUTORIAL directory.

  2. In the Command window, type:

    CREATE SCREEN test

  3. Once in the Screen Builder, choose Quick screen from the Screen menu. Press the OK push button to accept the defaults.

  4. Create a PUSH BUTTON set with the following prompts:

    Top Prior Next Bottom Quit

  5. Choose ACT for the variable.

  6. In the WHEN clause for the PUSH BUTTON set, type:

    SET KEYCOMP to MAC

  7. In the VALID clause for the PUSH BUTTON SET, type:

    DO CASE

       CASE act = 1   && TOP
          GO TOP
       CASE act = 2   && PRIOR
          IF BOF()
             GO TOP
          ELSE
             SKIP -1
             IF BOF()
                GO TOP
             ENDIF
          ENDIF
       CASE act = 3  && NEXT
          IF EOF()
             GO BOTTOM
          ELSE
             SKIP
             IF EOF()
                GO BOTTOM
             ENDIF
          ENDIF
       CASE act = 4  && BOTTOM
          GO BOTTOM
       CASE act = 5  && QUIT
          CLEAR READ
       ENDCASE
    
       SHOW GETS
       SET KEYCOMP to WINDOWS
    
    

  8. In the screen's SETUP code, type:

    SET KEYCOMP TO WINDOWS

  9. Run the screen.

Pressing the TAB or ENTER key will take the user through the CNO, COMPANY, and other fields. Only the mouse will move through the push buttons.


Additional reference words: FoxMac 2.60a
KBCategory: kbtool kbprg kbcode
KBSubcategory: FxtoolSbuilder


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: May 28, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.