[Fortran] 纯文本查看 复制代码
Program TEMP
USE CONSTANT_MODULE
Implicit None
Call DoDialog()
WRITE(*,*) N1
End Program TEMP
Subroutine DoDialog()
USE CONSTANT_MODULE
Use IFLogM
Implicit None
Include 'Resource.FD'
Integer retInt,cel
Integer( kind=4 ) :: results
Logical retLog
Character(256) text
Type(Dialog) dlg
External UpdateTemp
If (.Not.DlgInit(IDD_TEMP,dlg)) then
Write(*,*) "Error:dialog not found"
Else
retLog = DlgSet( dlg , IDC_EDIT_CELSIUS , "100" )
Call UpdateTemp( dlg , IDOK , DLG_CLICKED )
retLog = DlgSetSub( dlg , IDOK , UpdateTemp )
retLog = DlgSetSub( dlg , IDC_EDIT_FAHRENHEIT , UpdateTemp )
retLog = DlgGet( dlg , IDC_EDIT_FAHRENHEIT ,text) ! 这行是我添加的,想获取对话框结果并赋值
Read(text,*) cel
WRITE(*,*) cel
N1=cel
END IF
retInt = DlgModal( dlg )
Call DlgUnInit( dlg )
End Subroutine DoDialog
Subroutine UpdateTemp(dlg,control_Name,callBackType)
!DEC$ ATTRIBUTES DEFAULT::UpdateTemp
Use IFLogM
!USE IFQWIN
Implicit None
Type(dialog) dlg
Integer control_Name
Integer callBackType
Include 'Resource.FD'
Character(256) text
Integer cel,far,retInt
Logical retLog
!Suppress compiler warnings for unreferenced arguments.
Integer local_callBackType
retLog = DlgGet( dlg , IDC_EDIT_CELSIUS , text )
Read(text,*) cel
far = cel + 32.0
Write(text,*) far
retLog = DlgSet( dlg , IDC_EDIT_FAHRENHEIT , Trim(AdjustL(text)) )
Call DlgExit( dlg )
End Subroutine UpdateTemp