Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deactivating and re Activating a menu causes screen to j
Message
From
05/05/2005 11:21:41
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
01010971
Message ID:
01011321
Views:
14
The application in question starts with a main menu displaying 'File', 'Go', 'Utilities', 'Help'.
If any form is opened it is required to disable 'Utilities'. When a form is opened the main menu is deactivated and then reactivated disabling 'Utilities' (more than one form can be opened maintaining 'Utilities' disabled). When all forms are closed the main menu is deactivated and then reactivated enabling 'Utilities'. When the menu is deactivated the screen adjusts the height of the menu for a split second to fill the screen (the screen jumps up). When the menu is reactivated the screen readjusts the height of the menu (the rest of the screen jumps down the height of the menu). This is undesirable. How can this be prevented.

Sample of code from within a Scan/EndScan to enable/disable 'Utilities':


Select curMainMenu
i = 0

Scan

lcBarName = Alltrim(curMainMenu.cBarname)
lcHotKey = curMainMenu.cHotKey
lcBarName = Strtran(Alltrim(curMainMenu.cBarname),lcHotKey,[\<]+lcHotKey,1,1,3)

i = i + 1
lcCommand = "Define Pad MainMenu"+Alltrim(Str(i))+" Of mnuMain Prompt ["+lcBarName+"]"

If lcBarName = '\ lcCommand = lcCommand+[ SKIP] && disable 'Utilities'
Endif

&lcCommand

.
.
.
.


Sample code to Activate and Deactivate main menu:

Note: LockScreen does not work

oMainLib.nOpen = oMainLib.nOpen - 1

IF oMainLib.nOpen = 0
frmMain.LockScreen = .T.
DEACTIVATE MENU mnuMain
RELEASE MENU mnuMain EXTENDED
xcststdmenu.getmenu(.F.) && table driven code that generates and activates the menu
frmMain.LockScreen = .F.
ENDIF






I hope this explains better.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform