- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In CVF version 6.6A I would like to code a noninteractive modal dialog box to steadily print out an lengthening edit box (similar in function to a MS Visual Studio Output window when a Compile or Link operation is proceeding) and tracking the progress of a long calculation. I wouldn't need any input from the user other than perhaps their optional use of the vertical scroll bar; the window would exit automatically when the calculation is complete.
It seems that the DlgModal command would be waiting forever without any user interaction and there doesn't seem to be another way of launching a modal dialog box.
Can somebody please help me with the top level logic of implementing a noninteractive dialog.
It seems that the DlgModal command would be waiting forever without any user interaction and there doesn't seem to be another way of launching a modal dialog box.
Can somebody please help me with the top level logic of implementing a noninteractive dialog.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Jugoslav. But I don't understand how to morph your loop:
to include my long-running subroutine instead of SLEEPQQ. Also, this is clearly an interactive dialog.
Can one make a dialog without the buttons, for example, showing only a progress bar and read-only scrollable edit box?
Harry Bell
DO i=1,100 !Your number crunching here instead of SLEEPQQ CALL SLEEPQQ(200) WRITE(*,*) i IF (IsCancelSignalled(Dlg,i).EQ.1) THEN Worker=0 RETURN END IF END DO
to include my long-running subroutine instead of SLEEPQQ. Also, this is clearly an interactive dialog.
Can one make a dialog without the buttons, for example, showing only a progress bar and read-only scrollable edit box?
Harry Bell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The sample explains the principle; you could easily adapt it by removing IDC_BUTTON_RUN and IDCANCEL, removing references to IDC_BUTTON_RUN from the code, and putting thread start to dlg-initialization callback, i.e:
iDummy=DlgSetSub(Dlg, IDD_DIALOG1, OnRun)
You can also remove Stop functionality if you wish. Of course, you can replace progress bar with a text control or read-only edit-box as well. The gotcha with progress bars is that you must know in advance how many iterations will be there.
Your long-running subroutine probably does not consist of linear-flow code; it must have some DO-loops. Putting IsCancelSignalled in these loop should be OK. If your code can be logically divided into "steps", you might put DlgSet(IDC_EDIT...) calls between these "steps", e.g.
Step 1/7: Loading data...
Step 2/7: Preparing data...
...
Step 7/7: Creating output list...
The point of the sample was that you have to create a thread if you want that the UI is updated at all. If there were no thread, the text as above (or filled progress bar) would appear only after the calculation ends.
Jugoslav
iDummy=DlgSetSub(Dlg, IDD_DIALOG1, OnRun)
You can also remove Stop functionality if you wish. Of course, you can replace progress bar with a text control or read-only edit-box as well. The gotcha with progress bars is that you must know in advance how many iterations will be there.
Your long-running subroutine probably does not consist of linear-flow code; it must have some DO-loops. Putting IsCancelSignalled in these loop should be OK. If your code can be logically divided into "steps", you might put DlgSet(IDC_EDIT...) calls between these "steps", e.g.
Step 1/7: Loading data...
Step 2/7: Preparing data...
...
Step 7/7: Creating output list...
The point of the sample was that you have to create a thread if you want that the UI is updated at all. If there were no thread, the text as above (or filled progress bar) would appear only after the calculation ends.
Jugoslav

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