 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Thu Apr 21, 2011 10:34 pm Post subject: How to create simple MessageBox? |
|
|
Sorry, this might get the Dumb Question of The Year award, but for some reason I can't find the answer in Help or the Manuals. I might not have read as deeply as I should.
I'm trying to do two things.
1.) The simple thing: I'm trying to create a little message box that says "Processing parts list" with an OK button in it. When you click the OK button, the message box goes away and the program keeps running. I've done this using C++ compilers, just use the MessageBox command, but for some reason I can't figure out how to do it with FTN95. My apologies if I'm missing something obvious.
2.) The more complicated thing: I want to put up a message box similar to the one above, but with the OK button greyed out at first, and whose message I can change as time goes on. Then when I've changed the message enough times, the OK button un-greys and becomes active, and the message box waits for the user to click the OK button. When he clicks it, the message box goes away and the program keeps running.
The purpose of this second (more complicated) message box is to inform the user of progress while the program is running. The program is processing a parts list, and every tenth part or so the program changes the message to the current part number. Eventually all parts are processed, and the program changes the message to the word DONE, un-greys the OK button, and waits for the user to click it.
Is that at all clear? Sometimes my descriptions aren't, sorry.
Is there a way to do either of the two things above, using FTN95?
Thanks! |
|
Back to top |
|
 |
IanLambley
Joined: 17 Dec 2006 Posts: 506 Location: Sunderland
|
Posted: Fri Apr 22, 2011 12:34 pm Post subject: |
|
|
Try something like this
Code: |
include <windows.ins>
integer*4 icontro,ipartscount
common/control_stuff/icontrol,ipartscount
ipartscount = 0
icontrol = -1
i=winio@('%ca[Processing caption]&')
i=winio@('%ww[casts_shadow,no_sysmenu,no_maxminbox]&')
i=winio@('%bg[btnface]')
i=winio@('%ffNumber of parts processed %`rd&',ipartscount)
i=winio@('%ff%rj%tt[OK]&')
i=WINIO@('%lw',icontrol)
! insert processing loop here
do i=1,1000
! your processing
if(mod(i,10) .eq. 0)then
! update the processing after every 10 items
ipartscount = i
call window_update@(ipartscount)
endif
enddo
! finished so close the window
icontrol = 0
call window_update@(icontrol)
|
The button is not really necessary as the window will close after processing. |
|
Back to top |
|
 |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Tue Apr 26, 2011 1:33 am Post subject: |
|
|
Beautiful, it works great!!!
Thank you! |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|