forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Issue with "Dropped_count"

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 2816
Location: South Pole, Antarctica

PostPosted: Fri Sep 12, 2014 11:37 pm    Post subject: Issue with "Dropped_count" Reply with quote

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 Smile 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
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Sat Sep 13, 2014 7:47 am    Post subject: Reply with quote

Thanks for this. I have logged it for investigation.
I am aware that the behaviour of the Windows API has changed in this respect.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Fri Jan 23, 2015 9:06 pm    Post subject: Reply with quote

These things have now been fixed for the next release.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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