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

/*
	Commuter module for Coverage (COVERAGE) dialog window
	
	10/15/2009 - John C. Henry, J.C. Henry & Co., Inc.
*/

DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow, 
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note

DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message, Msg, Security_Check, obj_React_Run_CI, Create_Dialog

$INSERT MSG_EQUATES
$INSERT APPCOLORS


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

EQU SPECIAL_BLUE$	TO 227 + (253*256) + (248*65536)

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

Result = ''


BEGIN CASE
	CASE EntID = 'COVERAGE'
		BEGIN CASE
			
			CASE Event = 'CREATE' 			; GOSUB Create
			CASE Event = 'TIMER'			; GOSUB Timer
	
		END CASE
		
	CASE EntID = @WINDOW:'.CHANGE_BUTTON'	; GOSUB Change
			
	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:
* * * * * * *

ScreenSize = Get_Property('SYSTEM','SIZE')
DialogSize = Get_Property(@WINDOW,'SIZE')

wScreen = ScreenSize<3>
hScreen = ScreenSize<4>

xDialog = DialogSize<1>
yDialog = DialogSize<2>
wDialog = DialogSize<3>
hDialog = DialogSize<4>

DialogSize<1> = INT((wScreen - wDialog)/2)
DialogSize<2> = 50

Set_Property(@WINDOW,'SIZE',DialogSize)

*obj_Appwindow('Create','COVERAGE')

Set_Property('COVERAGE','TIMER',10000:@FM:100)	;* Initialize 10 second timer


RETURN

* * * * * *
Timer:
* * * * * *


Parms = XLATE('CONFIG','COVERAGE','','X')

	
Cleans		= Parms[1,@FM]
Surfscan	= Parms[COL2()+1,@FM]
Package		= Parms[COL2()+1,@FM]
TWs			= Parms[COL2()+1,@FM]
Chemicals	= Parms[COL2()+1,@FM]
Product		= Parms[COL2()+1,@FM]


WindowBackColor =  Get_Property('COVERAGE','BACKCOLOR')

IF Cleans = 1 THEN
	Set_Property('COVERAGE':'.CLEANS','BACKCOLOR',YELLOW$)
END ELSE
	Set_Property('COVERAGE':'.CLEANS','BACKCOLOR',WindowBackColor)
END

IF Surfscan = 1 THEN
	Set_Property('COVERAGE':'.SURFSCAN','BACKCOLOR',YELLOW$)
END ELSE
	Set_Property('COVERAGE':'.SURFSCAN','BACKCOLOR',WindowBackColor)
END

IF Package = 1 THEN
	Set_Property('COVERAGE':'.PACKAGE','BACKCOLOR',YELLOW$)
END ELSE
	Set_Property('COVERAGE':'.PACKAGE','BACKCOLOR',WindowBackColor)
END

IF TWs = 1 THEN
	Set_Property('COVERAGE':'.TWS','BACKCOLOR',YELLOW$)
END ELSE
	Set_Property('COVERAGE':'.TWS','BACKCOLOR',WindowBackColor)
END

IF Chemicals = 1 THEN
	Set_Property('COVERAGE':'.CHEMICALS','BACKCOLOR',YELLOW$)
END ELSE
	Set_Property('COVERAGE':'.CHEMICALS','BACKCOLOR',WindowBackColor)
END

IF Product = 1 THEN
	Set_Property('COVERAGE':'.PRODUCT','BACKCOLOR',YELLOW$)
END ELSE
	Set_Property('COVERAGE':'.PRODUCT','BACKCOLOR',WindowBackColor)
END

RETURN


* * * * * * *
Change:
* * * * * * *



void = Create_Dialog('STATUS_BOARD',@WINDOW,1)

RETURN












