/*
  gr_margin_create.dlg

*!  VERSION 1.0.0  15jan2007

*/

VERSION 10.0

DEFINE _dlgwd 320
DEFINE _dlght 120
INCLUDE header_gr_child

DEFINE _clwd	15
DEFINE _wd	50
DEFINE _sep	+55
DEFINE _cbwd	55

DEFINE _lft3_2	90
DEFINE _lft	0
DEFINE _lft3_3	190

SCRIPT PREINIT
BEGIN
	create STRING parent_name
	create STRING margin
	create ARRAY margin_vals
	parent_name.setvalue class PARENT._dlg_rsrcname
	parent_name.withvalue margin.setvalue class @.MSG.value
	margin.tokenize margin_vals
	program check_passed_values
END

PROGRAM check_passed_values
BEGIN
	if margin {
		call main.ed_top.setvalue class margin_vals[4]
		call main.ed_bottom.setvalue class margin_vals[3]
		call main.ed_right.setvalue class margin_vals[2]
		call main.ed_left.setvalue class margin_vals[1]
	}
END

DIALOG main, title("Create custom margin") tabtitle("Main")
BEGIN
  TEXT     tx_top	_lft3_2	20	_wd	.,	///
	label("Top:") right
  EDIT     ed_top	_sep	@	_cbwd	.,	///
	label("Top") numonly
  TEXT     tx_left	_lft	+30	_wd	.,	///
	label("Left:") right
  EDIT     ed_left	_sep	@	_cbwd	.,	///
	label("Left") numonly
  TEXT     tx_right	_lft3_3	@	_wd	.,	///
	label("Right:") right
  EDIT     ed_right	_sep	@	_cbwd	.,	///
	label("Right") numonly
  TEXT     tx_bottom	_lft3_2	+30	_wd	.,	///
	label("Bottom:") right
  EDIT     ed_bottom	_sep	@	_cbwd	.,	///
	label("Bottom") numonly
END

PROGRAM command
BEGIN
	require main.ed_top
	require main.ed_left
	require main.ed_right
	require main.ed_bottom
	put main.ed_left " "
	put main.ed_right " "
	put main.ed_bottom " "
	put main.ed_top
END
