/*
    gr_fpfit_options.dlg
    
*!  VERSION 1.0.0  29oct2006 

*/

VERSION 10

INCLUDE _std_medium
INCLUDE header_gr_child

DEFINE _clwd 15

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

SCRIPT PREINIT
BEGIN
	create STRING lineResults
END

SCRIPT POSTINIT
BEGIN
	program checkLineResults
END

DIALOG main, label("Fractional polynomial options") tabtitle("Main")
BEGIN
  TEXT     tx_command		_lft	_top	_iwd	.,	///
	label("Estimation command:")
  COMBOBOX cb_command		_lft	_ss	_vnwd	.,	///
	dropdownlist						///
	contents(est_command_list) 				///
	onselchangelist(est_command_action_list)		///
	option(estcmd) default(regress)
	
  BUTTON   bu_line_opts		_lft	+45	120	.,	///
	label("Line properties  ")				///
	onpush(script line_options_show)			///
	tooltip("Line properties for fractional polynomial plot")
END

LIST est_command_list
BEGIN
	regress
	clogit
	glm
	logit
	logistic
	poisson
	probit
	stcox
	streg	
END

LIST est_command_action_list
BEGIN
	script regress_on
	script clogit_on
	script glm_on
	script logit_on
	script logistic_on
	script poisson_on
	script probit_on
	script stcox_on
	script streg_on
END

SCRIPT regress_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for regress:"
	adv.bu_regress.show
	adv.bu_clogit.hide
	adv.bu_glm.hide
	adv.bu_logit.hide
	adv.bu_logistic.hide
	adv.bu_poisson.hide
	adv.bu_probit.hide
	adv.bu_stcox.hide
	adv.bu_streg.hide
	
	adv.bu_pregress.show
	adv.bu_pclogit.hide
	adv.bu_pglm.hide
	adv.bu_plogit.hide
	adv.bu_plogistic.hide
	adv.bu_ppoisson.hide
	adv.bu_pprobit.hide
	adv.bu_pstcox.hide
	adv.bu_pstreg.hide
END

SCRIPT clogit_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for clogit:"
	adv.bu_regress.hide
	adv.bu_clogit.show
	adv.bu_glm.hide
	adv.bu_logit.hide
	adv.bu_logistic.hide
	adv.bu_poisson.hide
	adv.bu_probit.hide
	adv.bu_stcox.hide
	adv.bu_streg.hide
	
	adv.bu_pregress.hide
	adv.bu_pclogit.show
	adv.bu_pglm.hide
	adv.bu_plogit.hide
	adv.bu_plogistic.hide
	adv.bu_ppoisson.hide
	adv.bu_pprobit.hide
	adv.bu_pstcox.hide
	adv.bu_pstreg.hide
END

SCRIPT glm_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for glm:"
	adv.bu_regress.hide
	adv.bu_clogit.hide
	adv.bu_glm.show
	adv.bu_logit.hide
	adv.bu_logistic.hide
	adv.bu_poisson.hide
	adv.bu_probit.hide
	adv.bu_stcox.hide
	adv.bu_streg.hide

	adv.bu_pregress.hide
	adv.bu_pclogit.hide
	adv.bu_pglm.show
	adv.bu_plogit.hide
	adv.bu_plogistic.hide
	adv.bu_ppoisson.hide
	adv.bu_pprobit.hide
	adv.bu_pstcox.hide
	adv.bu_pstreg.hide
END

SCRIPT logit_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for logit:"
	adv.bu_regress.hide
	adv.bu_clogit.hide
	adv.bu_glm.hide
	adv.bu_logit.show
	adv.bu_logistic.hide
	adv.bu_poisson.hide
	adv.bu_probit.hide
	adv.bu_stcox.hide
	adv.bu_streg.hide
	
	adv.bu_pregress.hide
	adv.bu_pclogit.hide
	adv.bu_pglm.hide
	adv.bu_plogit.show
	adv.bu_plogistic.hide
	adv.bu_ppoisson.hide
	adv.bu_pprobit.hide
	adv.bu_pstcox.hide
	adv.bu_pstreg.hide
