/*
    gr_combine_options.dlg

*!  VERSION 1.0.2  27feb2007

*/

VERSION 10.0

INCLUDE _std_small
DEFINE _dlght 230
INCLUDE header_gr_child

HELP hlp1, view("help graph_combine")
RESET res1

PROGRAM POSTINIT_PROGRAM
BEGIN
	if __MESSAGE.iseq("set_mcaplot_options") {
		call script main_set_mcaplot_options
	}
	if __MESSAGE.iseq("set_caprojection_options") {
		call script main_set_caprojection_options
	}	
END

DIALOG main, label("Graph combine options")
BEGIN
  CHECKBOX ck_colf		_lft	_top	_iwd	.,		///
	label("Display down columns first") option(colfirst)
  CHECKBOX ck_ycom		@	_ms	@	.,		///
	label("Common scale for y axes") option(ycommon)
  CHECKBOX ck_xcom		@	_ms	@	.,		///
	label("Common scale for x axes") option(xcommon)

  TEXT tx_margin		@	_ms	_vnwd	.,		///
	label("Margins:")
  TEXT tx_holes			_lft2	@	@	.,		///
	label("Holes:")
  COMBOBOX cb_margin		_lft	_ss	_vnwd	.,		///
	label("Margins") option(imargin) contents(margin)		///
	dropdownlist
  EDIT ed_holes			_lft2	@	100	.,		///
	label("Holes") option(holes)
  BUTTON bu_holes		+105	@	15	., 		///
	label("?") onpush(view help numlist##|_new)
  
  TEXT tx_layout		_lft	_ls	_vnwd	.,	 	///
	label("Layout:")
  TEXT tx_scale			_lft2	@	@	.,		///
	label("Scale text:")
  COMBOBOX cb_layout		_lft	_ss	_vnwd	.,		///
	label("Layout") contents(main_layout) dropdownlist		///
	onselchangelist(main_layout_action)
  EDIT en_scale			_lft2	@	100	.,		///
	label("Scale text") numonly option(iscale)

  SPINNER sp_rows		_lft	+35	_spwd	.,		///
	label("Number of rows") default(1) min(1) max(100)		///
	option(rows)
  SPINNER  sp_cols		@	@	@	.,		///
	label("Number of columns") min(1) default(1) max(100)		///
	option(cols)
  TEXT tx_rows			_spsep	@	100	.,		///
	label("Rows")
  TEXT tx_cols			@	@	@	.,		///
	label("Columns")
END

LIST main_layout
BEGIN
	Default
	Rows
	Columns
END

LIST main_layout_action
BEGIN
	script main_hide_rc
	script main_rows_show
	script main_cols_show
END

SCRIPT main_rows_show
BEGIN
	main.tx_rows.show
	main.sp_rows.show
	main.tx_cols.hide
	main.sp_cols.hide
END

SCRIPT main_cols_show
BEGIN
	main.tx_cols.show
	main.sp_cols.show
	main.tx_rows.hide
	main.sp_rows.hide
END

SCRIPT main_hide_rc
BEGIN
	main.tx_cols.hide
	main.tx_rows.hide
	main.sp_rows.hide
	main.sp_cols.hide
END

SCRIPT main_set_caprojection_options
BEGIN
	main.ck_colf.hide
	main.ck_ycom.hide
	main.ck_xcom.hide
	main.tx_holes.hide
	main.ed_holes.hide
  	main.bu_holes.hide
	main.tx_margin.setposition . 10
	main.cb_margin.setposition . 30
  	main.tx_scale.setposition  . 10
  	main.en_scale.setposition  . 30
	main.tx_layout.setposition . 60
	main.cb_layout.setposition . 80
	main.sp_rows.setposition   . 115
  	main.sp_cols.setposition   . 115
	main.tx_rows.setposition   . 115
	main.tx_cols.setposition   . 115
END

SCRIPT main_set_mcaplot_options
BEGIN
	main.ck_ycom.hide
	main.ck_xcom.hide

	main.tx_margin.setposition . 35
	main.cb_margin.setposition . 55
  	main.tx_scale.setposition  . 35
  	main.en_scale.setposition  . 55
	main.tx_layout.setposition . 85
	main.cb_layout.setposition . 105
	main.sp_rows.setposition   . 140
  	main.sp_cols.setposition   . 140
	main.tx_rows.setposition   . 140
	main.tx_cols.setposition   . 140
END


PROGRAM command
BEGIN
	option main.ck_colf
	option main.ck_ycom
	option main.ck_xcom
	optionarg /hidedefault main.cb_margin
	optionarg main.ed_holes
	optionarg main.en_scale
        optionarg main.sp_rows
        optionarg main.sp_cols
END
