Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing menu when SKIP FOR condition changes in 7.0
Message
From
31/10/2003 13:11:28
 
 
To
31/10/2003 10:35:39
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00844982
Message ID:
00845114
Views:
11
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
Previous
Reply
Map
View

Click here to load this message in the networking platform