Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refreshing menu when SKIP FOR condition changes in 7.0
Message
De
31/10/2003 13:11:28
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
31/10/2003 10:35:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
00844982
Message ID:
00845114
Vues:
12
Hi, Randy

>Using FoxPro 7.0, we set a variable to false to grey out some top level menu items while inside forms called from the menu. When we exit the form, we set the variable back to true. At that time, the menu items appear in grey, but are actually available if you click on them. How can we request that FoxPro redraw the sysmenu?

Here's an example using a form property to hold the skip for value.
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.SHOW
RETURN

DEFINE CLASS form1 AS FORM

  CAPTION = "Form1"
  lOn = .T.
  NAME = "Form1"

  ADD OBJECT check1 AS CHECKBOX WITH ;
    TOP = 116, ;
    LEFT = 143, ;
    HEIGHT = 17, ;
    WIDTH = 96, ;
    CAPTION = "Menu enabled", ;
    CONTROLSOURCE = "Thisform.lon", ;
    NAME = "Check1"

  PROCEDURE lon_assign
    LPARAMETERS vNewVal
    THIS.lOn = m.vNewVal
    ACTIVATE MENU _MSYSMENU NOWAIT PAD Toggle
  ENDPROC

  PROCEDURE LOAD
    PUSH MENU _MSYSMENU

    SET SYSMENU TO
    SET SYSMENU AUTOMATIC

    DEFINE PAD Toggle OF _MSYSMENU PROMPT "Toggle" COLOR SCHEME 3 ;
      KEY ALT+T, "" ;
      SKIP FOR TYPE('_Screen.ActiveForm')<>"O".OR.!_SCREEN.ACTIVEFORM.lOn

  ENDPROC

  PROCEDURE UNLOAD
    POP MENU _MSYSMENU
  ENDPROC

ENDDEFINE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform