open-insight/LSL2/OIEVENT/CLICK/RECIPE2.CANCEL_BUTTON.json
2024-03-25 15:12:53 -07:00

11 lines
1.6 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare subroutine end_dialog\r\ndeclare function msg\r\n$insert msg_equates\r\n\r\nRecipePromptCnt = get_property( @window, '@RecipePromptCnt' )\r\nRecipeControls = get_property( @window, '@RecipeControls' )\r\nRecipeDataOnWindow = get_property( RecipeControls, 'INVALUE' )\r\nconvert @rm to @vm in RecipeDataOnWindow\r\nCurLayerNo = get_property( @window, '@CurLayer' )\r\nAllLayers = get_property( @window, '@RecipeInfo' )\r\nif RecipeDataOnWindow = str( @vm, RecipePromptCnt-1 ) then\r\n * do not store and delete blank layer\r\n convert char(248) to @fm in AllLayers\r\n AllLayers = delete( AllLayers, CurLayerNo, 0, 0 )\r\n convert @fm to char(248) in AllLayers\r\n Void = set_property( @window, '@RecipeInfo', AllLayers )\r\nend else\r\n\tAllLayers = fieldstore( AllLayers, char(248), CurLayerNo, 1, RecipeDataOnWindow )\r\n\tVoid = set_property( @window, '@RecipeInfo', AllLayers )\r\nend\r\n*\r\nOrigRecipeData = get_property( @window, '@OrigRecipeInfo' )\r\nRecipeData = get_property( @window, '@RecipeInfo' )\r\nif RecipeData <> OrigRecipeData then\r\n MsgInfo = ''\r\n MsgInfo<mtext$> = 'You have changed recipe information. Do you wish to save?'\r\n\tMsgInfo<mtype$> = 'BNYC'\r\n\tMsgInfo<micon$> = '?'\r\n\tResponse = msg( '', MsgInfo )\r\n\tif Response = 1 then \r\n\t end_dialog( @window, RecipeData )\r\n\tend else\r\n\t if Response = 0 then\r\n\t end_dialog( @window, 'CANCEL' )\r\n\t end\r\n\tend\r\nend else \r\n end_dialog( @window, 'CANCEL' )\r\nend\r\nreturn 0"
}
}
}