To All
I have the main MDI menu and on that menu is an option to 'login as a different user'. In the login process .. public variables are changed and based on those changes .. the Menu options need to change.
I am looking for a way to refresh or update the MDI menu options when I complete the login process .. see code in BuildMenu function ..
//--------------------------//
Static FUNCTION BuildMenu( xDEFA, dEXE, cRDD,nSCR1,nSCR2 )
LOCAL oMenu
MENU oMenu
MENUITEM "&Trips, Dispatch, Gas and CVRP Entry ..." // ;
* ACTION _tripmenu( oWIND ) ;
* MESSAGE "TRIPS Data Entry"
MENUITEM "&Vehicles\Equip\Boats ..." ;
ACTION _vehbrow( oWIND ) ;
MESSAGE "Vehicle, Equipment and Boat Information"
MENUITEM "&Maintenance ..." // ;
* ACTION _mantmenu( oWIND ) ;
* MESSAGE "Work Orders"
MENUITEM "&Reports ..." // ;
* ACTION _RPTmenu( oWIND ) ;
* MESSAGE "Report Menu"
MENUITEM "&Utilities..." ;
ACTION _UTILmenu( oWIND ) ;
MESSAGE "Utilities Programs"
IF xADMIN = 'Y'
MENUITEM "&Login Diff User .." ;
ACTION( _Log_in(), ;
cRIGHTS := _Rights(), ;
xMESSAGE := ("User "+xLOGIN+" Rights "+cRIGHTS+ ;
" Default= "+xDEFA+" Rdd= "+cRDD+ ;
" Revision "+DTOC(dEXE)+;
" Agency\Mp= "+ALLTRIM(xAGENCY)+"\"+alltrim(xPOOL)+;
" -r"+str(nSCR1,4)+" x "+STR(nSCR2,4)),;
oWind:oMsgBar := TMsgBar():New(oWind,xMESSAGE,.F.,.T.,.F.,.F.,,,,),;
oWind:ReFresh(),;
MsgInfo( "Current User is now "+xLOGIN ),;
SysReFresh() ) ;
MESSAGE "Login as a different User"
MENUITEM "&Change Agency .." ;
ACTION( _ChgAgen(), ;
cRIGHTS := _Rights(), ;
xMESSAGE := ("User "+xLOGIN+" Rights "+cRIGHTS+ ;
" Default= "+xDEFA+" Rdd= "+cRDD+ ;
" Revision "+DTOC(dEXE)+;
" Agency\Mp= "+ALLTRIM(xAGENCY)+"\"+alltrim(xPOOL)+;
" -r"+str(nSCR1,4)+" x "+STR(nSCR2,4)),;
oWind:oMsgBar := TMsgBar():New(oWind,xMESSAGE,.F.,.T.,.F.,.F.,,,,),;
oWind:ReFresh(),;
MsgInfo( "Current Agency\MP is now "+alltrim(xAGENCY)+"\"+alltrim(xPOOL )),;
SysReFresh() ) ;
MESSAGE "Change Agency and Motorpool"
ENDIF
MENUITEM "&About .." ;
ACTION _webhelp( xDEFA,dEXE ) ;
MESSAGE "Version Information"
MENUITEM "&Quit" ;
ACTION oWIND:END() ;
MESSAGE "End this Program"
ENDMENU
RETURN( oMenu )
Login different user and change Agency menu options need to be hidden if the public var xADMIN is not "Y" .. after the manual login
Rick Lipkin
SC Dept of Health, USA