/*------------------------------------------------------------------------- /* Environmental Systems Research Institute /*------------------------------------------------------------------------- /* Program: MSINFORM.AML /* Purpose: Displays a focused menu with information about an action. The /* menu remains focused until the user acknowledges the message. /* /*------------------------------------------------------------------------- /* Usage: msinform {INIT} {message_2} {'position'} {'stripe'} /* Usage: msinform /* /* Arguments: routine - routine to be run /* /* message_1 - The first line of the message to be displayed /* message_2 - The second line of the message to be displayed /* position - (quoted string) menu position /* stripe - (quoted string) menu stripe /* /* Globals: /*------------------------------------------------------------------------- /* Calls: msinform.menu, modal.aml /*------------------------------------------------------------------------- /* Notes: All arguments must be quoted, and each of the message /* arguments should contain no more than 80 characters. /*------------------------------------------------------------------------- /* Input: /* Output: /*------------------------------------------------------------------------- /* History: Michael Waltuch - Original coding /* Matt McGrath - 01/30/92 - Added header, OK button to menu. /* Set sizing based on string length. /* Added routines. /* Matt McGrath - 02/13/92 - Added thread focus management. /* Bernie Szukalski - 01/21/93 - Added position & stripe args. /*========================================================================= /* &args routine message_1 message_2 position stripe /* &severity &error &routine bailout /* /* Check arguments &if [NULL %routine%] &then &call usage /* Default to the init routine if no routine has been specified /* &set routinelist = INIT EXIT USAGE &if [KEYWORD %routine% %routinelist%] > 0 &then /* A routine has been specified &do &if [LOCASE %routine%] = init &then &do &set message1 = [UNQUOTE %message_1%] &set message2 = [UNQUOTE %message_2%] &end &end &else /* A routine has not been specified, default to init &do &set stripe = %position% &set position = %message_2% &set message2 = [UNQUOTE %message_1%] &set message1 = [UNQUOTE %routine%] &set routine = INIT &end /* &call %routine% /* &return /*------------------ &routine USAGE /*------------------ &type Usage: msinform {INIT} {message_2} {'''position'''} {'''stripe'''} &type Usage: msinform &return &warning /*------------------- &routine INIT /*------------------- /* /* Check arguments &if [NULL [VALUE message1]] &then &call usage /* &if [NULL %message2%] OR [QUOTE [UNQUOTE %message2%_]] = [QUOTE #_] &then &set message2 /* &if [NULL %position%] OR %position%_ = #_ &then &set position = &cc &screen &cc &if [NULL %stripe%] or %stripe%_ = #_ &then &set stripe = NOTICE /* Size the message menu based on the message string length /*&set xsize = [LENGTH [QUOTE %message%]] * 10 + 60 /*&if %xsize% lt 250 &then &set xsize = 250 /*&set size = %xsize% 125 &if [SHOW &thread &exists tool$msinform] &then &thread &delete tool$msinform &thread &create tool$msinform ~ &menu msinform ~ &position [UNQUOTE %position%] ~ &stripe [QUOTE [UNQUOTE %stripe%]] ~ &pinaction '&run msinform exit' /* Make this menu modal &run modal open tool$msinform /* &return /*------------------- &routine EXIT /*------------------- /* Clean up /* &dv .msinform$* /* /* Refocus other menus &if [SHOW &thread &exists tool$msinform] &then &run modal close tool$msinform /* &return /*------------------ &routine BAILOUT /*------------------ &severity &error &ignore &severity &warning &ignore /*&call exit &return &warning An error has occurred in routine: %routine% (MSINFORM.AML) /*----------------- &routine SAFETY_NET /*----------------- &return