- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
i want to add a progress bar to my dialog application and disable other buttons as i push RUN button. i couldnt manage it to run simultaneously while the program calculates something. i checked the example written by Jugoslav Dujic, ThreadDlg. but i think it is quickwin application.since i am a beginner i couldnt translate it into dialog application.here is the code i wrote. what should i do?
lret = DlgSetSub(dlg, IDM_RUN, Run)
lret = DlgSet(Dlg,IDC_PROGRESS1,0,DLG_RANGEMIN)
lret = DlgSet(Dlg,IDC_PROGRESS1,100,DLG_RANGEMAX)
lret = DlgSet(Dlg,IDC_PROGRESS1,0)
lret = DlgModeless(dlg, nCmdShow)
end do
!******************************************************
SUBROUTINE Calculate( dlg )
.......
lret = DlgSet(dlg, IDOK, .false., DLG_ENABLE)
lret = DlgSet(dlg, IDM_EXIT, .false., DLG_ENABLE)
lret = DlgSet(dlg, IDCANCEL, .true., DLG_ENABLE)
do i=1, 1d+8
b = 15*b + 25*b**2 + b/114
end do
write (text, *) b
lret = DlgSet(dlg, IDC_EDIT, adjustl(text))
....
END SUBROUTINE Calculation
!***********************************************
SUBROUTINE Run( dlg, id, callbacktype )
.....
if (callbacktype == dlg_clicked) then
lret = DlgSet(Dlg, IDC_PROGRESS, 0)
call Work( dlg )
lret = DlgSet(dlg, IDOK, .true., DLG_ENABLE)
lret = DlgSet(dlg, IDM_EXIT, .true., DLG_ENABLE)
lret = DlgSet(dlg, IDCANCEL, .false., DLG_ENABLE)
end if
END SUBROUTINE RunWork
i want to add a progress bar to my dialog application and disable other buttons as i push RUN button. i couldnt manage it to run simultaneously while the program calculates something. i checked the example written by Jugoslav Dujic, ThreadDlg. but i think it is quickwin application.since i am a beginner i couldnt translate it into dialog application.here is the code i wrote. what should i do?
lret = DlgSetSub(dlg, IDM_RUN, Run)
lret = DlgSet(Dlg,IDC_PROGRESS1,0,DLG_RANGEMIN)
lret = DlgSet(Dlg,IDC_PROGRESS1,100,DLG_RANGEMAX)
lret = DlgSet(Dlg,IDC_PROGRESS1,0)
lret = DlgModeless(dlg, nCmdShow)
end do
!******************************************************
SUBROUTINE Calculate( dlg )
.......
lret = DlgSet(dlg, IDOK, .false., DLG_ENABLE)
lret = DlgSet(dlg, IDM_EXIT, .false., DLG_ENABLE)
lret = DlgSet(dlg, IDCANCEL, .true., DLG_ENABLE)
do i=1, 1d+8
b = 15*b + 25*b**2 + b/114
end do
write (text, *) b
lret = DlgSet(dlg, IDC_EDIT, adjustl(text))
....
END SUBROUTINE Calculation
!***********************************************
SUBROUTINE Run( dlg, id, callbacktype )
.....
if (callbacktype == dlg_clicked) then
lret = DlgSet(Dlg, IDC_PROGRESS, 0)
call Work( dlg )
lret = DlgSet(dlg, IDOK, .true., DLG_ENABLE)
lret = DlgSet(dlg, IDM_EXIT, .true., DLG_ENABLE)
lret = DlgSet(dlg, IDCANCEL, .false., DLG_ENABLE)
end if
END SUBROUTINE RunWork
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why can't you translate it? ThreadDlg is a console application and uses none of QuickWin routines (except a WRITE(*,*) used just for test). Just replace PROGRAM statement with WinMain(...) and recompile as Windows application:
Your code, as posted, contains a lot of syntax errors so I'd refrain from comments at the moment.
Jugoslav
!PROGRAM ThreadDlg INTEGER FUNCTION WinMain(hI, hPI, lpsC, nShow) !DEC$ATTRIBUTES STDCALL, ALIAS: "_WinMain@16":: WinMain INTEGER:: hI, hPI, lpsC, nShow.
Your code, as posted, contains a lot of syntax errors so I'd refrain from comments at the moment.
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