END

SCRIPT logistic_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for logistic:"
	adv.bu_regress.hide
	adv.bu_clogit.hide
	adv.bu_glm.hide
	adv.bu_logit.hide
	adv.bu_logistic.show
	adv.bu_poisson.hide
	adv.bu_probit.hide
	adv.bu_stcox.hide
	adv.bu_streg.hide

	adv.bu_pregress.hide
	adv.bu_pclogit.hide
	adv.bu_pglm.hide
	adv.bu_plogit.hide
	adv.bu_plogistic.show
	adv.bu_ppoisson.hide
	adv.bu_pprobit.hide
	adv.bu_pstcox.hide
	adv.bu_pstreg.hide
END

SCRIPT poisson_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for poisson:"
	adv.bu_regress.hide
	adv.bu_clogit.hide
	adv.bu_glm.hide
	adv.bu_logit.hide
	adv.bu_logistic.hide
	adv.bu_poisson.show
	adv.bu_probit.hide
	adv.bu_stcox.hide
	adv.bu_streg.hide

	adv.bu_pregress.hide
	adv.bu_pclogit.hide
	adv.bu_pglm.hide
	adv.bu_plogit.hide
	adv.bu_plogistic.hide
	adv.bu_ppoisson.show
	adv.bu_pprobit.hide
	adv.bu_pstcox.hide
	adv.bu_pstreg.hide
END

SCRIPT probit_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for probit:"
	adv.bu_regress.hide
	adv.bu_clogit.hide
	adv.bu_glm.hide
	adv.bu_logit.hide
	adv.bu_logistic.hide
	adv.bu_poisson.hide
	adv.bu_probit.show
	adv.bu_stcox.hide
	adv.bu_streg.hide

	adv.bu_pregress.hide
	adv.bu_pclogit.hide
	adv.bu_pglm.hide
	adv.bu_plogit.hide
	adv.bu_plogistic.hide
	adv.bu_ppoisson.hide
	adv.bu_pprobit.show
	adv.bu_pstcox.hide
	adv.bu_pstreg.hide
END

SCRIPT stcox_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for stcox:"
	adv.bu_regress.hide
	adv.bu_clogit.hide
	adv.bu_glm.hide
	adv.bu_logit.hide
	adv.bu_logistic.hide
	adv.bu_poisson.hide
	adv.bu_probit.hide
	adv.bu_stcox.show
	adv.bu_streg.hide

	adv.bu_pregress.hide
	adv.bu_pclogit.hide
	adv.bu_pglm.hide
	adv.bu_plogit.hide
	adv.bu_plogistic.hide
	adv.bu_ppoisson.hide
	adv.bu_pprobit.hide
	adv.bu_pstcox.show
	adv.bu_pstreg.hide
END

SCRIPT streg_on
BEGIN
	adv.tx_cmdopts.setlabel "Options for streg:"
	adv.bu_regress.hide
	adv.bu_clogit.hide
	adv.bu_glm.hide
	adv.bu_logit.hide
	adv.bu_logistic.hide
	adv.bu_poisson.hide
	adv.bu_probit.hide
	adv.bu_stcox.hide
	adv.bu_streg.show

	adv.bu_pregress.hide
	adv.bu_pclogit.hide
	adv.bu_pglm.hide
	adv.bu_plogit.hide
	adv.bu_plogistic.hide
	adv.bu_ppoisson.hide
	adv.bu_pprobit.hide
	adv.bu_pstcox.hide
	adv.bu_pstreg.show
END

SCRIPT line_options_show
BEGIN
	create CHILD gr_line_options AS lineOptions, allowsubmit
	lineOptions.setExitString lineResults
	lineOptions.settitle "Line properties for fractional polynomial plot"
	lineOptions.setExitAction "program checkLineResults"
	lineOptions.setSubmitAction "script lineSubmit"
