Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475

    DragDrop Library

    DragDrop.dll v.1.0.0.0

    DragDrop library will add drag and drop capabilities to ams applications. Right now the dll supports drag 'n droping for text (from wordpad, iexlorer etc) and files. You can drag 'n drop text and files right in the ams window.

    .Net 2.0 required.

    With Kind Regards
    sside

  2. #2
    Join Date
    Nov 2006
    Location
    Quebec, Canada.
    Posts
    432
    Wow. Outstanding. And it works all over the app! I just can't realize it's real

    You did a more than wonderful jub on this mate. Thanks for that other contribution!

  3. #3
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Fantastic job. Thanks.
    Dermot

    I am so out of here

  4. #4
    Join Date
    Dec 2007
    Location
    Missouri, United States
    Posts
    476
    great work m8, superb even. I'll definately be using this.

  5. #5
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137

    Drag and Drop - sside - .NET 2.0

    Mirrored on amsuser.com:

    http://www.amsuser.com/ams/examples/...T2.0-sside.apz

    Nice job sside.

    Note: .NET 2.0 is required.
    Intrigued

  6. #6
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475
    Thanks for the feedback, i appreciate it.



    With Kind Regards
    sside

  7. #7
    Join Date
    May 2006
    Posts
    5,380
    This is fanstasic

    i managed to get my drag n drop dll working but its very unstable and only single files accepted, this dll is just the ticket

    @ sside, do you have a donations page ?

    the whole community owes you for this little gem, i have been passing my droped file path from a PB window to a ams exe via commandline for my current project which is VERY messy, this will sort that out

    Thank you
    Open your eyes to Narcissism, Don't let her destroy your life!!

  8. #8
    Join Date
    Sep 2006
    Posts
    1
    thanks sside you're good & god!! xDD

  9. #9
    Join Date
    Jan 2007
    Posts
    271

    Good Job sside,

    Thank you,
    This works very well.
    Now,,, It's drag and drop time!!!

    Thank You,
    AudioSamIam

  10. #10
    Join Date
    Mar 2007
    Posts
    186
    Beautiful...

    Thanks

  11. #11
    Join Date
    Nov 2006
    Posts
    24
    Thanks for another awesome dll!!

  12. #12
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    Thanks much sside! Great DLL!

  13. #13
    Join Date
    Oct 2006
    Posts
    345
    vey useful.

    now, how do i make it bring the project on top of other windows when i drag something over it, been trying to insert the code in the ontimer section where it fills in the status text box, but cant get it to work.. i figured i could use an if statement to grab the eventType and set the apps ontop status using the "DragOver" result as a trigger, but cant get it to work

  14. #14
    Join Date
    Oct 2006
    Posts
    345
    well i couldn't get a stable result from trying to make it set the project to TOPMOST and bring it to the top of all other windows.

    So i decided to mess around with some other code, to see if i could make it drag and drop only when i was within a certain object on the page, having decided that my input box was a little narrow for this i opted to put a hotspot object of a slightly larger size around it (and also to cover the browse for file button) ... and target this object.

    So i cannibalised some of Worms code (sorry buddy ) and set about making it trigger initially only on mouse over (i was going to play with the mouse button event too, but bearing in mind i have covered the browse button with hotspot i'm not sure what would happen) .... anyway, here's what i came up with..


    Startup Code
    Code:
    DnD_on = false;

    Global Code
    Code:
    -- Function to tell whether a point is in a given objects rectangle --
    
    function IsInRect(m_nX, m_nY, m_tblPos, m_tblSize)
    	local bReturn = false;
    	if (m_nX >= m_tblPos.X) and (m_nX <= m_tblPos.X + m_tblSize.Width) then
    		if (m_nY >= m_tblPos.Y) and (m_nY <= m_tblPos.Y + m_tblSize.Height) then
    			bReturn = true;
    		end
    	end
    	return bReturn;
    end
    
    
    -- Function to Start and Stop Drag nDrop Dependant on cursor location --
    
    function Compare_Cursor_Location(e_X, e_Y)
    
    	tblObjects = Page.EnumerateObjects();  -- Get object names on page, put in a table
    
    	for index, sObject in tblObjects do
    		if sObject == "file select" then
    			if IsInRect(e_X, e_Y,  Hotspot.GetPos("Drag and Drop Area1"), Hotspot.GetSize("Drag and Drop Area1")) and DnD_on == false then
    				-- Cursor is inside drag n drop area, start Drag N Drop Function + Timer --
    				DragDrop.SetDataFormat(DataFormat.FileDrop);  -- set it to file drop mode
    				DragDrop.Start(Application.GetWndHandle());  -- Start Drag n Drop monitoring
    				error = DragDrop.GetError();
    				if (error == "") then
    					Timer2 = Timer.StartTimer("MultiTimer", 2, 100);
    				else
    					Dialog.Message("Error", error, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    				end
    				DnD_on = true;  -- set Drag n Drop running flag to on
    			elseif not IsInRect(e_X, e_Y,  Input.GetPos("file select"), Input.GetSize("file select")) and DnD_on == true then
    				-- Cursor is NOT inside drag n drop area, stop Drag N Drop Function + Timer --
    				DragDrop.Stop(Application.GetWndHandle());  -- Stop Drag n Drop monitoring
    				Timer.StopTimer( "MultiTimer", Timer2);-- Kill timer
    				DnD_on = false;  -- set Drag n Drop running flag to off
    			end
    			break;
    		end
    	end
    end

    and, it works like a charm...... until i realised that if the project isn't in focus it doesnt work


    anyone know a way around this ? the drag and drop dll obviously works when the project does not have focus, whereas the on mouse move event doesn't.... so i'm back to needing ti trigger an event when the mouse passes over into the project boundry !! ... i seem to have come full circle here

  15. #15
    Join Date
    Oct 2006
    Posts
    345



    i figured it out

    apart from the superfluous tbl enumeration and loop, it was the application window handle it was stumbling on .... i've now declared that elsewhere and it works

    here's what i have now....

    Code:
    -- Function to tell whether a point is in a given objects rectangle --
    
    function IsInRect(m_nX, m_nY, m_tblPos, m_tblSize)
    	local bReturn = false;
    	if (m_nX >= m_tblPos.X) and (m_nX <= m_tblPos.X + m_tblSize.Width) then
    		if (m_nY >= m_tblPos.Y) and (m_nY <= m_tblPos.Y + m_tblSize.Height) then
    			bReturn = true;
    		end
    	end
    	return bReturn;
    end
    
    
    -- Function to Start and Stop Drag nDrop Dependant on cursor location --
    
    function Compare_Cursor_Location(e_X, e_Y)
    		if IsInRect(e_X, e_Y,  Hotspot.GetPos("Drag and Drop Area1"), Hotspot.GetSize("Drag and Drop Area1")) and DnD_on == false then
    			-- Cursor is inside drag n drop area, start Drag N Drop Function + Timer --
    			DragDrop.SetDataFormat(DataFormat.FileDrop);  -- set it to file drop mode
    			DragDrop.Start(handle);  -- Start Drag n Drop monitoring
    			error = DragDrop.GetError();
    			if (error == "") then
    				Timer2 = Timer.StartTimer("MultiTimer", 2, 100);
    			else
    				Dialog.Message("Error", error, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    			end
    			DnD_on = true;  -- set Drag n Drop running flag to on
    		elseif not IsInRect(e_X, e_Y,  Input.GetPos("file select"), Input.GetSize("file select")) and DnD_on == true then
    			-- Cursor is NOT inside drag n drop area, stop Drag N Drop Function + Timer --
    			DragDrop.Stop(handle);  -- Stop Drag n Drop monitoring
    			Timer.StopTimer( "MultiTimer", Timer2);-- Kill timer
    			DnD_on = false;  -- set Drag n Drop running flag to off
    		end
    end
    so i was wrong, it wasnt the on mouse event not triggering

    now to get this dam ontop thing sorted lol, also a way to move the cursor to the end of the input box after i've dropped the file would be handy for long file paths, so i can see the file name, i know i can set focus to the input box after dropping the file to it, so how to go to the end ?
    Last edited by qwerty; 02-27-2009 at 05:41 PM.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Access database library
    By sside in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 02-25-2009, 07:50 AM
  2. ApplicationMessageCenter Library
    By sside in forum AutoPlay Media Studio 5.0
    Replies: 15
    Last Post: 11-14-2008, 11:57 PM
  3. Image library
    By sside in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 05-30-2006, 05:22 AM
  4. Anyone Suggest A Graphics Library and Printer?
    By wwwScottRohcom in forum AutoPlay Media Studio 4.0
    Replies: 6
    Last Post: 08-14-2002, 01:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts