Xandy Posted January 16, 2011 Share Posted January 16, 2011 (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 January 16, 2011 by songersoft Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Xandy Posted January 16, 2011 Author Share Posted January 16, 2011 (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 January 16, 2011 by songersoft Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Xandy Posted January 16, 2011 Author Share Posted January 16, 2011 Sometimes topics say that they are solved. Since I started this topic how can I say that it is 'solved'? Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 16, 2011 Share Posted January 16, 2011 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. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted January 16, 2011 Share Posted January 16, 2011 ($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". .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Xandy Posted January 16, 2011 Author Share Posted January 16, 2011 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! Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now