231 lines
4.6 KiB
Plaintext
231 lines
4.6 KiB
Plaintext
COMPILE FUNCTION Comm_MFC_Loc(Instruction, Parm1,Parm2)
|
|
|
|
/*
|
|
Commuter module for MFC Location window
|
|
|
|
08/28/2006 - John C. Henry, J.C. Henry & Co., Inc.
|
|
*/
|
|
|
|
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, Set_List_Box_Data
|
|
DECLARE SUBROUTINE Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, Start_Window
|
|
DECLARE SUBROUTINE Send_Message
|
|
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists
|
|
DECLARE FUNCTION Dialog_Box, obj_WO_Log, MemberOf, obj_NCR, Send_Message, MemberOf, obj_Popup
|
|
|
|
|
|
$INSERT POPUP_EQUATES
|
|
$INSERT MSG_EQUATES
|
|
$INSERT APPCOLORS
|
|
$INSERT LSL_USERS_EQU
|
|
$INSERT SECURITY_RIGHTS_EQU
|
|
|
|
|
|
EQU CRLF$ TO \0D0A\
|
|
|
|
|
|
ErrTitle = 'Error in Comm_MFC_Loc'
|
|
ErrorMsg = ''
|
|
|
|
Result = ''
|
|
|
|
BEGIN CASE
|
|
CASE Instruction = 'Create' ; GOSUB Create
|
|
CASE Instruction = 'Refresh' ; GOSUB Refresh
|
|
CASE Instruction = 'Read' ; GOSUB Read
|
|
CASE Instruction = 'Write' ; GOSUB Write
|
|
CASE Instruction = 'Clear' ; GOSUB Clear
|
|
CASE Instruction = 'Delete' ; GOSUB Delete
|
|
CASE Instruction = 'Close' ; GOSUB Close
|
|
CASE Instruction = 'LU_MFC_LOC' ; GOSUB LU_MFC_LOC
|
|
CASE Instruction = 'GasesDC' ; GOSUB GasesDC
|
|
|
|
CASE 1
|
|
ErrorMsg = 'Unknown Instruction passed to routine'
|
|
END CASE
|
|
|
|
RETURN Result
|
|
|
|
|
|
* * * * * * *
|
|
Create:
|
|
* * * * * * *
|
|
|
|
obj_Appwindow('Create',@WINDOW)
|
|
|
|
IF NOT(Security_Check('MFC Location',READ$)) THEN
|
|
Security_Err_Msg('MFC Location',READ$)
|
|
End_Window(@WINDOW)
|
|
RETURN
|
|
END
|
|
|
|
GOSUB Refresh
|
|
|
|
RETURN
|
|
|
|
|
|
* * * * * * *
|
|
Read:
|
|
* * * * * * *
|
|
|
|
|
|
GOSUB Refresh
|
|
|
|
RETURN
|
|
|
|
|
|
* * * * * * *
|
|
Write:
|
|
* * * * * * *
|
|
|
|
RETURN
|
|
|
|
|
|
* * * * * * *
|
|
Clear:
|
|
* * * * * * *
|
|
|
|
|
|
GOSUB Refresh
|
|
|
|
RETURN
|
|
|
|
|
|
* * * * * * *
|
|
Delete:
|
|
* * * * * * *
|
|
|
|
Result = 1
|
|
|
|
RETURN
|
|
|
|
|
|
|
|
* * * * * * *
|
|
Close:
|
|
* * * * * * *
|
|
|
|
obj_Appwindow('DetailReturn')
|
|
|
|
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)
|
|
|
|
* 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 Line
|
|
|
|
NEXT I
|
|
|
|
|
|
RETURN
|
|
|
|
|
|
* * * * * * *
|
|
LU_MFC_LOC:
|
|
* * * * * * *
|
|
|
|
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
|
|
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
|
|
|
|
Set_Status(0)
|
|
|
|
Retval = Popup(@WINDOW,TypeOver,'MFC_LOC')
|
|
|
|
IF RetVal = '' THEN RETURN
|
|
|
|
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:RetVal)
|
|
|
|
RETURN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* * * * * * *
|
|
GasesDC:
|
|
* * * * * * *
|
|
|
|
CtrlEntID = @WINDOW:'.GASES'
|
|
CurrPos = Get_Property(CtrlEntID,'SELPOS')
|
|
CurrCol = CurrPos<1>
|
|
CurrRow = CurrPos<2>
|
|
|
|
CurrGases = Get_Property(CtrlEntID,'ARRAY') ;* Existing Gas codes in edit table
|
|
CurrGasesTrimmed = ''
|
|
FOR I = 1 TO COUNT(CurrGases,@VM) + (CurrGases NE '')
|
|
IF CurrGases<1,I> NE '' THEN
|
|
CurrGasesTrimmed<1,I> = CurrGases<1,I>
|
|
END
|
|
NEXT I
|
|
|
|
CurrGases = CurrGasesTrimmed
|
|
CurrGasesPositions = obj_Popup('CodePosition','REACTOR_GASES':@RM:CurrGases)
|
|
|
|
Gases = Popup(@WINDOW,'','REACTOR_GASES')
|
|
|
|
IF Gases = '' THEN RETURN
|
|
|
|
|
|
NewGasesPositions = obj_Popup('CodePosition','REACTOR_GASES':@RM:Gases)
|
|
|
|
FOR I = 1 TO COUNT(NewGasesPositions,@VM) + (NewGasesPositions NE '')
|
|
NewGasesPosition = NewGasesPositions<1,I>
|
|
Gas = Gases<1,I>
|
|
LOCATE NewGasesPosition IN CurrGasesPositions BY 'AR' USING @VM SETTING POS ELSE
|
|
CurrGasesPositions = INSERT(CurrGasesPositions,1,POS,0,NewGasesPosition)
|
|
CurrGases = INSERT(CurrGases,1,POS,0,Gas)
|
|
END
|
|
NEXT I
|
|
Set_Property(@WINDOW:'.GAS','DEFPROP',CurrGases)
|
|
Send_Event(@WINDOW:'.GAS','CALCULATE',2)
|
|
|
|
GOSUB Refresh
|
|
|
|
RETURN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|