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
Update Menu on MDI frame ?
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
James
Did not work .. here is the code snipit I inserted :
Did not work .. here is the code snipit I inserted :
IF xADMIN = 'Y'
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 )),;
oWind:SetMenu( BuildMenu( xDEFA, dEXE, cRDD,nSCR1,nSCR2 )),;
SysReFresh() ) ;
MESSAGE "Change Agency and Motorpool"
ENDIF
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA