/*
	cabiplot_9

*!  VERSION 1.0.3  28sep2006

*/

VERSION 9.0

INCLUDE graph_header
INCLUDE header

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

DIALOG main, label("cabiplot - Correspondence analysis biplot") ///
		tabtitle("Main")
BEGIN
  GROUPBOX gb_dim		_lft	_top	_cwd1	_ht6,	///
  		label("Dimensions")
  RADIO    rb_default_dim	_ilft	_ss	_cwd3	.,	///
  		first label("Plot first and second dimensions")	///
  		onclickon(script main_dim_off)
  RADIO    rb_dim		@	_ss	@	.,	///
		last label("Specify other dimensions to plot")	///
		onclickon(script main_dim_on)
  EDIT     ed_dim		_indent2 _ss	_en7wd	.,	///
  		label("Two dimensions to plot") option(dim)	///
  		default("2  1")
  TEXT     tx_dim		_en7sep	@	200	.,	///
  		label("Two dimensions to plot")

  CHECKBOX ck_norow		_lft	+45	_cwd1	.,	///
  		label("Suppress row coordinates")		///
  		option(norow) 					///
  		onclickon(main.ck_nocolumn.disable)		///
  		onclickoff(main.ck_nocolumn.enable)
  CHECKBOX ck_nocolumn		@	_ms	@	.,	///
  		label("Suppress column coordinates")		///
  		option(nocolumn)				///
  		onclickon(main.ck_norow.disable)		///
  		onclickoff(main.ck_norow.enable)

  CHECKBOX ck_xnegate		_lft	_ms	_cwd1	.,	///
  		label("Negate the data relative to the x-axis")	///
  		option(xnegate)
  CHECKBOX ck_ynegate		@	_ms	@	.,	///
  		label("Negate the data relative to the y-axis")	///
  		option(ynegate)

  SPINNER  sp_maxlength		@	_ms	_spwd	.,	///
  		default(12) min(1) max(32) option(maxlength)
  TEXT     tx_maxlength		_spsep	@	_spr2	.,	///
  		label("Maximum number of characters displayed for labels")
END

SCRIPT main_dim_on
BEGIN
	main.ed_dim.enable
	main.tx_dim.enable
END
SCRIPT main_dim_off
BEGIN
	main.ed_dim.disable
	main.tx_dim.disable
END

INCLUDE ca_row
INCLUDE ca_column
INCLUDE gr_twoway

PROGRAM command
BEGIN
	put "cabiplot "
	beginoptions
		if main.rb_dim {
			require main.ed_dim
			optionarg main.ed_dim
		}
		option main.ck_norow
		option main.ck_nocolumn
		option main.ck_xnegate
		option main.ck_ynegate
		optionarg /hidedefault main.sp_maxlength
		put " " /program ca_row_output
		put " " /program ca_column_output
		put " " /program gr_twoway_output
	endoptions
END
