DanRRight
Joined: 10 Mar 2008 Posts: 2816 Location: South Pole, Antarctica
|
Posted: Fri Sep 12, 2014 11:37 pm Post subject: Issue with "Dropped_count" |
|
|
There exist very handy winio@('%dr&', callback) utility to drop files into the window for program to process them. But Clearwin_Info utilities
iCurrNumberOutOfSeveral = clearwin_info@ ('DROPPED_CURRENT')
nHowManyTotal = clearwin_info@ ('DROPPED_COUNT')
show amount of dropped files equal one instead of zero when no files were dropped if you after dropping just call callback directly using any other way from menu, buttons, radiobuttons etc. Is this a bug or default feature?
Additionally, calling callback without dropping files crashes the code. I think clearwin_string@ ('DROPPED_FILE') should behave a bit more amicably saying something like 'No Files Dropped' or just with a space
Demo code
Code: | winapp
program Rarefactor
INCLUDE <windows.ins>
INTEGER, EXTERNAL :: callback
character*256 PICDataFile, PICDataFileCopy, OutputFile
common /raref_/ iWriteEveryNth, kCreateBothEandIfiles, PICDataFile, PICDataFileCopy, OutputFile
real*8 FontSize1
iWriteEveryNth = 2
PICDataFile = 'emittance_at5_sort0.data'
PICDataFileCopy = PICDataFile
OutputFile = ' '
kCreateBothEandIfiles = 0
luncw4_PriceReview = 0
FontSize1 = 0.77
i=winio@('%ww[no_border]&')
I=WINIO@('%nd%nr&')
I=WINIO@('%sp&', 200, 600)
i=winio@('%bg[#cccc99]&')
i=winio@('%mn[File[Create File]]&',callback )
i=winio@('%mn[[Exit esc]]&','exit')
i=winio@('Rarefaction factor %`bg[white]%dd%il%ta%4rd%`il%ff&', 1,1,10000,iWriteEveryNth)
i=winio@('Both e and I files %ta%rb[]%ff&', kCreateBothEandIfiles)
i=winio@('Input File %ta%`bg[white]%44rs%ff&', PICDataFile)
i=winio@('Output File %ta%`bg[white]%44rs%ff&', OutputFile)
i=winio@('%si! %cn Drag-n-drop file here %ff %ff&')
i=winio@('%cn or%ff&')
i=winio@('%cn %^tt[Run] %ff&', callback )
i=winio@('%dr&', callback )
i=WINIO@('%`bg[#cccc99]%fn[Terminal]%ts%pv%69.15`cw[hscroll,vscroll,local_font]%ff&', &
FontSize1,luncw4_PriceReview,ihwPriceRev )
i=winio@('%ac[esc]&','exit')
i=winio@(' %ff %cn%tt[OK]')
end program
!-------------------------------------------------------------------
integer function callback ()
INCLUDE <windows.ins>
character*256 PICDataFile, PICDataFileCopy, OutputFile
common /raref_/ iWriteEveryNth, kCreateBothEandIfiles, PICDataFile, PICDataFileCopy, OutputFile
iCurrNumberOutOfSeveral = clearwin_info@ ('DROPPED_CURRENT')
nHowManyTotal = clearwin_info@ ('DROPPED_COUNT')
PICDataFile = clearwin_string@ ('DROPPED_FILE')
call window_update@(PICDataFile)
print*, ' iCurrNumberOutOfSeveral, nHowManyTotal =', iCurrNumberOutOfSeveral, nHowManyTotal
callback = 2
end callback
|
|
|