- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Can someone please tell me why the following code is not writing a multiline edit box? I have selected the multiline options in properties.
write (text, '(f6.4)') sigma
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.4)') delta
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.4)') theta
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f5.1)') Temp
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.3)') Press / 144
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(ES10.3)') Rho * 32.172
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f8.3)') C
lret = DlgSet(dlg, IDC_EDIT_TEST, text)
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.4)') delta
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.4)') theta
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f5.1)') Temp
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f6.3)') Press / 144
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(ES10.3)') Rho * 32.172
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(13)//char(10))
write (text, '(f8.3)') C
lret = DlgSet(dlg, IDC_EDIT_TEST, text)
Thank you,
David
링크가 복사됨
3 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
The content of an edit box has no concept of multiple "lines", it's only a single contiguous buffer. If the buffer content contains crlf, this is interpreted as "start a new line" when the (printable) text is printed in the box (ie, the multiline flag has been checked).
Hence you want to createone big buffer, fill it all in advance, and then write it once to your editbox, eg
character(len=300) :: text
character(len=2), parameter :: crlf = char(13)//char(10)
...
write (text,'(10(F6.4,A))') sigma,crlf,delta,crlf,theta,crlf,temp.... etc.
lret = DlgSet(dlg, IDC_EDIT_TEST, text//char(0))
Altho off-topic, I mustcomment thatthis would not be a very "friendly" or useable GUI; much better to have separate small data entry controls for each variable, if the idea is that they can be changed independently by the user. Also makes the coding much clearer, easier to maintain, etc.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
To David: it is possible to append to existing multi-line box without your own bookkeeping, but you have to use Win32 APIs. (Actually, DlgSendCtrlMessage + EM_* nessages). See this recent thread.
Jugoslav
