/*
	estimates describe

*!  VERSION 1.0.4  23mar2009

*/

VERSION 10.0

INCLUDE _std_msmall
DEFINE _dlght 160
INCLUDE header

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

DIALOG main, label("estimates describe - Describe estimation results") ///
	tabtitle("Main")
BEGIN

  RADIO rb_current	_lft	_top	_iwd	.,			///
	first								///
	label("Describe the current (active) estimates")		///
	onclickon(script main_off)

  RADIO rb_name		@	_ms	@	.,			///
	label("Describe stored estimates")				///
	onclickon(script main_name_on)
  COMBOBOX cb_name     	+20	_ss	_vnwd	.,			///
	label("Name of stored estimate") dropdown contents(estimates)
  TEXT tx_name		_vnsep	@	200	.,			///
	label("Name of stored estimate")

  RADIO	rb_file		_lft	_ls	_iwd	.,			///
	last								///
	label("Describe estimates saved in a file")			///
	onclickon(script main_file_on)
  FILE fi_fn     	+20	_ss	_inwd	.,			///
	option(using)							///
	label("Browse...")						///
	filter("Stata Estimates File (*.ster)|*.ster|All (*.*)|*.*")	///
	defext(ster) error("Estimates saved in a file")

  SPINNER sp_number	_lft	_ms	_spwd	.,			///
	option(number)							///
	min(1) max(10000000) default(1)
  TEXT tx_number	_spsep	@	_iwd	.,			///
	label("Estimates set to describe")
END

SCRIPT main_off
BEGIN
	main.tx_name.disable
	main.cb_name.disable
	main.fi_fn.disable
	main.tx_number.hide
	main.sp_number.hide
END

SCRIPT main_name_on
BEGIN
	main.tx_name.enable
	main.cb_name.enable
	main.fi_fn.disable
	main.tx_number.hide
	main.sp_number.hide
END

SCRIPT main_file_on
BEGIN
	main.tx_name.disable
	main.cb_name.disable
	main.fi_fn.enable
	main.tx_number.show
	main.sp_number.show
END

PROGRAM command
BEGIN
	put "estimates describe "
	if main.rb_name {
		require main.cb_name
		put main.cb_name
	}
	if main.rb_file {
		require main.fi_fn
		put  "using " `"""' main.fi_fn `"""'
		beginoptions
			optionarg /hidedefault main.sp_number
		endoptions
	}
END
