
/*
  glegend.idlg Include for graphics legends

*!  VERSION 1.1.3  24jun2005

  This idlg assumes you are using _graph.idlg include and _std_graph.idlg
  include to set the proper lengths, widths and heights.

*/

DIALOG glegend, tabtitle("Legend")
BEGIN
  /* LEFT SIDE */
  GROUPBOX  gb_main    _lft        _top      _gwd1       _ht15,	///
	label("Legend controls ")
  DEFINE    ytop @y
  /* LEFT SIDE-- Legend col(1) */
  TEXT     tx_legend   _igft       _ms       _txwd       .,	///
	label("Use legend:") right
  COMBOBOX cb_legend   _txsep      @         _txr2b4g    .,	///
	dropdownlist 						///
	contents(yesno) values(glegend_legend_values)		///
	onselchangelist(glegend_legend_action)
  DEFINE   y @y
  TEXT     tx_colfirst _igft       _ms       _txwd       .,	///
	label("Col. first:") right
  COMBOBOX cb_colfirst _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(yesno) values(glegend_colfirst_values)
  TEXT     tx_txfirst  _igft       _ms       _txwd       .,	///
	label("Text first:") right
  COMBOBOX cb_txfirst  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(yesno) values(glegend_txfirst_values)
  TEXT     tx_stack    _igft       _ms       _txwd       .,	///
	label("Stack:") right
  COMBOBOX cb_stack    _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(yesno) values(glegend_stack_values)
  TEXT     tx_layout   _igft       _ms       _txwd       .,	///
	label("Layout:") right
  COMBOBOX cb_layout   _txsep      @         _txr2b4g    .,	///
	dropdownlist onselchangelist(glegend_layout_action)	///
	contents(glegend_layout) values(glegend_layout_values)
  TEXT     tx_layoutsp _igft       _ms       _txwd       .,	///
	right	/* use setlabel below */
  SPINNER  sp_rowcol   _txsep      @         _spwd       .,	///
	min(1) max(100) default(1)
  TEXT     tx_mark     @           +35       0           0,
  DEFINE   y2 @y

  /* LEFT SIDE-- Legend col(2) */
  TEXT     tx_sympl    _gft4_2     y         _txwd       .,	///
	label("Symbol:") right
  COMBOBOX cb_sympl    _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(compass) option(symplacement)
  TEXT     tx_rowgp    _gft4_2     _ms       _txwd       .,	///
	label("Row gap:") right
  EDIT     ed_rowgp    _txsep      @         _txr2b4g    .,	///
	label("Row gap") option(rowgap)
  TEXT     tx_colgp    _gft4_2     _ms       _txwd       .,	///
	label("Col. gap:") right
  EDIT     ed_colgp    _txsep      @         _txr2b4g    .,	///
	label("Column gap") option(colgap)
  TEXT     tx_keygp    _gft4_2     _ms       _txwd       .,	///
	label("Key gap:") right
  EDIT     ed_keygp    _txsep      @         _txr2b4g    .,	///
	option(keygap)

  /* LEFT SIDE lower box */
  GROUPBOX  gb_region  _lft        y2        _gwd1       _ht12,	///
	label("Region options ")
  /* LEFT SIDE-- Region col(1) */
  TEXT     tx_rcolor   _igft       _ss       _txwd       .,	///
	label("Fill color:") right
  DEFINE   y @y
  COMBOBOX cb_rcolor   _txsep      @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(fcolor)		///
	onselchangelist(glegend_cl_rcolor_sel)
  COLOR    cl_rcolor   _tcr2b4gsep @         _colorwd    ., option(fcolor)
  TEXT     tx_rlcolor  _igft       _ms       _txwd       .,	///
	label("Line color:") right
  COMBOBOX cb_rlcolor  _txsep      @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(lcolor) 		///
	onselchangelist(glegend_cl_rlcolor_sel)
  COLOR    cl_rlcolor  _tcr2b4gsep @         _colorwd    ., option(lcolor)
  TEXT     tx_rpos     _igft       _ms       _txwd       .,	///
	label("Position:") right
  COMBOBOX cb_rpos     _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(clockpos)	option(position)
  CHECKBOX ck_ring     @           _ms       _txr2gi     .,	///
	label("Inside plot region")				///
	onclickon(program glegend_ring_check)			///
	onclickoff(program glegend_ring_check)			///
	option(ring(0))
  CHECKBOX ck_span     @           _ms       _txr2gi     ., 	///
	label("Span width of graph")				///
	onclickon(program glegend_span_check)			///
	onclickoff(program glegend_span_check)			///
	option(span)
  DEFINE temp @y
  /* LEFT SIDE-- Region col(2) */
  TEXT     tx_rmargin  _gft4_2     y         _txwd       .,	///
	label("Margin:") right
  COMBOBOX cb_rmargin  _txsep      @         _txr2b4g    .,	///
	dropdown contents(margin) option(margin)
  TEXT     tx_rlwd     _gft4_2     _ms       _txwd       .,	///
	label("Line width:") right
  COMBOBOX cb_rlwd     _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(linewidths) option(lwidth)

  /**********************************************************************/
  /* RIGHT SIDE */
  /**********************************************************************/
  /* Right Side Upper titles captions notes*/
  GROUPBOX gb_title    _lft2g      ytop     _gwd1       _ht19h,	///
	label("Title / Subtitle / Caption / Note ")
  COMBOBOX cb_mode     _igft2      _ss       _tcr2b4g    .,	///
	dropdownlist contents(glegend_mode)			///
	onselchangelist(glegend_mode_action)
  TEXT     tx_mode     _tcr2b4gsep @         _txr2b4g    .,
  TEXT     tx_mark2    _igft2      _ls       0           0,
  DEFINE   rty @y
  /**********************************************************************/
  /* Right Side Upper Title col(1) */
  TEXT     tx_title    _igft2      rty       _txwd       .,	///
	label("Title:") right
  EDIT     ed_title    _txsep      @         _txr2gi     .,
  TEXT     tx_ttlsize  _igft2      _ms       _txwd       .,	///
	label("Size:") right
  COMBOBOX cb_ttlsize  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(textsizes) option(size)
  DEFINE   y @y
  TEXT     tx_ttlclr   _igft2      _ms       _txwd       .,	///
	label("Color:") right
  COMBOBOX cb_ttlclr   _txsep      @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(color)		///
	onselchangelist(glegend_cl_ttlclr_sel)
  COLOR    cl_ttlclr   _tcr2b4gsep @         _colorwd    ., option(color)
  TEXT     tx_ttlpos   _igft2      _ms       _txwd       .,	///
	label("Position:")  right
  COMBOBOX cb_ttlpos   _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(clockpos) option(position)
  TEXT     tx_ttlmark  _igft2      _ss       0           0,
  DEFINE   bxy @y
  /* Right Side Upper Title col(2) */
  TEXT     tx_ttljust  _gft4_4     y         _txwd       .,	///
	label("Justify:") right
  COMBOBOX cb_ttljust  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(justification) option(justification)
  TEXT     tx_ttlmrgn  _gft4_4     _ms       _txwd       .,	///
	label("Margin:") right
  COMBOBOX cb_ttlmrgn  _txsep      @         _txr2b4g    .,	///
	dropdown contents(margin) option(margin)
  TEXT     tx_ttlgp    _gft4_4     _ms       _txwd       .,	///
	label("Line gap:") right
  EDIT     ed_ttlgp    _txsep      @         _txr2b4g    .,	///
	option(linegap)
  /* Right Side Upper Title box */
  CHECKBOX ck_ttlbox   _igft2      bxy       _cwd1gb     _ht4h,	///
	groupbox label("Box") option(box)			///
	onclickon(script legend_ttlbox_on)			///
	onclickoff(script legend_ttlbox_off)
    /* col(1) */
  TEXT     tx_ttlbclr  _iigft2     _ss       _txswd      .,	///
	label("Fill color:") right
  COMBOBOX cb_ttlbclr  _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(fcolor)		///
	onselchangelist(glegend_cl_ttlbclr_sel)
  COLOR    cl_ttlbclr  _tcr2b4gsep @         _colorwd    ., option(fcolor)
  DEFINE   y3 @y
  TEXT     tx_ttlblclr _iigft2     _ms       _txswd      .,	///
	label("Line color:") right
  COMBOBOX cb_ttlblclr _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(lcolor)		///
	onselchangelist(glegend_cl_ttlblclr_sel)
  COLOR    cl_ttlblclr _tcr2b4gsep @         _colorwd    ., option(lcolor)
    /* col(2) */
  TEXT     tx_ttlmarg  _gft4_4     y3        _txswd      .,	///
	label("Margin:") right
  COMBOBOX cb_ttlmarg  _txssep     @         _txr2b4g    .,	///
	dropdownlist contents(margin) option(bmargin)
  CHECKBOX ck_ttlexp   @           _ms       _txr2b4g    .,	///
	label("Ignore text") option(bexpand)
  /**********************************************************************/
  /* Right Side Upper Subtitle col(1) */
  TEXT     tx_stitle    _igft2     rty       _txwd       .,	///
	label("Subtitle:") right
  EDIT     ed_stitle    _txsep     @         _txr2gi     .,
  TEXT     tx_stlsize  _igft2      _ms       _txwd       .,	///
	label("Size:") right
  COMBOBOX cb_stlsize  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(textsizes) option(size)
  DEFINE   y @y
  TEXT     tx_stlclr   _igft2      _ms       _txwd       .,	///
	label("Color:") right
  COMBOBOX cb_stlclr   _txsep      @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(color)		///
	onselchangelist(glegend_cl_stlclr_sel)
  COLOR    cl_stlclr   _tcr2b4gsep @         _colorwd    ., option(color)
  TEXT     tx_stlpos   _igft2      _ms       _txwd       .,	///
	label("Position:") right
  COMBOBOX cb_stlpos   _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(clockpos) option(position)
  TEXT     tx_stlmark  _igft2      _ss       0           0,
  DEFINE   bxy @y
  /* Right Side Upper Subtitle col(2) */
  TEXT     tx_stljust  _gft4_4     y         _txwd       .,	///
	label("Justify:") right
  COMBOBOX cb_stljust  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(justification) option(justification)
  TEXT     tx_stlmrgn  _gft4_4     _ms       _txwd       .,	///
	label("Margin:") right
  COMBOBOX cb_stlmrgn  _txsep      @         _txr2b4g    .,	///
	dropdown contents(margin) option(margin)
  TEXT     tx_stlgp    _gft4_4     _ms       _txwd       .,	///
	label("Line gap:") right
  EDIT     ed_stlgp    _txsep      @         _txr2b4g    .,	///
	label("Line gap") option(linegap)
  /* Right Side Upper Subtitle box */
  CHECKBOX ck_stlbox   _igft2      bxy       _cwd1gb     _ht4h,	///
	groupbox label("Box") option(box)			///
	onclickon(script legend_stlbox_on)			///
	onclickoff(script legend_stlbox_off)
    /* col(1) */
  TEXT     tx_stlbclr  _iigft2     _ss       _txswd      .,	///
	label("Fill color:") right
  COMBOBOX cb_stlbclr  _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(fcolor)		///
	onselchangelist(glegend_cl_stlbclr_sel)
  COLOR    cl_stlbclr  _tcr2b4gsep @         _colorwd    ., option(fcolor)
  DEFINE   y3 @y
  TEXT     tx_stlblclr _iigft2     _ms       _txswd      .,	///
	label("Line color:") right
  COMBOBOX cb_stlblclr _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors)option(lcolor)		///
	onselchangelist(glegend_cl_stlblclr_sel)
  COLOR    cl_stlblclr _tcr2b4gsep @         _colorwd    ., option(lcolor)
    /* col(2) */
  TEXT     tx_stlmarg  _gft4_4     y3        _txswd      .,	///
	label("Margin:") right
  COMBOBOX cb_stlmarg  _txssep     @         _txr2b4g    .,	///
	dropdownlist contents(margin) option(bmargin)
  CHECKBOX ck_stlexp   @           _ms       _txr2b4g    .,	///
	label("Ignore text") option(bexpand)
  /**********************************************************************/
  /* Right Side Upper Caption col(1) */
  TEXT     tx_caption  _igft2      rty       _txwd       .,	///
	label("Caption:") right
  EDIT     ed_caption    _txsep    @         _txr2gi     .,	///
	label("Caption")
  TEXT     tx_capsize  _igft2      _ms       _txwd       .,	///
	label("Size:")  right
  COMBOBOX cb_capsize  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(textsizes) option(size)
  DEFINE   y @y
  TEXT     tx_capclr   _igft2      _ms       _txwd       .,	///
	label("Color:")	 right
  COMBOBOX cb_capclr   _txsep      @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(color)		///
	onselchangelist(glegend_cl_capclr_sel)
  COLOR    cl_capclr   _tcr2b4gsep @         _colorwd    ., option(color)
  TEXT     tx_cappos   _igft2      _ms       _txwd       .,	///
	label("Position:") right
  COMBOBOX cb_cappos   _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(clockpos) option(position)
  TEXT     tx_capmark  _igft2      _ss       0           0,
  DEFINE   bxy @y
  /* Right Side Upper Caption col(2) */
  TEXT     tx_capjust  _gft4_4     y         _txwd       .,	///
	label("Justify:") right
  COMBOBOX cb_capjust  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(justification) option(justification)
  TEXT     tx_capmrgn  _gft4_4     _ms       _txwd       .,	///
	label("Margin:") right
  COMBOBOX cb_capmrgn  _txsep      @         _txr2b4g    .,	///
	dropdown contents(margin) option(margin)
  TEXT     tx_capgp    _gft4_4     _ms       _txwd       .,	///
	label("Line gap:") right
  EDIT     ed_capgp    _txsep      @         _txr2b4g    .,	///
	option(linegap)
  /* Right Side Upper Caption box */
  CHECKBOX ck_capbox   _igft2      bxy       _cwd1gb     _ht4h,	///
	groupbox label("Box") option(box)			///
	onclickon(script legend_capbox_on)			///
	onclickoff(script legend_capbox_off)
    /* col(1) */
  TEXT     tx_capbclr  _iigft2     _ss       _txswd      .,	///
	label("Fill color:") right
  COMBOBOX cb_capbclr  _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(fcolor)		///
	onselchangelist(glegend_cl_capbclr_sel)
  COLOR    cl_capbclr  _tcr2b4gsep @         _colorwd    ., option(fcolor)
  DEFINE   y3 @y
  TEXT     tx_capblclr _iigft2     _ms       _txswd      .,	///
	label("Line color:") right
  COMBOBOX cb_capblclr _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(lcolor)		///
	onselchangelist(glegend_cl_capblclr_sel)
  COLOR    cl_capblclr _tcr2b4gsep @         _colorwd    ., option(lcolor)
    /* col(2) */
  TEXT     tx_capmarg  _gft4_4     y3        _txswd      .,	///
	label("Margin:")  right
  COMBOBOX cb_capmarg  _txssep     @         _txr2b4g    .,	///
	dropdownlist contents(margin) option(bmargin)
  CHECKBOX ck_capexp   @           _ms       _txr2b4g    .,	///
	label("Ignore text") option(bexpand)
  /**********************************************************************/
  /* Right Side Upper Note col(1) */
  TEXT     tx_note     _igft2      rty       _txwd       .,	///
	label("Note:") right
  EDIT     ed_note     _txsep      @         _txr2gi     .,
  TEXT     tx_notsize  _igft2      _ms       _txwd       .,	///
	label("Size:") right
  COMBOBOX cb_notsize  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(textsizes) option(size)
  DEFINE   y @y
  TEXT     tx_notclr   _igft2      _ms       _txwd       .,	///
	label("Color:")	right
  COMBOBOX cb_notclr   _txsep      @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(color)		///
	onselchangelist(glegend_cl_notclr_sel)
  COLOR    cl_notclr   _tcr2b4gsep @         _colorwd    ., option(color)
  TEXT     tx_notpos   _igft2      _ms   _txwd       .,		///
	label("Position:") right
  COMBOBOX cb_notpos   _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(clockpos) option(position)
  TEXT     tx_notmark  _igft2      _ss       0           0,
  DEFINE   bxy @y
  /* Right Side Upper Note col(2) */
  TEXT     tx_notjust  _gft4_4     y         _txwd       .,	///
	label("Justify:") right
  COMBOBOX cb_notjust  _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(justification) option(justification)
  TEXT     tx_notmrgn  _gft4_4     _ms       _txwd       .,	///
	label("Margin:") right
  COMBOBOX cb_notmrgn  _txsep      @         _txr2b4g    .,	///
	dropdown contents(margin) option(margin)
  TEXT     tx_notgp    _gft4_4     _ms       _txwd       .,	///
	label("Line gap:") right
  EDIT     ed_notgp    _txsep      @         _txr2b4g    .,	///
	option(linegap)
  /* Right Side Upper Note box */
  CHECKBOX ck_notbox   _igft2      bxy       _cwd1gb     _ht4h,	///
	groupbox label("Box") option(box)			///
	onclickon(script legend_notbox_on)			///
	onclickoff(script legend_notbox_off)
    /* col(1) */
  TEXT     tx_notbclr  _iigft2     _ss       _txswd      .,	///
	label("Fill color:") right
  COMBOBOX cb_notbclr  _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(fcolor)		///
	onselchangelist(glegend_cl_notbclr_sel)
  COLOR    cl_notbclr  _tcr2b4gsep @         _colorwd    ., option(fcolor)
  DEFINE   y3 @y
  TEXT     tx_notblclr _iigft2     _ms       _txswd      .,	///
	label("Line color:") right
  COMBOBOX cb_notblclr _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(lcolor)		///
	onselchangelist(glegend_cl_notblclr_sel)
  COLOR    cl_notblclr _tcr2b4gsep @         _colorwd    ., option(lcolor)
    /* col(2) */
  TEXT     tx_notmarg  _gft4_4     y3        _txswd      .,	///
	label("Margin:") right
  COMBOBOX cb_notmarg  _txssep     @         _txr2b4g    .,	///
	dropdownlist contents(margin) option(bmargin)
  CHECKBOX ck_notexp   @           _ms       _txr2b4g    .,	///
	label("Ignore text") option(bexpand)

  /**********************************************************************/
  /**********************************************************************/
  /* Right Side Lower label options*/
  GROUPBOX  gb_label   _lft2g      _xls      _gwd1       _ht7h,	///
	label("Label options ")

  /* RIGHT SIDE-- Label col(1)*/
  TEXT     tx_lab_ord  _igft2      _ss       _txwd       .,	///
	label("Labels")	 right
  EDIT     ed_lab_ord  _txsep      @         _tcr2gi    .,	///
	option(order)
  BUTTON   bt_lab_ord  _tcr2gisep  @         _btwd       .,	///
	label("?") onpush(view help legend_order##|_new)
  TEXT     tx_lsize    _igft2      _ms       _txwd       .,	///
	label("Size:") right
  DEFINE   y @y
  COMBOBOX cb_lsize    _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(textsizes) option(size)
  TEXT     tx_lclr     _igft2      _ms       _txwd       .,	///
	label("Color:") right
  COMBOBOX cb_lclr     _txsep      @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(color)		///
	onselchangelist(glegend_cl_lclr_sel)
  COLOR    cl_lclr     _tcr2b4gsep @         _colorwd    ., option(color)
  /* RIGHT SIDE-- Label col(2)*/
  TEXT     tx_ljust    _gft4_4     y         _txwd       .,	///
	label("Justify:") right
  COMBOBOX cb_ljust    _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(justification) option(justification)
  CHECKBOX ck_lallkey  @           _ms       _txr2b4g    .,	///
	label("All keys") option(all)
END

LIST glegend_legend_values
BEGIN
	""
	"on"
	"off"
END

/* Begin Enable All */
SCRIPT glegend_enable
BEGIN
	glegend.gb_main.enable
	glegend.tx_legend.enable
	glegend.cb_legend.enable
	glegend.cb_legend.withvalue glegend.cb_legend.setvalue "@"
END
/* End Enable All */

/* Begin Disable All */
SCRIPT glegend_disable
BEGIN
	glegend.gb_main.disable
	glegend.tx_legend.disable
	glegend.cb_legend.disable
	script glegend_disable_sub
END
/* End Disable All */

LIST glegend_legend_action
BEGIN
	program glegend_enable_sub
	program glegend_enable_sub
	script glegend_disable_sub
END

PROGRAM glegend_ring_check
BEGIN
	if !H(glegend.ck_ring) {
		if glegend.ck_ring {
			call gaction glegend.ck_span.disable
		}
		if !glegend.ck_ring {
			call gaction glegend.ck_span.enable
		}
	}
END

PROGRAM glegend_span_check
BEGIN
	if !H(glegend.ck_span) {
		if glegend.ck_span {
			call gaction glegend.ck_ring.disable
		}
		if !glegend.ck_span {
			call gaction glegend.ck_ring.enable
		}
	}
END

PROGRAM glegend_enable_sub
BEGIN
	if !H(glegend.cb_legend) {
		call script glegend_controls_on
		call program glegend_region_opt_on
		call program glegend_text_opt_on
		call script glegend_label_opt_on
	}
END

SCRIPT glegend_disable_sub
BEGIN
	script glegend_controls_off
	script glegend_region_opt_off
	script glegend_text_opt_off
	script glegend_label_opt_off
END

SCRIPT glegend_controls_on
BEGIN
	glegend.tx_colfirst.enable
	glegend.cb_colfirst.enable
	glegend.tx_txfirst.enable
	glegend.cb_txfirst.enable
	glegend.tx_stack.enable
	glegend.cb_stack.enable
	glegend.tx_layout.enable
	glegend.cb_layout.enable
	glegend.tx_layoutsp.enable
	glegend.sp_rowcol.enable
	glegend.tx_sympl.enable
	glegend.cb_sympl.enable
	glegend.tx_rowgp.enable
	glegend.ed_rowgp.enable
	glegend.tx_colgp.enable
	glegend.ed_colgp.enable
	glegend.tx_keygp.enable
	glegend.ed_keygp.enable
END

SCRIPT glegend_controls_off
BEGIN
	glegend.tx_colfirst.disable
	glegend.cb_colfirst.disable
	glegend.tx_txfirst.disable
	glegend.cb_txfirst.disable
	glegend.tx_stack.disable
	glegend.cb_stack.disable
	glegend.tx_layout.disable
	glegend.cb_layout.disable
	glegend.tx_layoutsp.disable
	glegend.sp_rowcol.disable
	glegend.tx_sympl.disable
	glegend.cb_sympl.disable
	glegend.tx_rowgp.disable
	glegend.ed_rowgp.disable
	glegend.tx_colgp.disable
	glegend.ed_colgp.disable
	glegend.tx_keygp.disable
	glegend.ed_keygp.disable
END

PROGRAM glegend_region_opt_on
BEGIN
	call gaction glegend.gb_region.enable
	call gaction glegend.tx_rcolor.enable
	call gaction glegend.cb_rcolor.enable
	call gaction glegend.cl_rcolor.enable
	call gaction glegend.tx_rlcolor.enable
	call gaction glegend.cb_rlcolor.enable
	call gaction glegend.cl_rlcolor.enable
	call gaction glegend.tx_rpos.enable
	call gaction glegend.cb_rpos.enable
	if !glegend.ck_span {
		call gaction glegend.ck_ring.enable
	}
	if !glegend.ck_ring {
		call gaction glegend.ck_span.enable
	}
	call gaction glegend.tx_rmargin.enable
	call gaction glegend.cb_rmargin.enable
	call gaction glegend.tx_rlwd.enable
	call gaction glegend.cb_rlwd.enable
END

SCRIPT glegend_region_opt_off
BEGIN
	glegend.gb_region.disable
	glegend.tx_rcolor.disable
	glegend.cb_rcolor.disable
	glegend.cl_rcolor.disable
	glegend.tx_rlcolor.disable
	glegend.cb_rlcolor.disable
	glegend.cl_rlcolor.disable
	glegend.tx_rpos.disable
	glegend.cb_rpos.disable
	glegend.ck_ring.disable
	glegend.ck_span.disable
	glegend.tx_rmargin.disable
	glegend.cb_rmargin.disable
	glegend.tx_rlwd.disable
	glegend.cb_rlwd.disable
END

PROGRAM glegend_text_opt_on
BEGIN
	/* Title Subtitle Caption Note options */
	call gaction glegend.gb_title.enable
	call gaction glegend.cb_mode.enable
	call gaction glegend.tx_mode.enable
	/* Title options */
	call gaction glegend.tx_title.enable
	call gaction glegend.ed_title.enable
	call gaction glegend.tx_ttlsize.enable
	call gaction glegend.cb_ttlsize.enable
	call gaction glegend.tx_ttlclr.enable
	call gaction glegend.cb_ttlclr.enable
	call gaction glegend.cl_ttlclr.enable
	call gaction glegend.tx_ttlpos.enable
	call gaction glegend.cb_ttlpos.enable
	call gaction glegend.tx_ttljust.enable
	call gaction glegend.cb_ttljust.enable
	call gaction glegend.tx_ttlmrgn.enable
	call gaction glegend.cb_ttlmrgn.enable
	call gaction glegend.tx_ttlgp.enable
	call gaction glegend.ed_ttlgp.enable
	call gaction glegend.ck_ttlbox.enable
	if glegend.ck_ttlbox {
		call script legend_ttlbox_on
	}
	* Subtitle options */
	call gaction glegend.tx_stitle.enable
	call gaction glegend.ed_stitle.enable
	call gaction glegend.tx_stlsize.enable
	call gaction glegend.cb_stlsize.enable
	call gaction glegend.tx_stlclr.enable
	call gaction glegend.cb_stlclr.enable
	call gaction glegend.cl_stlclr.enable
	call gaction glegend.tx_stlpos.enable
	call gaction glegend.cb_stlpos.enable
	call gaction glegend.tx_stljust.enable
	call gaction glegend.cb_stljust.enable
	call gaction glegend.tx_stlmrgn.enable
	call gaction glegend.cb_stlmrgn.enable
	call gaction glegend.tx_stlgp.enable
	call gaction glegend.ed_stlgp.enable
	call gaction glegend.ck_stlbox.enable
	if glegend.ck_stlbox {
		call script legend_stlbox_on
	}
	/* Caption options */
	call gaction glegend.tx_caption.enable
	call gaction glegend.ed_caption.enable
	call gaction glegend.tx_capsize.enable
	call gaction glegend.cb_capsize.enable
	call gaction glegend.tx_capclr.enable
	call gaction glegend.cb_capclr.enable
	call gaction glegend.cl_capclr.enable
	call gaction glegend.tx_cappos.enable
	call gaction glegend.cb_cappos.enable
	call gaction glegend.tx_capjust.enable
	call gaction glegend.cb_capjust.enable
	call gaction glegend.tx_capmrgn.enable
	call gaction glegend.cb_capmrgn.enable
	call gaction glegend.tx_capgp.enable
	call gaction glegend.ed_capgp.enable
	call gaction glegend.ck_capbox.enable
	if glegend.ck_capbox {
		call script legend_capbox_on
	}
	/* Note options */
	call gaction glegend.tx_note.enable
	call gaction glegend.ed_note.enable
	call gaction glegend.tx_notsize.enable
	call gaction glegend.cb_notsize.enable
	call gaction glegend.tx_notclr.enable
	call gaction glegend.cb_notclr.enable
	call gaction glegend.cl_notclr.enable
	call gaction glegend.tx_notpos.enable
	call gaction glegend.cb_notpos.enable
	call gaction glegend.tx_notjust.enable
	call gaction glegend.cb_notjust.enable
	call gaction glegend.tx_notmrgn.enable
	call gaction glegend.cb_notmrgn.enable
	call gaction glegend.tx_notgp.enable
	call gaction glegend.ed_notgp.enable
	call gaction glegend.ck_notbox.enable
	if glegend.ck_notbox {
		call script legend_notbox_on
	}
END

SCRIPT glegend_text_opt_off
BEGIN
	/* Title Subtitle Caption Note options */
	glegend.gb_title.disable
	glegend.cb_mode.disable
	glegend.tx_mode.disable

	/* Title options */
	glegend.tx_title.disable
	glegend.ed_title.disable
	glegend.tx_ttlsize.disable
	glegend.cb_ttlsize.disable
	glegend.tx_ttlclr.disable
	glegend.cb_ttlclr.disable
	glegend.cl_ttlclr.disable
	glegend.tx_ttlpos.disable
	glegend.cb_ttlpos.disable
	glegend.tx_ttljust.disable
	glegend.cb_ttljust.disable
	glegend.tx_ttlmrgn.disable
	glegend.cb_ttlmrgn.disable
	glegend.tx_ttlgp.disable
	glegend.ed_ttlgp.disable
	glegend.ck_ttlbox.disable
	script legend_ttlbox_off

	/* Subtitle options */
	glegend.tx_stitle.disable
	glegend.ed_stitle.disable
	glegend.tx_stlsize.disable
	glegend.cb_stlsize.disable
	glegend.tx_stlclr.disable
	glegend.cb_stlclr.disable
	glegend.cl_stlclr.disable
	glegend.tx_stlpos.disable
	glegend.cb_stlpos.disable
	glegend.tx_stljust.disable
	glegend.cb_stljust.disable
	glegend.tx_stlmrgn.disable
	glegend.cb_stlmrgn.disable
	glegend.tx_stlgp.disable
	glegend.ed_stlgp.disable
	glegend.ck_stlbox.disable
	script legend_stlbox_off

	/* Caption options */
	glegend.tx_caption.disable
	glegend.ed_caption.disable
	glegend.tx_capsize.disable
	glegend.cb_capsize.disable
	glegend.tx_capclr.disable
	glegend.cb_capclr.disable
	glegend.cl_capclr.disable
	glegend.tx_cappos.disable
	glegend.cb_cappos.disable
	glegend.tx_capjust.disable
	glegend.cb_capjust.disable
	glegend.tx_capmrgn.disable
	glegend.cb_capmrgn.disable
	glegend.tx_capgp.disable
	glegend.ed_capgp.disable
	glegend.ck_capbox.disable
	script legend_capbox_off

	/* Note options */
	glegend.tx_note.disable
	glegend.ed_note.disable
	glegend.tx_notsize.disable
	glegend.cb_notsize.disable
	glegend.tx_notclr.disable
	glegend.cb_notclr.disable
	glegend.cl_notclr.disable
	glegend.tx_notpos.disable
	glegend.cb_notpos.disable
	glegend.tx_notjust.disable
	glegend.cb_notjust.disable
	glegend.tx_notmrgn.disable
	glegend.cb_notmrgn.disable
	glegend.tx_notgp.disable
	glegend.ed_notgp.disable
	glegend.ck_notbox.disable
	script legend_notbox_off
END

SCRIPT glegend_label_opt_on
BEGIN
	glegend.gb_label.enable
	glegend.tx_lab_ord.enable
	glegend.ed_lab_ord.enable
	glegend.bt_lab_ord.enable
	glegend.tx_lsize.enable
	glegend.cb_lsize.enable
	glegend.tx_lclr.enable
	glegend.cb_lclr.enable
	glegend.cl_lclr.enable
	glegend.tx_ljust.enable
	glegend.cb_ljust.enable
	glegend.ck_lallkey.enable
END

SCRIPT glegend_label_opt_off
BEGIN
	glegend.gb_label.disable
	glegend.tx_lab_ord.disable
	glegend.ed_lab_ord.disable
	glegend.bt_lab_ord.disable
	glegend.tx_lsize.disable
	glegend.cb_lsize.disable
	glegend.tx_lclr.disable
	glegend.cb_lclr.disable
	glegend.cl_lclr.disable
	glegend.tx_ljust.disable
	glegend.cb_ljust.disable
	glegend.ck_lallkey.disable
END

LIST glegend_colfirst_values
BEGIN
	""
	"colfirst"
	"nocolfirst"
END

LIST glegend_txfirst_values
BEGIN
	""
	"textfirst"
	"notextfirst"
END

LIST glegend_stack_values
BEGIN
	""
	"stack"
	"nostack"
END

LIST glegend_layout_values
BEGIN
	""
	"rows"
	"cols"
END

SCRIPT glayout_row_on
BEGIN
	glegend.tx_layoutsp.setlabel "Rows:"
	glegend.sp_rowcol.show
END

SCRIPT glayout_col_on
BEGIN
	glegend.tx_layoutsp.setlabel "Columns:"
	glegend.sp_rowcol.show
END

SCRIPT glayout_default_on
BEGIN
	glegend.tx_layoutsp.setlabel ""
	glegend.sp_rowcol.hide
END

LIST glegend_layout
BEGIN
	"Default"
	"Rows"
	"Columns"
END

LIST glegend_layout_action
BEGIN
	script glayout_default_on
	script glayout_row_on
	script glayout_col_on
END

LIST glegend_mode
BEGIN
	"Title"
	"Subtitle"
	"Caption"
	"Note"
END

LIST glegend_mode_action
BEGIN
	script glegend_title_on
	script glegend_subtitle_on
	script glegend_caption_on
	script glegend_note_on
END

SCRIPT glegend_hide_all
BEGIN
	script glegend_subtitle_hide
	script glegend_caption_hide
	script glegend_note_hide
	script glegend_title_hide
END

SCRIPT glegend_show_all
BEGIN
	script glegend_subtitle_show
	script glegend_caption_show
	script glegend_note_show
	script glegend_title_show
END

SCRIPT glegend_title_on
BEGIN
	script glegend_hide_all
	script glegend_title_show
END
SCRIPT glegend_subtitle_on
BEGIN
	script glegend_hide_all
	script glegend_subtitle_show
END
SCRIPT glegend_caption_on
BEGIN
	script glegend_hide_all
	script glegend_caption_show
END
SCRIPT glegend_note_on
BEGIN
	script glegend_hide_all
	script glegend_note_show
END

SCRIPT glegend_title_show
BEGIN
	glegend.tx_mode.setlabel "Title options"
	glegend.tx_title.show
	glegend.ed_title.show
	glegend.tx_ttlsize.show
	glegend.cb_ttlsize.show
	glegend.tx_ttlclr.show
	glegend.cb_ttlclr.show
	glegend.cb_ttlclr.withvalue glegend.cb_ttlclr.setvalue "@"
	glegend.tx_ttlpos.show
	glegend.cb_ttlpos.show
	glegend.tx_ttljust.show
	glegend.cb_ttljust.show
	glegend.tx_ttlmrgn.show
	glegend.cb_ttlmrgn.show
	glegend.tx_ttlgp.show
	glegend.ed_ttlgp.show
	glegend.ck_ttlbox.show
	glegend.tx_ttlbclr.show
	glegend.cb_ttlbclr.show
	glegend.cb_ttlbclr.withvalue glegend.cb_ttlbclr.setvalue "@"
	glegend.tx_ttlblclr.show
	glegend.cb_ttlblclr.show
	glegend.cb_ttlblclr.withvalue glegend.cb_ttlblclr.setvalue "@"
	glegend.tx_ttlmarg.show
	glegend.cb_ttlmarg.show
	glegend.ck_ttlexp.show
END

SCRIPT glegend_title_hide
BEGIN
	glegend.tx_title.hide
	glegend.ed_title.hide
	glegend.tx_ttlsize.hide
	glegend.cb_ttlsize.hide
	glegend.tx_ttlclr.hide
	glegend.cb_ttlclr.hide
	glegend.cl_ttlclr.hide
	glegend.tx_ttlpos.hide
	glegend.cb_ttlpos.hide
	glegend.tx_ttljust.hide
	glegend.cb_ttljust.hide
	glegend.tx_ttlmrgn.hide
	glegend.cb_ttlmrgn.hide
	glegend.tx_ttlgp.hide
	glegend.ed_ttlgp.hide
	glegend.ck_ttlbox.hide
	glegend.tx_ttlbclr.hide
	glegend.cb_ttlbclr.hide
	glegend.cl_ttlbclr.hide
	glegend.tx_ttlblclr.hide
	glegend.cb_ttlblclr.hide
	glegend.cl_ttlblclr.hide
	glegend.tx_ttlmarg.hide
	glegend.cb_ttlmarg.hide
	glegend.ck_ttlexp.hide
END

SCRIPT glegend_subtitle_show
BEGIN
	glegend.tx_mode.setlabel "Subtitle options"
	glegend.tx_stitle.show
	glegend.ed_stitle.show
	glegend.tx_stlsize.show
	glegend.cb_stlsize.show
	glegend.tx_stlclr.show
	glegend.cb_stlclr.show
	glegend.cb_stlclr.withvalue glegend.cb_stlclr.setvalue "@"
	glegend.tx_stlpos.show
	glegend.cb_stlpos.show
	glegend.tx_stljust.show
	glegend.cb_stljust.show
	glegend.tx_stlmrgn.show
	glegend.cb_stlmrgn.show
	glegend.tx_stlgp.show
	glegend.ed_stlgp.show
	glegend.ck_stlbox.show
	glegend.tx_stlbclr.show
	glegend.cb_stlbclr.show
	glegend.cb_stlbclr.withvalue glegend.cb_stlbclr.setvalue "@"
	glegend.tx_stlblclr.show
	glegend.cb_stlblclr.show
	glegend.cb_stlblclr.withvalue glegend.cb_stlblclr.setvalue "@"
	glegend.tx_stlmarg.show
	glegend.cb_stlmarg.show
	glegend.ck_stlexp.show
END
SCRIPT glegend_subtitle_hide
BEGIN
	glegend.tx_stitle.hide
	glegend.ed_stitle.hide
	glegend.tx_stlsize.hide
	glegend.cb_stlsize.hide
	glegend.tx_stlclr.hide
	glegend.cb_stlclr.hide
	glegend.cl_stlclr.hide
	glegend.tx_stlpos.hide
	glegend.cb_stlpos.hide
	glegend.tx_stljust.hide
	glegend.cb_stljust.hide
	glegend.tx_stlmrgn.hide
	glegend.cb_stlmrgn.hide
	glegend.tx_stlgp.hide
	glegend.ed_stlgp.hide
	glegend.ck_stlbox.hide
	glegend.tx_stlbclr.hide
	glegend.cb_stlbclr.hide
	glegend.cl_stlbclr.hide
	glegend.tx_stlblclr.hide
	glegend.cb_stlblclr.hide
	glegend.cl_stlblclr.hide
	glegend.tx_stlmarg.hide
	glegend.cb_stlmarg.hide
	glegend.ck_stlexp.hide
END

SCRIPT glegend_caption_show
BEGIN
	glegend.tx_mode.setlabel "Caption options"
	glegend.tx_caption.show
	glegend.ed_caption.show
	glegend.tx_capsize.show
	glegend.cb_capsize.show
	glegend.tx_capclr.show
	glegend.cb_capclr.show
	glegend.cb_capclr.withvalue glegend.cb_capclr.setvalue "@"
	glegend.tx_cappos.show
	glegend.cb_cappos.show
	glegend.tx_capjust.show
	glegend.cb_capjust.show
	glegend.tx_capmrgn.show
	glegend.cb_capmrgn.show
	glegend.tx_capgp.show
	glegend.ed_capgp.show
	glegend.ck_capbox.show
	glegend.tx_capbclr.show
	glegend.cb_capbclr.show
	glegend.cb_capbclr.withvalue glegend.cb_capbclr.setvalue "@"
	glegend.tx_capblclr.show
	glegend.cb_capblclr.show
	glegend.cb_capblclr.withvalue glegend.cb_capblclr.setvalue "@"
	glegend.tx_capmarg.show
	glegend.cb_capmarg.show
	glegend.ck_capexp.show
END

SCRIPT glegend_caption_hide
BEGIN
	glegend.tx_caption.hide
	glegend.ed_caption.hide
	glegend.tx_capsize.hide
	glegend.cb_capsize.hide
	glegend.tx_capclr.hide
	glegend.cb_capclr.hide
	glegend.cl_capclr.hide
	glegend.tx_cappos.hide
	glegend.cb_cappos.hide
	glegend.tx_capjust.hide
	glegend.cb_capjust.hide
	glegend.tx_capmrgn.hide
	glegend.cb_capmrgn.hide
	glegend.tx_capgp.hide
	glegend.ed_capgp.hide
	glegend.ck_capbox.hide
	glegend.tx_capbclr.hide
	glegend.cb_capbclr.hide
	glegend.cl_capbclr.hide
	glegend.tx_capblclr.hide
	glegend.cb_capblclr.hide
	glegend.cl_capblclr.hide
	glegend.tx_capmarg.hide
	glegend.cb_capmarg.hide
	glegend.ck_capexp.hide
END

SCRIPT glegend_note_show
BEGIN
	glegend.tx_mode.setlabel "Note options"
	glegend.tx_note.show
	glegend.ed_note.show
	glegend.tx_notsize.show
	glegend.cb_notsize.show
	glegend.tx_notclr.show
	glegend.cb_notclr.show
	glegend.cb_notclr.withvalue glegend.cb_notclr.setvalue "@"
	glegend.tx_notpos.show
	glegend.cb_notpos.show
	glegend.tx_notjust.show
	glegend.cb_notjust.show
	glegend.tx_notmrgn.show
	glegend.cb_notmrgn.show
	glegend.tx_notgp.show
	glegend.ed_notgp.show
	glegend.ck_notbox.show
	glegend.tx_notbclr.show
	glegend.cb_notbclr.show
	glegend.cb_notbclr.withvalue glegend.cb_notbclr.setvalue "@"
	glegend.tx_notblclr.show
	glegend.cb_notblclr.show
	glegend.cb_notblclr.withvalue glegend.cb_notblclr.setvalue "@"
	glegend.tx_notmarg.show
	glegend.cb_notmarg.show
	glegend.ck_notexp.show
END

SCRIPT glegend_note_hide
BEGIN
	glegend.tx_note.hide
	glegend.ed_note.hide
	glegend.tx_notsize.hide
	glegend.cb_notsize.hide
	glegend.tx_notclr.hide
	glegend.cb_notclr.hide
	glegend.cl_notclr.hide
	glegend.tx_notpos.hide
	glegend.cb_notpos.hide
	glegend.tx_notjust.hide
	glegend.cb_notjust.hide
	glegend.tx_notmrgn.hide
	glegend.cb_notmrgn.hide
	glegend.tx_notgp.hide
	glegend.ed_notgp.hide
	glegend.ck_notbox.hide
	glegend.tx_notbclr.hide
	glegend.cb_notbclr.hide
	glegend.cl_notbclr.hide
	glegend.tx_notblclr.hide
	glegend.cb_notblclr.hide
	glegend.cl_notblclr.hide
	glegend.tx_notmarg.hide
	glegend.cb_notmarg.hide
	glegend.ck_notexp.hide
END

SCRIPT  legend_ttlbox_on
BEGIN
	glegend.tx_ttlbclr.enable
	glegend.cb_ttlbclr.enable
	glegend.cl_ttlbclr.enable
	glegend.tx_ttlblclr.enable
	glegend.cb_ttlblclr.enable
	glegend.cl_ttlblclr.enable
	glegend.tx_ttlmarg.enable
	glegend.cb_ttlmarg.enable
	glegend.ck_ttlexp.enable
END

SCRIPT  legend_ttlbox_off
BEGIN
	glegend.tx_ttlbclr.disable
	glegend.cb_ttlbclr.disable
	glegend.cl_ttlbclr.disable
	glegend.tx_ttlblclr.disable
	glegend.cb_ttlblclr.disable
	glegend.cl_ttlblclr.disable
	glegend.tx_ttlmarg.disable
	glegend.cb_ttlmarg.disable
	glegend.ck_ttlexp.disable
END

SCRIPT  legend_stlbox_on
BEGIN
	glegend.tx_stlbclr.enable
	glegend.cb_stlbclr.enable
	glegend.cl_stlbclr.enable
	glegend.tx_stlblclr.enable
	glegend.cb_stlblclr.enable
	glegend.cl_stlblclr.enable
	glegend.tx_stlmarg.enable
	glegend.cb_stlmarg.enable
	glegend.ck_stlexp.enable
END

SCRIPT  legend_stlbox_off
BEGIN
	glegend.tx_stlbclr.disable
	glegend.cb_stlbclr.disable
	glegend.cl_stlbclr.disable
	glegend.tx_stlblclr.disable
	glegend.cb_stlblclr.disable
	glegend.cl_stlblclr.disable
	glegend.tx_stlmarg.disable
	glegend.cb_stlmarg.disable
	glegend.ck_stlexp.disable
END

SCRIPT  legend_capbox_on
BEGIN
	glegend.tx_capbclr.enable
	glegend.cb_capbclr.enable
	glegend.cl_capbclr.enable
	glegend.tx_capblclr.enable
	glegend.cb_capblclr.enable
	glegend.cl_capblclr.enable
	glegend.tx_capmarg.enable
	glegend.cb_capmarg.enable
	glegend.ck_capexp.enable
END

SCRIPT  legend_capbox_off
BEGIN
	glegend.tx_capbclr.disable
	glegend.cb_capbclr.disable
	glegend.cl_capbclr.disable
	glegend.tx_capblclr.disable
	glegend.cb_capblclr.disable
	glegend.cl_capblclr.disable
	glegend.tx_capmarg.disable
	glegend.cb_capmarg.disable
	glegend.ck_capexp.disable
END

SCRIPT  legend_notbox_on
BEGIN
	glegend.tx_notbclr.enable
	glegend.cb_notbclr.enable
	glegend.cl_notbclr.enable
	glegend.tx_notblclr.enable
	glegend.cb_notblclr.enable
	glegend.cl_notblclr.enable
	glegend.tx_notmarg.enable
	glegend.cb_notmarg.enable
	glegend.ck_notexp.enable
END

SCRIPT  legend_notbox_off
BEGIN
	glegend.tx_notbclr.disable
	glegend.cb_notbclr.disable
	glegend.cl_notbclr.disable
	glegend.tx_notblclr.disable
	glegend.cb_notblclr.disable
	glegend.cl_notblclr.disable
	glegend.tx_notmarg.disable
	glegend.cb_notmarg.disable
	glegend.ck_notexp.disable
END

LIST glegend_cl_rcolor_sel
BEGIN
	glegend.cl_rcolor.hide
	glegend.cl_rcolor.show
	glegend.cl_rcolor.hide
END

LIST glegend_cl_rlcolor_sel
BEGIN
	glegend.cl_rlcolor.hide
	glegend.cl_rlcolor.show
	glegend.cl_rlcolor.hide
END

LIST glegend_cl_ttlclr_sel
BEGIN
	glegend.cl_ttlclr.hide
	glegend.cl_ttlclr.show
	glegend.cl_ttlclr.hide
END

LIST glegend_cl_ttlbclr_sel
BEGIN
	glegend.cl_ttlbclr.hide
	glegend.cl_ttlbclr.show
	glegend.cl_ttlbclr.hide
END

LIST glegend_cl_ttlblclr_sel
BEGIN
	glegend.cl_ttlblclr.hide
	glegend.cl_ttlblclr.show
	glegend.cl_ttlblclr.hide
END

LIST glegend_cl_stlclr_sel
BEGIN
	glegend.cl_stlclr.hide
	glegend.cl_stlclr.show
	glegend.cl_stlclr.hide
END

LIST glegend_cl_stlbclr_sel
BEGIN
	glegend.cl_stlbclr.hide
	glegend.cl_stlbclr.show
	glegend.cl_stlbclr.hide
END

LIST glegend_cl_stlblclr_sel
BEGIN
	glegend.cl_stlblclr.hide
	glegend.cl_stlblclr.show
	glegend.cl_stlblclr.hide
END

LIST glegend_cl_capclr_sel
BEGIN
	glegend.cl_capclr.hide
	glegend.cl_capclr.show
	glegend.cl_capclr.hide
END

LIST glegend_cl_capbclr_sel
BEGIN
	glegend.cl_capbclr.hide
	glegend.cl_capbclr.show
	glegend.cl_capbclr.hide
END

LIST glegend_cl_capblclr_sel
BEGIN
	glegend.cl_capblclr.hide
	glegend.cl_capblclr.show
	glegend.cl_capblclr.hide
END

LIST glegend_cl_notclr_sel
BEGIN
	glegend.cl_notclr.hide
	glegend.cl_notclr.show
	glegend.cl_notclr.hide
END

LIST glegend_cl_notbclr_sel
BEGIN
	glegend.cl_notbclr.hide
	glegend.cl_notbclr.show
	glegend.cl_notbclr.hide
END

LIST glegend_cl_notblclr_sel
BEGIN
	glegend.cl_notblclr.hide
	glegend.cl_notblclr.show
	glegend.cl_notblclr.hide
END

LIST glegend_cl_lclr_sel
BEGIN
	glegend.cl_lclr.hide
	glegend.cl_lclr.show
	glegend.cl_lclr.hide
END

PROGRAM glegend_controls_pr
BEGIN
   if !H(glegend.cb_legend) {
      if glegend.cb_legend | glegend.cb_colfirst | glegend.cb_txfirst	/*
	*/ | glegend.cb_stack | glegend.cb_layout | glegend.cb_sympl	/*
	*/ | glegend.ed_rowgp | glegend.ed_colgp | glegend.ed_keygp 	/*
	*/ | glegend.cb_lsize | glegend.cb_lclr | glegend.cb_ljust	/*
	*/ | glegend.ck_lallkey | glegend.ed_lab_ord {

	put " "  "legend("
	put /program glegend_controls_opt_pr
	put ")"
      }
   }
END
PROGRAM glegend_controls_opt_pr
BEGIN
	if glegend.cb_legend {
		put glegend.cb_legend
	}
	if glegend.cb_colfirst {
		put " " glegend.cb_colfirst
	}
	if glegend.cb_txfirst {
		put " "  glegend.cb_txfirst
	}
	if glegend.cb_stack {
		put " "  glegend.cb_stack
	}
	if glegend.cb_layout & !H(glegend.cb_layout) {
		put " " glegend.cb_layout "("
		put glegend.sp_rowcol
		put ")"
	}
	optionarg /hidedefault glegend.cb_sympl
	optionarg /hidedefault glegend.ed_rowgp
	optionarg /hidedefault glegend.ed_colgp
	optionarg /hidedefault glegend.ed_lab_ord
	optionarg /hidedefault glegend.ed_keygp
	optionarg /hidedefault glegend.cb_lsize
	if H(glegend.cl_lclr) {
		optionarg /hidedefault glegend.cb_lclr
	}
	if !H(glegend.cl_lclr) {
		optionarg /quoted glegend.cl_lclr
	}
	optionarg /hidedefault glegend.cb_ljust
	option glegend.ck_lallkey
END

PROGRAM glegend_region_pr
BEGIN
   if !H(glegend.gb_region) {
     if glegend.cb_rcolor | !H(glegend.cl_rcolor) | 			///
	glegend.cb_rlcolor | !H(glegend.cl_rlcolor) |			///
	glegend.cb_rpos | glegend.ck_ring | glegend.ck_span | 		///
	glegend.cb_rmargin | glegend.cb_rlwd 				///
     {
	put " "  "legend("
	put /program glegend_region_opt_pr
	put ")"
     }
   }
END
PROGRAM glegend_region_opt_pr
BEGIN
	optionarg /hidedefault glegend.cb_rpos
	option  glegend.ck_ring
	option  glegend.ck_span

	if glegend.cb_rcolor | !H(glegend.cl_rcolor) |			///
		glegend.cb_rlcolor | !H(glegend.cl_rlcolor) |		///
		glegend.cb_rmargin | glegend.cb_rlwd 			///
	{
		put " "  "region("
		put /program glegend_region_opt2_pr
		put ")"
	}
END
PROGRAM glegend_region_opt2_pr
BEGIN
	if H(glegend.cl_rcolor) {
		optionarg /hidedefault glegend.cb_rcolor
	}
	if !H(glegend.cl_rcolor) {
		optionarg /quoted glegend.cl_rcolor
	}
	if H(glegend.cl_rlcolor) {
		optionarg /hidedefault glegend.cb_rlcolor
	}
	if !H(glegend.cl_rlcolor) {
		optionarg /quoted glegend.cl_rlcolor
	}
	optionarg /hidedefault glegend.cb_rmargin
	optionarg /hidedefault glegend.cb_rlwd
END

PROGRAM glegend_text_pr
BEGIN
    if !H(glegend.gb_title) {
	if glegend.ed_title | glegend.ed_stitle | glegend.ed_caption	///
		 | glegend.ed_note 					///
	{
		put " "
		put "legend("
		put /program glegend_text_opt_pr
		put ")"
	}
    }
END

PROGRAM glegend_text_opt_pr
BEGIN
	if glegend.ed_title {
		put " "  "title("
		put /hidden glegend.ed_title
		put /program glegend_title_opt_pr
		put ")"

	}
	if glegend.ed_stitle {
		put " "  "subtitle("
		put /hidden glegend.ed_stitle
		put /program glegend_subtitle_opt_pr
		put ")"
	}
	if glegend.ed_caption {
		put " "  "caption("
		put /hidden glegend.ed_caption
		put /program glegend_caption_opt_pr
		put ")"
	}
	if glegend.ed_note {
		put " "  "note("
		put /hidden glegend.ed_note
		put /program glegend_note_opt_pr
		put ")"
	}
END

PROGRAM glegend_title_opt_pr
BEGIN
	beginoptions
		hoptionarg /hidedefault glegend.cb_ttlsize
		if !Hcc(glegend.cb_ttlclr) {
			hoptionarg /hidedefault glegend.cb_ttlclr
		}
		if Hcc(glegend.cb_ttlclr) {
			hoptionarg /quoted glegend.cl_ttlclr
		}
	        hoptionarg /hidedefault glegend.cb_ttlpos
		hoptionarg /hidedefault glegend.cb_ttljust
		hoptionarg /hidedefault glegend.cb_ttlmrgn
		hoptionarg glegend.ed_ttlgp
		hoption glegend.ck_ttlbox
		if !Hcc(glegend.cb_ttlbclr) {
			hoptionarg /hidedefault glegend.cb_ttlbclr
		}
		if Hcc(glegend.cb_ttlbclr) {
			hoptionarg /quoted glegend.cl_ttlbclr
		}
		if !Hcc(glegend.cb_ttlblclr) {
			hoptionarg /hidedefault glegend.cb_ttlblclr
		}
		if Hcc(glegend.cb_ttlblclr) {
			hoptionarg /quoted glegend.cl_ttlblclr
		}
		hoptionarg glegend.cb_ttlmarg
		hoption glegend.ck_ttlexp
	endoptions
END

PROGRAM glegend_subtitle_opt_pr
BEGIN
	beginoptions
		hoptionarg /hidedefault glegend.cb_stlsize
		if !Hcc(glegend.cb_stlclr) {
			hoptionarg /hidedefault glegend.cb_stlclr
		}
		if Hcc(glegend.cb_stlclr) {
			hoptionarg /quoted glegend.cl_stlclr
		}
	        hoptionarg /hidedefault glegend.cb_stlpos
		hoptionarg /hidedefault glegend.cb_stljust
		hoptionarg /hidedefault glegend.cb_stlmrgn
		hoptionarg glegend.ed_stlgp
		hoption glegend.ck_stlbox
		if !Hcc(glegend.cb_stlbclr) {
			hoptionarg /hidedefault glegend.cb_stlbclr
		}
		if Hcc(glegend.cb_stlbclr) {
			hoptionarg /quoted glegend.cl_stlbclr
		}
		if !Hcc(glegend.cb_stlblclr) {
			hoptionarg /hidedefault glegend.cb_stlblclr
		}
		if Hcc(glegend.cb_stlblclr) {
			hoptionarg /quoted glegend.cl_stlblclr
		}
		hoptionarg glegend.cb_stlmarg
		hoption glegend.ck_stlexp
	endoptions
END

PROGRAM glegend_caption_opt_pr
BEGIN
	beginoptions
		hoptionarg /hidedefault glegend.cb_capsize
		if !Hcc(glegend.cb_capclr) {
			hoptionarg /hidedefault glegend.cb_capclr
		}
		if Hcc(glegend.cb_capclr) {
			hoptionarg /quoted glegend.cl_capclr
		}
	        hoptionarg /hidedefault glegend.cb_cappos
		hoptionarg /hidedefault glegend.cb_capjust
		hoptionarg /hidedefault glegend.cb_capmrgn
		hoptionarg glegend.ed_capgp
		hoption glegend.ck_capbox
		if !Hcc(glegend.cb_capbclr) {
			hoptionarg /hidedefault glegend.cb_capbclr
		}
		if Hcc(glegend.cb_capbclr) {
			hoptionarg /quoted glegend.cl_capbclr
		}
		if !Hcc(glegend.cb_capblclr) {
			hoptionarg /hidedefault glegend.cb_capblclr
		}
		if Hcc(glegend.cb_capblclr) {
			hoptionarg /quoted glegend.cl_capblclr
		}
		hoptionarg glegend.cb_capmarg
		hoption glegend.ck_capexp
	endoptions
END

PROGRAM glegend_note_opt_pr
BEGIN
	beginoptions
		hoptionarg /hidedefault glegend.cb_notsize
		if !Hcc(glegend.cb_notclr) {
			hoptionarg /hidedefault glegend.cb_notclr
		}
		if Hcc(glegend.cb_notclr) {
			hoptionarg /quoted glegend.cl_notclr
		}
	        hoptionarg /hidedefault glegend.cb_notpos
		hoptionarg /hidedefault glegend.cb_notjust
		hoptionarg /hidedefault glegend.cb_notmrgn
		hoptionarg glegend.ed_notgp
		hoption glegend.ck_notbox
		if !Hcc(glegend.cb_notbclr) {
			hoptionarg /hidedefault glegend.cb_notbclr
		}
		if Hcc(glegend.cb_notbclr) {
			hoptionarg /quoted glegend.cl_notbclr
		}
		if !Hcc(glegend.cb_notblclr) {
			hoptionarg /hidedefault glegend.cb_notblclr
		}
		if Hcc(glegend.cb_notblclr) {
			hoptionarg /quoted glegend.cl_notblclr
		}
		hoptionarg glegend.cb_notmarg
		hoption glegend.ck_notexp
	endoptions
END

PROGRAM glegend_output  /* To be used with out programming include */
BEGIN
	put " " /program glegend_controls_pr
	put " " /program glegend_region_pr
	put " " /program glegend_text_pr
END
/* end */
