PRB: Empty Bars Appear in Shortcut Menu

Last reviewed: October 29, 1996
Article ID: Q156875
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows 5.0

SYMPTOMS

Empty bars appear within a shortcut menu after creating the menu with the DEFINE POPUP command.

CAUSE

The DEFINE POPUP command did not include the RELATIVE clause.

RESOLUTION

Add the RELATIVE clause to the DEFINE POPUP command. This clause prevents blank spaces from appearing within the shortcut menu. Change the DEFINE POPOP command to read:

   DEFINE POPUP Test SHORTCUT RELATIVE

STATUS

This behavior is by design.

MORE INFORMATION

If the DEFINE POPUP command lacks the RELATIVE clause, the order of a particular menu bar depends on its bar number. In the example below, the shortcut menu contains three system menu bars and a bar defined as "BAR 4." Bars 1, 2, and 3 are not defined; therefore, three spaces appear between the "Paste" and "Date" bar items.

The Menu Builder automatically places the RELATIVE clause on the DEFINE POPUP command it uses to create shortcut menus.

Steps to Reproduce Behavior

  1. Create a program that contains the following code:

          DEFINE POPUP Test SHORTCUT
          DEFINE BAR _MED_CUT OF Test PROMPT "Cut"
          DEFINE BAR _MED_COPY OF Test PROMPT "Copy"
          DEFINE BAR _MED_PASTE OF Test PROMPT "Paste"
          DEFINE BAR 4 OF Test PROMPT "Date"
          ON SELECTION BAR 4 OF Test KEYBOARD DTOC(DATE())
          ACTIVATE POPUP Test AT MROW(),MCOL()
    

  2. Run the program. The shortcut menu contains several blanks lines within it.

  3. Click the mouse and the shortcut menu disappears.

REFERENCES

Visual FoxPro 5.0; search on: DEFINE POPUP command


KBCategory: kbprg kbui kbprb
KBSubcategory: FxprgGeneral
Additional reference words: 5.00 kbdsd VFoxWin



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