Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: BAR() is not cleared and return wrong value
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Titre:
BUG: BAR() is not cleared and return wrong value
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01048508
Message ID:
01048508
Vues:
71
Updated Title:
BAR() and PROMPT() is not set and return wrong value

If a popup is defined without a ON SELECTION clause,
a popup's selection don't fire the C++ routine that fill BAR(),PROMPT()...

Expected,
- BAR() and PROMPT() they have to maintain the value of the last selection (as now)
- a selection has to set the value in the case ON SELECTION is not defined also
- should exist a command for reset they values: CLEAR POPUP SELECTION o similar

repro
CLEAR

defpopup()
ON SELECTION POPUP ContextMenu *

KEYBOARD '{DNARROW}{ENTER}'

ACTIVATE POPUP ContextMenu 
RELEASE POPUPS ContextMenu

? "This must return 2 Prompt2", BAR(), PROMPT()

defpopup()

KEYBOARD   '{ENTER}'

ACTIVATE POPUP ContextMenu 
RELEASE POPUPS ContextMenu

? "This must return 1 Prompt1", BAR(), PROMPT(), " The BUG"

defpopup()
ON SELECTION POPUP ContextMenu *

KEYBOARD   '{ENTER}'
ACTIVATE POPUP ContextMenu 
RELEASE POPUPS ContextMenu

? "This must return 1 Prompt1", BAR(), PROMPT()

defpopup()

KEYBOARD   '{ESC}'
ACTIVATE POPUP ContextMenu 
RELEASE POPUPS ContextMenu

? "This must return 0", BAR(), PROMPT()

PROCEDURE defpopup
DEFINE POPUP ContextMenu FROM MROW(0),MCOL(0) MARGIN RELATIVE SHORTCUT
DEFINE BAR 1 OF ContextMenu PROMPT '\<Prompt1'
DEFINE BAR 2 OF ContextMenu PROMPT '\<Prompt2'
PS On doc:
BAR( ) returns 0 if there is no active menu ...

I consider erred the documentation,
the correct description is

BAR() returns the last value chosen in a POPUP
Répondre
Fil
Voir

Click here to load this message in the networking platform