Sign in to follow this  
Followers 0
Xandy

[SOLVED] parsing file(s) dropped

6 posts in this topic

#1 ·  Posted (edited)

I use this code to allow files to be dropped onto input fields.

However after the file(s) are dropped, the records are not updated until the field the file(s) are dropped on is selected and then deselected.

Is there a msg I can check for when file(s) are dropped?

If I can write a file(s) dropped code block, will I be able to discern the $inputfunction index the file(s) were dropped on?

Right now this code will drop the file(s) onto the $inputfunction index and then add extra files to the next indexs. (no overflow code yet)

example: 3 files are dropped onto $inputfunction[4], $inputfunction[4] = file1|file2|file3 and will not split the files until $inputfunction[4] field is clicked and then clicked off of, if the clicking happens $inputfunction[4] = file1, $inputfunction[5] = file2, $inputfunction[6]=file3

However if I only drop one file the records are updated instantly. It seems to me that $appmsg only equals the $inputfunction[$i] when the $inputfunction[$i] is modified.

Again is there a way I can take action when file(s) are dropped and discern which field file(s) where dropped on?

This is a reconstructed code snipplet, there is allot more code in the actual program/script:

dim itemsonpage=10
dim $inputfunction[$itemsonpage]
Do
  $appmsg=GUIGetMsg()
  for $i=0 to $itemsonpage-1
    if($appmsg==$inputfunction[$i]) Then
      $tempstring = GUICtrlRead($inputfunction[$i])
      $filedrop = StringSplit($tempstring, "|")
      for $ii = 1 to $filedrop[0]
        GUICtrlSetData($inputfunction[$i+$ii-1], $filedrop[$ii]); update the input field(s)
        $function[$i+$ii-1+$page*$itemsonpage][0]=$filedrop[$ii]; update the $function array index(s)
      next
    endif
Until $appmsg = $GUI_EVENT_CLOSE

If I can just check a message for files dropped then I could check all fields for the one containing "|" (pipe separators) haha and then split them up, but I still need to check for a GUIGetMsg() that reflects a files dropped value...

Is there a message GUIGetMsg() returns when items are dropped on the GUI?

Edited by songersoft

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This is how I solved the problem, I just didn't know where to look in the help file, can't believe I skipped over guigetmsg() duh!!

Thanks again!

if($appmsg==$GUI_EVENT_DROPPED) then; do this block when file(s) are dropped on gui
 ;split files here
endif
Edited by songersoft

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

Sometimes topics say that they are solved. Since I started this topic how can I say that it is 'solved'?


I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

Edit your first post, using the 'Full Editor'.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

($appmsg==$GUI_EVENT_DROPPED)

That bracket is unnecessary. The string comparison too. See the "Operators" page in helpfile.

Sometimes topics say that they are solved. Since I started this topic how can I say that it is 'solved'?

You can change the topic just like you created it, by doing a edit on the first post with "Full Editor".

Share this post


Link to post
Share on other sites

AdmiralAlkex

($appmsg==$GUI_EVENT_DROPPED)

That bracket is unnecessary. The string comparison too. See the "Operators" page in helpfile.

oh yah, I'll stop using them on my 'if' statements. Sweet!

Thank you everyone!


I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0