/*
    irf_rename.dlg

*!  VERSION 1.2.1  21feb2007

*/

VERSION 10.0
SYNCHRONOUS_ONLY

INCLUDE _std_msmall
DEFINE _dlght 200
INCLUDE header
HELP hlp1, view("help irf_rename")
RESET res1

DIALOG main, label("irf rename - Rename an IRF result in an IRF file") tabtitle("Main")
BEGIN
  DEFINE _x _xsetbu
  DEFINE _y _top
  INCLUDE _bu_irfset

  TEXT     tx_old            _lft      _ls       140       ., 		///
  		label("Original name:")
  DEFINE holdy @y
  COMBOBOX cb_old            @         _ss       @         ., 		///
  		dropdownlist						///
  		contents(irf_list)					///
  		label("Original name")
  TEXT     tx_new            +160      holdy     140       ., 		///
  		label("New name:")
  EDIT     ed_new            @         _ss       140       ., 		///
  		label("New name") max(32) nomemory

  GROUPBOX gb_note           _lft      +35       _iwd     _ht5h,
  TEXTBOX  tb_note1          _indent   _vss      _inwd     _tb2,	///
  		label(Refresh IRF selections any time the active IRF 	///
  			file is set or changed while this dialog is open.)
  BUTTON   bu_refresh        _irj100   _xls       100       ., 		///
  		label("Refresh") 					///
  		onpush(program main_get_irf)
END

SCRIPT	POSTINIT
BEGIN
	program main_get_irf
END

PROGRAM main_get_irf
BEGIN
	put "_get_irf, "
	put "dialog(irf_rename) "
	put "control(main.cb_old) "
	put "irfvalue("
		put main.cb_old
	put ") "
	stata hidden
END


PROGRAM command
BEGIN
	put "irf rename "
	require main.cb_old
	require main.ed_new
	put main.cb_old  " "
	put main.ed_new
	/* not doing -set- option since IRF set button at top */
END
