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

/*
	Commuter module for PRS_Sig (Product Specification Signature Stage) window
	
	1/1/2012 - John C. Henry, J.C. Henry & Co., Inc.
	
*/

DECLARE SUBROUTINE Set_Property,  Set_Status, ErrMsg, Set_Property, obj_AppWindow, Security_Err_Msg, Forward_Event
DECLARE SUBROUTINE Send_Event
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, obj_Popup, Post_Event

$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT PRS_LAYER_EQU
$INSERT PRS_PROP_EQUATES
$INSERT SECURITY_RIGHTS_EQU

EQU CRLF$	TO \0D0A\

ErrTitle = 'Error in Comm_PRS_Sig'
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 = 'DELETE'			; GOSUB Delete
			CASE Event = 'READ'				; GOSUB Read
			CASE Event = 'WRITE'			; GOSUB Write
			CASE Event[1,3] = 'QBF'			; GOSUB Refresh
		END CASE
	

	CASE EntID = @WINDOW:'.LU_TOOL_CLASS' 		AND	Event = 'CLICK'	; GOSUB LUToolClass
	CASE EntID = @WINDOW:'.LU_ACTION' 			AND	Event = 'CLICK'	; GOSUB LUAction
	

	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




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


GOSUB Refresh


RETURN


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

void = Post_Event(@WINDOW,'CLOSE')

RETURN




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

Set_Property(@WINDOW,'@MIN_MAX_ICONV','')
Set_Property(@WINDOW,'@MIN_MAX_OCONV','')


GOTO Refresh

RETURN

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

obj_Appwindow('DetailReturn')

RETURN


* * * * * * *
Delete:
* * * * * * *

DEBUG


RETURN








* * * * * * *
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)


RETURN



* * * * * * *
LUToolClass:
* * * * * * *

ClassCd = Popup(@WINDOW,'','TOOL_CLASS')

IF ClassCD NE '' THEN
	oaParms = ClassCd:@RM:@WINDOW:'.TOOL_CLASS'
	obj_Appwindow('LUValReturn',oaParms)
END


RETURN



* * * * * * *
LUAction:
* * * * * * *


TypeOver = ''
TypeOver<PSELECT$> = 3	;* Ordered Multiple Select

Actions = Popup(@WINDOW,TypeOver,'WO_MAT_INV_ACTION')

IF Actions = '' OR Actions = CHAR(27)  THEN RETURN

RetCtrlEntID = @WINDOW:'.ACTION'

Set_Property(RetCtrlEntID,'DEFPROP',Actions:@VM:@VM)




RETURN







