/*
  gr_ed_barm.dlg

*!  VERSION 1.0.0  25jan2007

*/

VERSION 10.0
MODAL

INCLUDE _std_vsmall
DEFINE _dlght 290
INCLUDE header_gr_ed

DEFINE _clwd	15
DEFINE _wd	125
DEFINE _sep	+130
DEFINE _wd2	115
DEFINE _sep2	+120
DEFINE _cbwd	120
DEFINE _cbsep	+125

SCRIPT PREINIT
BEGIN
	create STRING G
	create STRING J
	create STRING style
	create STRING Gstyle
	create ARRAY  ARGS
	program setupGOBJECT

	create DOUBLE index
END

PROGRAM setupGOBJECT
BEGIN
	if ! __MESSAGE {
		stopbox stop 	///
			"An unexpected error has occurred." "Object not found."
		exit 198
	}
	call G.setvalue class __MESSAGE.value
	call __MESSAGE.tokenize ARGS
	call G.setvalue class ARGS[1]
	call J.setvalue class ARGS[2]
	call Gstyle.setvalue class G.value
	if J.iseq("") {
		call Gstyle.append ".style"
	}
	else {
		call create BOOLEAN customstyle
		call J.withvalue Gstyle.append ".obs_styles[@]"
		call Gstyle.withvalue customstyle.storeClsObjectExists @
		if ! customstyle {
			call Gstyle.setvalue class G.value
			call Gstyle.append ".style"
		}
	}
END

INCLUDE gr_ed_barm

PROGRAM command
BEGIN
	put "_gm_dlg_edits"
	beginoptions
		put " object(" G ") "
		put " " /program barm_output
		if J {
			put " jindex(" J ") "
		}

		put " epilog(_gedi toolbar barm " G " " J ")"
	endoptions
END
