COMPILE FUNCTION React_No_Confirm(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)

/*
	Commuter module for React_No_Confirm Dialog Box
	
	01/02/2013 - John C. Henry, J.C. Henry & Co., Inc.
*/

DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg,  Send_Event, RDS_React_Run, Send_Info
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, End_Dialog, Send_Message
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message, Set_Property

$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT LSL_USERS_EQUATES

EQU CRLF$	TO \0D0A\



ErrTitle = 'Error in React_Reads commuter module.'
ErrorMsg = ''

Result = ''

BEGIN CASE
	CASE EntID = @WINDOW
		BEGIN CASE
			CASE Event = 'CREATE' 			; GOSUB Create
			
			
		END CASE
		
	CASE EntID = @WINDOW:'.CANCEL_BUTTON' AND Event = 'CLICK' 	; GOSUB Cancel
	CASE EntID = @WINDOW:'.OK_BUTTON' AND Event = 'CLICK'		; GOSUB OK
	
	CASE EntID = @WINDOW:'.REACT_NO' AND Event = 'LOSTFOCUS'	; GOSUB ReactNoLF
	
	CASE 1
		ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
		ErrMsg(ErrorMsg)
		
END CASE

IF ErrorMsg NE '' THEN
	ErrMsg(ErrTitle:@SVM:ErrorMsg)
END



RETURN Result


* * * * * * *
Create:
* * * * * * *

obj_AppWindow('Create')

BriefTxt  = '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}'
BriefTxt := '{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\b\f0\fs20 Reactor Load Step\par'
BriefTxt := '\b0\par'
BriefTxt := ' 1.) Enter Reactor Number\par'
BriefTxt := ' 2.) Enter Password\par'
BriefTxt := '\par'
BriefTxt := '}'

Set_Property(@WINDOW:'.BRIEF_EDITBOX','RTFTEXT',BriefTxt)


Set_Property(@WINDOW,'@CURR_REACT_NO',Parm1)

*RETURN


* * * * * * *
Refresh:
* * * * * * *

ReactNo = Get_Property(@WINDOW:'.REACT_NO','TEXT')

IF ReactNo NE '' THEN
	Set_Property(@WINDOW:'.PASSWORD_LABEL','ENABLED',1)
	Set_Property(@WINDOW:'.PASSWORD','ENABLED',1)
	Set_Property(@WINDOW:'.PASSWORD','FOCUS',1)
END
	
RETURN


* * * * * * *
ReactNoLF:
* * * * * * *

VerifyReactNo	= Get_Property(@WINDOW:'.REACT_NO','TEXT')
CurrReactNo		= Get_Property(@WINDOW,'@CURR_REACT_NO')

IF VerifyReactNo = '' THEN RETURN

IF VerifyReactNo NE  CurrReactNo THEN

	MsgHead	= 'Reactor Change on RDS Record'
	MsgText	= 'Are you sure you wish to change from Reactor ':CurrReactNo:' to Reactor ':VerifyReactNo:'?'

	OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)

	IF OK THEN
		Set_Property('RDS.REACTOR','TEXT',VerifyReactNo)
	END
	
END	

GOSUB Refresh	

RETURN


* * * * * * *
OK:
* * * * * * *

UserPassword		= XLATE('LSL_USERS', @USER4, LSL_USERS_PASSWORD$, 'X' ) 
PasswordEntered	= Get_Property(@WINDOW:'.PASSWORD','DEFPROP')

IF PasswordEntered = UserPassword THEN

	End_Dialog( @WINDOW,TRUE$ )
	
END ELSE

	MsgInfo = ''
	MsgInfo<mtext$> = 'Password entered incorrectly...'
	MsgInfo<micon$> = 'H'
	
	Msg(@WINDOW, MsgInfo )
	
	End_Dialog( @WINDOW,FALSE$ )
END



RETURN



* * * * * * *
Cancel:
* * * * * * *

End_Dialog(@WINDOW,'')

RETURN


