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

/*
	Commuter module for REACT_MAINT (Reactor Maintenance) window
	
	10/17/2009 - John C. Henry, J.C. Henry & Co., Inc.
*/


DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg, obj_Appwindow

DECLARE FUNCTION Get_Property, Get_Status, obj_Appwindow, Send_Message


$INSERT APPCOLORS
$INSERT LSL_USERS_EQU


EQU CRLF$	TO \0D0A\
EQU TAB$	TO \09\


ErrTitle = 'Error in CleanInsp'
ErrorMsg = ''

Result = ''

BEGIN CASE
	CASE EntID = @WINDOW
		BEGIN CASE
			CASE Event = 'CLEAR'			; GOSUB Clear
			CASE Event = 'CREATE' 			; GOSUB Create
			CASE Event = 'CLOSE'			; GOSUB Close
			CASE Event = 'WRITE'			; GOSUB Write
			CASE Event = 'READ'				; GOSUB Read
			CASE Event = 'VSCROLL'			; GOSUB VScroll
			CASE Event = 'PAGE'				; GOSUB Page
			CASE Event[1,3] = 'QBF'			; GOSUB Refresh
		END CASE
		
	
	CASE EntID = @WINDOW:'.SIGN_COMP' AND Event = 'CLICK'	 		; GOSUB SignComplete
	CASE EntID = @WINDOW:'.MAIN_TAB' AND Event = 'CLICK'			; GOSUB Page
	
	/*
	CASE EntID = @WINDOW:'.CLEAN_RESULTS'
		BEGIN CASE 
			CASE Event = 'POSCHANGED'		; GOSUB CleanPC
			CASE Event = 'DBLCLK'			; GOSUB CleanDC
		END CASE
		
	CASE EntID = @WINDOW:'.INSP_RESULTS'
		BEGIN CASE 
			CASE Event = 'POSCHANGED'		; GOSUB InspPC
			CASE Event = 'DBLCLK'			; GOSUB InspDC
		END CASE
		
	CASE EntID = @WINDOW:'.SCAN_RESULTS'
		BEGIN CASE 
			CASE Event = 'POSCHANGED'		; GOSUB ScanPC
			CASE Event = 'DBLCLK'			; GOSUB ScanDC
		END CASE
	
	CASE EntID = @WINDOW:'.SEND_SPC' AND Event = 'CLICK' 	; GOSUB SendSPC
	*/
	
	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',@WINDOW)

GOSUB Refresh

RETURN


* * * * * * *
Page:
* * * * * * *

Page = Get_Property(@WINDOW:'.MAIN_TAB', 'VALUE')

Set_Property(@WINDOW,'VPOSITION', Page)

RETURN


* * * * * * *
VScroll:
* * * * * * *

Page = Parm1

Set_Property(@WINDOW:'.MAIN_TAB','VALUE', Page)

RETURN


* * * * * * *
Clear:
* * * * * * *

GOSUB Refresh

RETURN



* * * * * * *
Read:
* * * * * * *




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


* QBF buttons

Ctrls  = @WINDOW:'.QBF_FIRST_FIX':@RM		; Props  = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM		; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM			; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM		; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM		; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX'			; Props := 'ENABLED'

IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
	Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
	Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END

Set_Property(Ctrls,Props,Vals)



* Turn edit table symbolic column backgrounds to green **************************************************

ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS')		;* Loaded during 'Create' in obj_Appwindow

ETCtrls	= ETSymbolics<1>
ETCols	= ETSymbolics<2>

FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
	ETCtrl	= ETCtrls<1,I>
	ETList = Get_Property(ETCtrl,'LIST')
	FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
		IF ETList<Line,1> NE '' THEN
			FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
				stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
			NEXT N
		END
	NEXT I
NEXT I

RETURN


* * * * * *
Close:
* * * * * * 


RETURN



* * * * * * 
Write:
* * * * * *


RETURN


* * * * * *
SignComplete:
* * * * * *


DEBUG

RETURN


