/*
	pergram

*!  VERSION 2.0.1  07mar2011

*/

VERSION 12.0

INCLUDE _std_mlarge
DEFINE _dlght 300
INCLUDE header
HELP hlp1, view("help pergram")
RESET res1

SCRIPT POSTINIT
BEGIN
	script gr_plots_setDefaultConnected
END

DIALOG	main, label("pergram - Periodogram") 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	.,	///
	label("Variable") allowts

  CHECKBOX ck_generate		@	+35 	_iwd	.,	///
	onclickon(script gen_on)				///
	onclickoff(script gen_off)				///
	label("Generate a new variable to contain the raw periodogram values")	
  EDIT	   ed_generate		_indent2 _ss	_vnwd	.,	///
	max(32) option(generate)				///
	label("New variable name")
  TEXT     tx_generate		_vnsep	@	120	.,	///
	label("New variable name")
END

SCRIPT gen_on
BEGIN
	main.ed_generate.enable
	main.tx_generate.enable
END

SCRIPT gen_off
BEGIN
	main.ed_generate.disable
	main.tx_generate.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 "pergram"
	varlist main.vn_var
	put " " /program ifin_output
	beginoptions
		if main.ck_generate {
			require main.ed_generate
			optionarg main.ed_generate
		}
		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
