/*
	cumsp

*!  VERSION 2.0.2  07mar2011

*/

VERSION 12.0

INCLUDE _std_mlarge
DEFINE _dlght 300
INCLUDE header

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

SCRIPT POSTINIT
BEGIN
	script gr_plots_setDefaultConnected
END

DIALOG main, label("cumsp - Graph cumulative spectral distribution")	///
	tabtitle("Main")
BEGIN
  DEFINE _x _xsetbu
  DEFINE _y _top
  INCLUDE _bu_tsset
  TEXT     tx_var	_lft	_top	_cwd2	.,		///
	label("Variable:")
  VARNAME  vn_var	@	_ss	_vnwd	., allowts	///
	label("Variable")
  CHECKBOX ck_gen	_lft	+35	_iwd	.,		///
	label("Generate variable holding distribution values")	///
	onclickon(script gen_on)				///
	onclickoff(script gen_off)
  EDIT     ed_gen	_indent2 _ss	_vnwd	.,		///
	option(generate) label("New variable name")
  TEXT     tx_gen	_vnsep	@	120	.,		///
	label("New variable name")
END

SCRIPT gen_on
BEGIN
	main.ed_gen.enable
	main.tx_gen.enable
END

SCRIPT gen_off
BEGIN
	main.ed_gen.disable
	main.tx_gen.disable
END

INCLUDE ifin
INCLUDE gr_plots
INCLUDE gr_addplots
INCLUDE gr_yaxis
INCLUDE gr_xaxis
INCLUDE gr_titles
INCLUDE gr_legend
INCLUDE gr_overall

PROGRAM command
BEGIN
	put "cumsp "
	varlist main.vn_var
	put " " /program ifin_output
	beginoptions
		if main.ck_gen {
			require main.ed_gen
			optionarg main.ed_gen
		}
		put " " /program gr_plots_output
		put " " /program gr_addplots_output
		put " " /program gr_yaxis_output
		put " " /program gr_xaxis_output
		put " " /program gr_titles_output
		put " " /program gr_legend_output
		put " " /program gr_overall_output
	endoptions
END