END
PROGRAM checkLineResults
BEGIN
	if lineResults.iseq("") {
		call main.bu_line_opts.setlabel "Line properties  "
	}
	if lineResults.isneq("") {
		call main.bu_line_opts.setlabel "Line properties *"
	}
END
SCRIPT lineSubmit
BEGIN
	program checkLineResults
	Submit
END

DIALOG adv, tabtitle("Advanced")
BEGIN
  TEXT     tx_cmdopts		_lft	_top	_vlwd	.,	///
	label("Options for estimation command:")
  EDIT	   ed_cmdopts		@	_ss	@	.,	///
	option(estopts)
  BUTTON   bu_regress		_vlsep	@	_clwd	.,	///
	label("?") tooltip("Help - regress") 			///
	onpush(view help regress##|_new)
  BUTTON   bu_clogit		@	@	@	.,	///
	label("?") tooltip("Help - clogit") 			///
	onpush(view help clogit##|_new)
  BUTTON   bu_glm		@	@	@	.,	///
	label("?") tooltip("Help - glm") 			///
	onpush(view help glm##|_new)	
  BUTTON   bu_logit		@	@	@	.,	///
	label("?") tooltip("Help - logit") 			///
	onpush(view help logit##|_new)
  BUTTON   bu_logistic		@	@	@	.,	///
	label("?") tooltip("Help - logistic") 			///
	onpush(view help logistic##|_new)
  BUTTON   bu_poisson		@	@	@	.,	///
	label("?") tooltip("Help - poisson") 			///
	onpush(view help poisson##|_new)
  BUTTON   bu_probit		@	@	@	.,	///
	label("?") tooltip("Help - probit") 			///
	onpush(view help probit##|_new)
  BUTTON   bu_stcox		@	@	@	.,	///
	label("?") tooltip("Help - stcox") 			///
	onpush(view help stcox##|_new)
  BUTTON   bu_streg		@	@	@	.,	///
	label("?") tooltip("Help - streg") 			///
	onpush(view help streg##|_new)

  TEXT     tx_predict		_lft	_ls	_vlwd	.,	///
	label("Predict options:")
  EDIT	   ed_predict		@	_ss	@	.,	///
	option(predopts)	
  BUTTON   bu_pregress		_vlsep	@	_clwd	.,	///
	label("?") tooltip("Help - predict after regress")	///
	onpush(view help regress postestimation##predict|_new)
  BUTTON   bu_pclogit		@	@	@	.,	///
	label("?") tooltip("Help - predict after clogit") 	///
	onpush(view help clogit postestimation##predict|_new)
  BUTTON   bu_pglm		@	@	@	.,	///
	label("?") tooltip("Help - predict after glm") 		///
	onpush(view help glm postestimation##predict|_new)	
  BUTTON   bu_plogit		@	@	@	.,	///
	label("?") tooltip("Help - predict after logit") 	///
	onpush(view help logit postestimation##predict|_new)
  BUTTON   bu_plogistic		@	@	@	.,	///
	label("?") tooltip("Help - predict after logistic") 	///
	onpush(view help logistic postestimation##predict|_new)
  BUTTON   bu_ppoisson		@	@	@	.,	///
	label("?") tooltip("Help - predict after poisson") 	///
	onpush(view help poisson postestimation##predict|_new)
  BUTTON   bu_pprobit		@	@	@	.,	///
	label("?") tooltip("Help - predict after probit") 	///
	onpush(view help probit postestimation##predict|_new)
  BUTTON   bu_pstcox		@	@	@	.,	///
	label("?") tooltip("Help - predict after stcox") 	///
	onpush(view help stcox postestimation##predict|_new)
  BUTTON   bu_pstreg		@	@	@	.,	///
	label("?") tooltip("Help - predict after streg") 	///
	onpush(view help streg postestimation##predict|_new)
END

PROGRAM command
BEGIN
	optionarg /hidedefault main.cb_command
	put " " lineResults " "
	
	optionarg adv.ed_cmdopts
	optionarg adv.ed_predict
END
