- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does anybody know if there is something like Visual Basic's InputBox function to be called in QuickWin? (A little dialog with OK- and Cancel-buttons and an Edit box). Perhaps something like MESSAGEBOXQQ?
Sabalan.
Sabalan.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's easy to create your own with a simple dialog box and an edit control. It's only two lines of Fortran source - DlgModal and DlgGet.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, Thanks for the tip. Maybe I should explain the problem more detailed: I have a dialog in QuickWin with several buttons and Edit boxes. What I wished was to open a new simple dialog when I click one of the buttons in the first dialog, to make it possible for the user to enter a value. I can do this in VB with just one line:
This opens a little, predesigned dialog, without losing the first dialog (or "form"), with an Edit box and 2 buttons: OK and Cancel. I don't even need to check if the OK or Cancel button was clicked or Enter was pushed. MyVariable is going to get a value from Edit box, or 0 if Cancel is clicked.
But I have been thinking, writing, coding, testing, reading N. Lawrence's book, tearing my hair, and have not been able to do this in 2 Fortran lines! What I have to do is as follows:
I have to design a new dialog in Resource Editor with 2 Edit boxes: 1 without border and "Read only" to show the prompt (above), and the other as an ordinary Edit box. This dialog can be called IDD_DIALOG2. Then:
Several variable declarations and a COMMON, and:
I Have to create a callback subroutine UpdateValue too, with SELECT CASE, and COMMON, and variable declarations, to update the CallBackVar. And forget about controlling the position of the dialog and help facilities (as I could do with VB InputBox).
I think that I should create an own function to do this, because I have to use such a thing very often. But I appreciate very much if you could show an easier way for that (although not just in 2 Fortran lines!). As I wrote in my question, something like MESSAGEBOXQQ would be ideal.
Regards,
Sabalan.
MyVariable=Val( InputBox(prompt[, title][, default][, xpos][, ypos][, helpfile, context]))
This opens a little, predesigned dialog, without losing the first dialog (or "form"), with an Edit box and 2 buttons: OK and Cancel. I don't even need to check if the OK or Cancel button was clicked or Enter was pushed. MyVariable is going to get a value from Edit box, or 0 if Cancel is clicked.
But I have been thinking, writing, coding, testing, reading N. Lawrence's book, tearing my hair, and have not been able to do this in 2 Fortran lines! What I have to do is as follows:
I have to design a new dialog in Resource Editor with 2 Edit boxes: 1 without border and "Read only" to show the prompt (above), and the other as an ordinary Edit box. This dialog can be called IDD_DIALOG2. Then:
Several variable declarations and a COMMON, and:
Status = DlgInit (IDD_DIALOG2, InputData) ! the first dialog disappears
Status = DlgSet (InputData, IDC_EDIT1, Trim(Prompt)) ! Show preset Prompt
Write (Default,'(F8.4)') MyDefaultValue
Status = DlgSet( InputData, IDC_EDIT2, Trim(AdjustL(Default)))
Status = DlgSetSub( InputData, IDC_EDIT2, UpdateValue )
Resp = DlgModal (InputData)
If (Resp == 1) Then
MyVariable = CallBackVar ! CallBackVar should be shared through a COMMON
End If
Call DlgUninit (InputData)
Goto ? ! to DlgInit the first dialog
I Have to create a callback subroutine UpdateValue too, with SELECT CASE, and COMMON, and variable declarations, to update the CallBackVar. And forget about controlling the position of the dialog and help facilities (as I could do with VB InputBox).
I think that I should create an own function to do this, because I have to use such a thing very often. But I appreciate very much if you could show an easier way for that (although not just in 2 Fortran lines!). As I wrote in my question, something like MESSAGEBOXQQ would be ideal.
Regards,
Sabalan.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page