/*
  gbarlabel.idlg Include for graphics labels

*!  VERSION 1.1.2  31mar2005

*/

DIALOG gbarlabel, tabtitle("Labels")
BEGIN

  /* LEFT SIDE-- Label */
  GROUPBOX gb_label    _lft        _top      _gwd1       _ht25,	///
	label("Label options ")
  /* LEFT SIDE-- Label col(1) */
  TEXT     tx_type     _igft       _ms       _txwd       ., 	///
	label("Label type:") right
  COMBOBOX cb_type     _txsep      @         _txr2b4g    .,	///
	dropdownlist 						///
	contents(gbarlabel_type) values(gbarlabel_type_values)
  DEFINE   y @y
  TEXT     tx_size     _igft       _ms       _txwd       .,	///
	label("Size:") right
  COMBOBOX cb_size     _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(textsizes) option(size)
  TEXT     tx_clr      _igft       _ms       _txwd       .,	///
	label("Color:") right
  COMBOBOX cb_clr      _txsep      @         _tcr2b4g    .,	///
	dropdownlist contents(colors) 				///
	onselchangelist(gbarlabel_cl_clr_sel) option(color)
  COLOR    cl_clr      _tcr2b4gsep @         _colorwd    .,	///
	option(color)
  TEXT     tx_posit    _igft       _ms       _txwd       .,	///
	label("Position:") right
  COMBOBOX cb_posit    _txsep      @         _txr2b4g    .,	///
	dropdownlist option(position) 				///
	contents(gbarlabel_position) 				///
	values(gbarlabel_position_values)
  TEXT     tx_orient   _igft       _ms       _txwd       .,	///
	label("Orientation:") right
  COMBOBOX cb_orient   _txsep      @         _txr2b4g    .,	///
	dropdownlist option(orientation) 			///
	contents(orientation) values(orientation_values)

  /* LEFT SIDE-- Label upper col(2)*/

  TEXT     tx_just     _lft4_2g    y         _txwd       .,	///
	label("Justify:") right
  COMBOBOX cb_just     _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(justification)  option(justification)
  TEXT     tx_align    _lft4_2g    _ms       _txwd       .,	///
	label("Alignment:") right
  COMBOBOX cb_align    _txsep      @         _txr2b4g    .,	///
	dropdownlist contents(alignment)  option(alignment)
  TEXT     tx_margin   _lft4_2g    _ms       _txwd       .,	///
	label("Margin:") right
  COMBOBOX cb_margin   _txsep      @         _txr2b4g    .,	///
	dropdown contents(margin) option(margin)
  TEXT     tx_gap      _lft4_2g    _ms       _txwd       .,	///
  	label("Label gap:") right
  EDIT     ed_gap      _txsep      @	     _txr2b4g    .,	///
	option(gap)
  TEXT     tx_fmt      _lft4_2g    _ms       _txwd       .,	///
  	label("Format:") right
  EDIT     ed_fmt      _txsep      @         _tcr2b4g    .,	///
	option(format)
  BUTTON   bt_fmt      _tcr2b4gsep @         _btwd       .,	///
  	label("?") onpush(view help format##|_new)

  /* LEFT SIDE-- Label lower*/
  CHECKBOX ck_box      _igft       +35       _cwd1gb     _ht8,	///
	groupbox label("Box") option(box) 			///
	onclickon(script gbarlabel_box_on)			///
	onclickoff(script gbarlabel_box_off)

  /* LEFT SIDE-- Label lower col(1)*/
  TEXT     tx_bclr     _iigft      _ms       _txswd      .,	///
	label("Fill color:") right
  COMBOBOX cb_bclr     _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(fcolor) 		///
	onselchangelist(gbarlabel_cl_bclr_sel)
  COLOR    cl_bclr     _tcr2b4gsep @         _colorwd    .,	///
	option(fcolor)

  DEFINE y3 @y
  TEXT     tx_blclr    _iigft      _ms       _txswd      .,	///
	label("Line color:") right
  COMBOBOX cb_blclr    _txssep     @         _tcr2b4g    .,	///
	dropdownlist contents(colors) option(lcolor)		///
	onselchangelist(gbarlabel_cl_blclr_sel)
  COLOR    cl_blclr    _tcr2b4gsep @         _colorwd    .,	///
	option(lcolor)

  TEXT     tx_bmargin  _iigft      _ms       _txswd      .,	///
	label("Margin:") right
  COMBOBOX cb_bmargin  _txssep     @         _txr2b4g    .,	///
	dropdown contents(margin) option(bmargin)
END

LIST gbarlabel_type
BEGIN
	"None"
	"Bar"
	"Total"
	"Name"
	"Group"
END

LIST gbarlabel_type_values
BEGIN
	""
	"bar"
	"total"
	"name"
	"group"
END

LIST gbarlabel_position
BEGIN
	"Default"
	"Outside"
	"Inside"
	"Base"
	"Center"
END

LIST gbarlabel_position_values
BEGIN
	""
	"outside"
	"inside"
	"base"
	"center"
END

LIST gbarlabel_cl_clr_sel
BEGIN
	gbarlabel.cl_clr.hide
	gbarlabel.cl_clr.show
	gbarlabel.cl_clr.hide
END

LIST gbarlabel_cl_bclr_sel
BEGIN
	gbarlabel.cl_bclr.hide
	gbarlabel.cl_bclr.show
	gbarlabel.cl_bclr.hide
END

LIST gbarlabel_cl_blclr_sel
BEGIN
	gbarlabel.cl_blclr.hide
	gbarlabel.cl_blclr.show
	gbarlabel.cl_blclr.hide
END

SCRIPT gbarlabel_box_on
BEGIN
	gbarlabel.tx_bclr.enable
	gbarlabel.cb_bclr.enable
	gbarlabel.cl_bclr.enable
	gbarlabel.tx_blclr.enable
	gbarlabel.cb_blclr.enable
	gbarlabel.cl_blclr.enable
	gbarlabel.tx_bmargin.enable
	gbarlabel.cb_bmargin.enable
END

SCRIPT gbarlabel_box_off
BEGIN
	gbarlabel.tx_bclr.disable
	gbarlabel.cb_bclr.disable
	gbarlabel.cl_bclr.disable
	gbarlabel.tx_blclr.disable
	gbarlabel.cb_blclr.disable
	gbarlabel.cl_blclr.disable
	gbarlabel.tx_bmargin.disable
	gbarlabel.cb_bmargin.disable
END

/* Script to enable this tab */
SCRIPT gbarlabel_enable
BEGIN
	program gbarlabel_enable_pr
END

PROGRAM gbarlabel_enable_pr
BEGIN
	call gaction gbarlabel.gb_label.enable
	call gaction gbarlabel.tx_type.enable
	call gaction gbarlabel.cb_type.enable
	call gaction gbarlabel.tx_size.enable
	call gaction gbarlabel.cb_size.enable
	call gaction gbarlabel.tx_clr.enable
	call gaction gbarlabel.cb_clr.enable
	call gaction gbarlabel.cl_clr.enable
	call gaction gbarlabel.tx_posit.enable
	call gaction gbarlabel.cb_posit.enable
	call gaction gbarlabel.tx_orient.enable
	call gaction gbarlabel.cb_orient.enable
	call gaction gbarlabel.tx_just.enable
	call gaction gbarlabel.cb_just.enable
	call gaction gbarlabel.tx_align.enable
	call gaction gbarlabel.cb_align.enable
	call gaction gbarlabel.tx_margin.enable
	call gaction gbarlabel.cb_margin.enable
	call gaction gbarlabel.ck_box.enable
	call gaction gbarlabel.tx_fmt.enable
	call gaction gbarlabel.ed_fmt.enable
	call gaction gbarlabel.bt_fmt.enable
	call gaction gbarlabel.tx_gap.enable
	call gaction gbarlabel.ed_gap.enable
	if gbarlabel.ck_box {
		call script gbarlabel_box_on
	}
END

/* Script to disable this tab */
SCRIPT gbarlabel_disable
BEGIN
	gbarlabel.gb_label.disable
	gbarlabel.tx_type.disable
	gbarlabel.cb_type.disable
	gbarlabel.tx_size.disable
	gbarlabel.cb_size.disable
	gbarlabel.tx_clr.disable
	gbarlabel.cb_clr.disable
	gbarlabel.cl_clr.disable
	gbarlabel.tx_posit.disable
	gbarlabel.cb_posit.disable
	gbarlabel.tx_orient.disable
	gbarlabel.cb_orient.disable
	gbarlabel.tx_just.disable
	gbarlabel.cb_just.disable
	gbarlabel.tx_align.disable
	gbarlabel.cb_align.disable
	gbarlabel.tx_margin.disable
	gbarlabel.cb_margin.disable
	gbarlabel.tx_fmt.disable
	gbarlabel.ed_fmt.disable
	gbarlabel.bt_fmt.disable
	gbarlabel.tx_gap.disable
	gbarlabel.ed_gap.disable
	gbarlabel.ck_box.disable
	script gbarlabel_box_off
END

PROGRAM gbarlabel_label_opt_pr
BEGIN
	beginoptions
		optionarg /hidedefault gbarlabel.cb_size
      		if H(gbarlabel.cl_clr) {
			optionarg /hidedefault gbarlabel.cb_clr
      		}
      		if !H(gbarlabel.cl_clr) {
			optionarg /quoted gbarlabel.cl_clr
		}
		optionarg /hidedefault gbarlabel.cb_posit
		optionarg /hidedefault gbarlabel.cb_orient
		optionarg /hidedefault gbarlabel.cb_just
		optionarg /hidedefault gbarlabel.cb_align
		optionarg /hidedefault gbarlabel.cb_margin
		optionarg /hidedefault gbarlabel.ed_gap
		optionarg /hidedefault gbarlabel.ed_fmt
		option gbarlabel.ck_box
		if H(gbarlabel.cl_bclr) {
			optionarg /hidedefault gbarlabel.cb_bclr
		}
		if !H(gbarlabel.cl_bclr) {
			optionarg /quoted gbarlabel.cl_bclr
		}
		if H(gbarlabel.cl_blclr) {
			optionarg /hidedefault gbarlabel.cb_blclr
		}
		if !H(gbarlabel.cl_blclr) {
			optionarg /quoted gbarlabel.cl_blclr
		}
		optionarg /hidedefault gbarlabel.cb_bmargin
	endoptions
END

PROGRAM gbarlabel_output
BEGIN
    if !H(gbarlabel.cb_type) & gbarlabel.cb_type {
	put "blabel(" gbarlabel.cb_type
	put /program gbarlabel_label_opt_pr
	put ") "
    }
END
