/*
  line_opts -- graph options for a reference line and other line plot graphs

*!  VERSION 1.0.1  13mar2005
	*****
	    DO NOT change the name of this tab (line_opts). The name is called
	    from other files to alter the tab title.
	*****

	SCRIPTS and PROGRAMS for external use
		* SCRIPT line_opts_disable
		* SCRIPT line_opts_enable
		* PROGRAM line_opts_output
		* PROGRAM line_opts_lineopts_output
		* PROGRAM line_opts_rlopts_output

*/

DIALOG line_opts, tabtitle("Reference line")
BEGIN
  GROUPBOX gb_line           _lft      _top      _gwd1     _ht6,	///
  		label("Line options")
  TEXT     tx_ccol           _lft4_1gi _ms       _txwd     .,		///
  		label("Color:") right
DEFINE y @y
  COMBOBOX cb_ccol           _txsep    @         _tcr2b4g  .,		///
  		dropdownlist option(lcolor) 				///
  		contents(colors) onselchangelist(_line_opts_color_ccol)
  COLOR    cl_ccol           _tcr2b4gsep @       _colorwd  .,		///
  		option(lcolor)

  TEXT     tx_clpat          _lft4_1gi _ls       _txwd     .,		///
  		label("Pattern:") right
  COMBOBOX cb_clpat          _txsep    @         _txr2b4g  .,		///
  		dropdownlist contents(linepatterns) option(lpattern)

  TEXT     tx_clwid          _igft4_2  y         _txwd     .,		///
  		label("Width:") right
  COMBOBOX cb_clwid          _txsep    @         _txr2b4g  .,		///
  		dropdownlist contents(linewidths) option(lwidth)

  TEXT     tx_conn           _igft4_2  _ls       _txwd     .,		///
  		label("Type:") right
  COMBOBOX cb_conn           _txsep    @         _txr2b4g  .,   	///
  		option(connect) dropdownlist contents(connecttypes)
END

LIST _line_opts_color_ccol
BEGIN
	line_opts.cl_ccol.hide
	line_opts.cl_ccol.show
	line_opts.cl_ccol.hide
END

SCRIPT line_opts_disable
BEGIN
	line_opts.gb_line.disable
	line_opts.tx_ccol.disable
	line_opts.cb_ccol.disable
	line_opts.cl_ccol.disable
	line_opts.tx_clwid.disable
	line_opts.cb_clwid.disable
	line_opts.tx_clpat.disable
	line_opts.cb_clpat.disable
	line_opts.tx_conn.disable
	line_opts.cb_conn.disable
END

SCRIPT line_opts_enable
BEGIN
	line_opts.gb_line.enable
	line_opts.tx_ccol.enable
	line_opts.cb_ccol.enable
	line_opts.cl_ccol.enable
	line_opts.tx_clwid.enable
	line_opts.cb_clwid.enable
	line_opts.tx_clpat.enable
	line_opts.cb_clpat.enable
	line_opts.tx_conn.enable
	line_opts.cb_conn.enable
END

PROGRAM line_opts_output
BEGIN
	if H(line_opts.cl_ccol) {
		optionarg /hidedefault line_opts.cb_ccol
	}
	if !H(line_opts.cl_ccol) {
		optionarg /quoted line_opts.cl_ccol
	}
	optionarg /hidedefault line_opts.cb_clwid
	optionarg /hidedefault line_opts.cb_clpat
	optionarg /hidedefault line_opts.cb_conn
END

PROGRAM line_opts_rlopts_output
BEGIN
	if !H(line_opts.cl_ccol) | 				  ///
	   (line_opts.cb_ccol	& !H(line_opts.cb_ccol))	| ///
	   (line_opts.cb_clwid	& !H(line_opts.cb_clwid))	| ///
	   (line_opts.cb_clpat	& !H(line_opts.cb_clpat))	| ///
	   (line_opts.cb_conn	& !H(line_opts.cb_conn)) 	  ///
	{
		put "rlopts("
		put /program line_opts_output
		put ")"
	}
END

PROGRAM line_opts_lineopts_output
BEGIN
	if !H(line_opts.cl_ccol) | 				  ///
	   (line_opts.cb_ccol	& !H(line_opts.cb_ccol))	| ///
	   (line_opts.cb_clwid	& !H(line_opts.cb_clwid))	| ///
	   (line_opts.cb_clpat	& !H(line_opts.cb_clpat))	| ///
	   (line_opts.cb_conn	& !H(line_opts.cb_conn)) 	  ///
	{
		put "lineopts("
		put /program line_opts_output
		put ")"
	}
END
