module dados
  use dialogm
  include 'resource.fd'

contains

subroutine DoDialog(n1,n2,nitm1,nitm2,ofmin,ofmax,pt,tol1,tol2,   &
                    cr1,cr2,cr3,cr4)
  implicit real*8(a-h,o-z)
  logical retlog,indicado1,indicado2,indicado3,indicado4
  integer retint
  type(dialog) dlg
  character(256) text

! Initialize.
  if(.not.DlgInit(IDD_DIALOG1,dlg))then
    write(*,*) "Error: dialog not found"
  else

! Set up dados controls.
    retlog=DlgSet(dlg,IDC_EDIT1,"0.5d0")
	retlog=DlgSet(dlg,IDC_EDIT2,"2.0d0")
    retlog=DlgSet(dlg,IDC_EDIT3,"10")
	retlog=DlgSet(dlg,IDC_EDIT4,"20")
    retlog=DlgSet(dlg,IDC_EDIT5,"1.0d0")
	retlog=DlgSet(dlg,IDC_EDIT6,"1.0d-3")
    retlog=DlgSet(dlg,IDC_EDIT7,"100")
	retlog=DlgSet(dlg,IDC_EDIT8,"1.0d-10")
    retlog=DlgSet(dlg,IDC_EDIT9,"200")
    retlog=DLGSET(dlg,IDC_CHECK1,.TRUE.)
    retlog=DLGSET(dlg,IDC_CHECK2,.TRUE.)
    retlog=DLGSET(dlg,IDC_CHECK3,.TRUE.)
    retlog=DLGSET(dlg,IDC_CHECK4,.TRUE.)
! Activate the dialog.
    retint = DlgModal(dlg)
	retlog=DlgGet(dlg,IDC_EDIT1,text)
    read(text,*,iostat=retint) ofmin
	retlog=DlgGet(dlg,IDC_EDIT2,text)
    read(text,*,iostat=retint) ofmax
	retlog=DlgGet(dlg,IDC_EDIT3,text)
    read(text,*,iostat=retint) n1
	retlog=DlgGet(dlg,IDC_EDIT4,text)
    read(text,*,iostat=retint) n2
	retlog=DlgGet(dlg,IDC_EDIT5,text)
    read(text,*,iostat=retint) pt
	retlog=DlgGet(dlg,IDC_EDIT6,text)
    read(text,*,iostat=retint) tol1
	retlog=DlgGet(dlg,IDC_EDIT7,text)
    read(text,*,iostat=retint) nitm1
	retlog=DlgGet(dlg,IDC_EDIT8,text)
    read(text,*,iostat=retint) tol2
	retlog=DlgGet(dlg,IDC_EDIT9,text)
    read(text,*,iostat=retint) nitm2
    retlog=DLGGET(dlg,IDC_CHECK1,indicado1)
	if(.not.indicado1) then
	  cr1 = 0.0d0
	else
	  cr1 = 1.0d0
	end if
    retlog=DLGGET(dlg,IDC_CHECK2,indicado2)
	if(.not.indicado2) then
	  cr2 = 0.0d0
	else
	  cr2 = 1.0d0
	end if
    retlog=DLGGET(dlg,IDC_CHECK3,indicado3)
	if(.not.indicado3) then
	  cr3 = 0.0d0
	else
	  cr3 = 1.0d0
	end if
    retlog=DLGGET(dlg,IDC_CHECK4,indicado4)
	if(.not.indicado4) then
	  cr4 = 0.0d0
	else
	  cr4 = 1.0d0
	end if

! Release dialog resources.
    call DlgUninit(dlg)

  end if 

 end subroutine DoDialog


subroutine menu(i1,i2,i3,i4,i5,i6,i7,i8,i9,i10)
  implicit real*8(a-h,o-z)
  logical retlog,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10
  integer retint
  type(dialog) dlg

! Initialize.
  if(.not.DlgInit(IDD_DIALOG2,dlg))then
    write(*,*) "Error: dialog not found"
  else

! Activate the dialog.
    retint = DlgModal(dlg)

    retlog=DLGGET(dlg,IDC_RADIO1,i1)
    retlog=DLGGET(dlg,IDC_RADIO2,i2)
    retlog=DLGGET(dlg,IDC_RADIO3,i3)
    retlog=DLGGET(dlg,IDC_RADIO4,i4)
    retlog=DLGGET(dlg,IDC_RADIO5,i5)
    retlog=DLGGET(dlg,IDC_RADIO6,i6)
    retlog=DLGGET(dlg,IDC_RADIO7,i7)
    retlog=DLGGET(dlg,IDC_RADIO8,i8)
    retlog=DLGGET(dlg,IDC_RADIO9,i9)
    retlog=DLGGET(dlg,IDC_RADIO10,i10)

! Release dialog resources.
    call DlgUninit(dlg)

  end if 

 end subroutine menu



end module dados

