/*
	procrustes_estat

*!  VERSION 1.0.3  18apr2011

	***
	USE EXTREME CARE WHEN CHANGING CONTROL NAMES. The names used
	in this file have multiple external dependencies.
*/

VERSION 12

INCLUDE _std_large
INCLUDE header

HELP hlp1, view("help procrustes postestimation")
RESET res1

DIALOG main, label("estat - Postestimation tools for procrustes") tabtitle("Main")
BEGIN
  TEXT     tx_subcmd		_lft	_top	_iwd	.,		///
  	label("Reports and statistics: (subcommand)")
  LISTBOX  lb_subcmd		@	_ss	@	70,		///
  	contents(main_subcommand_contents)				///
  	values(main_subcommand_values)					///
  	onselchangelist(main_subcommand_scripts)

  DEFINE holdy 110

  // Compare options
  CHECKBOX ck_detail		_lft	holdy	_iwd	.,		///
  	option(detail)							///
  	label("Display the standard procrustes output for the two additional transformations")

  // mvreg optins
  CHECKBOX ck_noconstant	_lft	holdy	_iwd	.,		///
  	option(noconstant)						///
  	label("Suppress constant term")
  CHECKBOX ck_corr		@	_ms	@	.,		///
	label("Display correlation matrix")				///
	option(corr)
  CHECKBOX ck_notable		@	_xxls	@	.,		///
	label("Suppress coefficient table")				///
	option(notable)
  COMBOBOX cb_level		_lft	_ms	_spwd	.,		///
	dropdown							///
	label("Confidence level")					///
	default(c(level))						///
	contents(levels)						///
	option(level)
 
  TEXT     tx_level		_spsep	@	200	.,  		///
	label("Confidence level")

  // Summarize options
  CHECKBOX ck_labels		_lft	holdy	_iwd	.,		///
  	label("Display variable labels")				///
  	option(labels)
  CHECKBOX ck_noheader		_lft	_ms	_iwd	.,		///
	option(noheader)						///
	label("Suppress header")
  CHECKBOX ck_noweights		@	_ms	@	.,		///
	option(noweights)						///
	label("Ignore weights")
END

LIST main_subcommand_contents
BEGIN
	"Fit statistics for orthogonal, oblique, and unrestricted transformations (compare)"
	"Multivariate regression resembling unrestricted transformation (mvreg)"
	"Summarize estimation sample (summarize)"
END

LIST main_subcommand_values
BEGIN
	compare
	mvreg
	summarize
	vce
END

LIST main_subcommand_scripts
BEGIN
	script sel_compare
	script sel_mvreg
	script sel_summarize
	script sel_vce
END

SCRIPT sel_compare
BEGIN
	script main_hide_all
	main.ck_detail.show
END

SCRIPT sel_mvreg
BEGIN
	script main_hide_all
	main.ck_noconstant.show
	main.ck_corr.show
	main.ck_noheader.show
	main.ck_noheader.setposition . 160
	main.ck_notable.show
	main.cb_level.show
	main.tx_level.show
END

SCRIPT sel_summarize
BEGIN
	script main_hide_all
	script main_summ_on
END

SCRIPT sel_vce
BEGIN
	script main_hide_all
	program vce_on
END

SCRIPT main_summ_on
BEGIN
	main.ck_labels.show
	main.ck_noheader.show
	main.ck_noheader.setposition . 135
	main.ck_noweights.show
END

SCRIPT main_summ_off
BEGIN
	main.ck_labels.hide
	main.ck_noheader.hide
	main.ck_noweights.hide
END

SCRIPT main_hide_all
BEGIN
	main.ck_detail.hide
	main.ck_noconstant.hide
	main.ck_corr.hide
	main.ck_noheader.hide
	main.ck_notable.hide
	main.cb_level.hide
	main.tx_level.hide
	program vce_off
	script main_summ_off
END

PROGRAM vl_output
BEGIN
	put main.vl_spec
END

PROGRAM vl_eq_output
BEGIN
	put main.vl_eq
END

PROGRAM command
BEGIN
	put "estat "
	put main.lb_subcmd
	beginoptions
		// Compare options
		option main.ck_detail
		// mvreg options
		option main.ck_noconstant
		option main.ck_corr
		option main.ck_notable
		optionarg /hidedefault main.cb_level
		// Summarize options
		option main.ck_labels
		option main.ck_noheader
		option main.ck_noweights
	endoptions
END
