LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   Drag/Drop operations (https://www.lotrointerface.com/forums/showthread.php?t=1151)

SanDBoX 10-12-2010 08:19 PM

Drag/Drop operations
 
I am trying to setup a window so that it will accept a drag&drop item, I have figured out how to see when it happens, but cant figure out how to get the item that was dropped, I really dont want to use a quickslot for this (could cause issues latter)

So far I have :
Quote:

Window = class( Turbine.UI.Window )

function Window:Constructor( )
Turbine.UI.Lotro.Window.Constructor( self )
self:SetSize( 100, 100 )
self:SetPosition( 100, 100 )
self:SetText( "Testing Grounds" )
self:SetAllowDrop( true )
end


function self:DragDrop(sender, args)
Turbine.Shell.WriteLine( "Received Item" )
end
but when I cycle through the information from sender all I get is the y,x coords and a seemingly unused "dragdropinfo" table which just has an __implementation atribute that is blank.

Anyone know how to collect the dropped item?

MrJackdaw 10-13-2010 12:29 AM

DragDrop does not fire for quicklsots - not so sure about windows. Maybe bugged?

SanDBoX 10-13-2010 08:49 PM

I tried to get the parent thinking maybe the item caused the drag and drop but not go, doesnt even have the "GetParent" method.

Anyone have any other ideas? is this one of those things that they put in but havent implamented yet?

I would really like to get the drag and drop thing to work... :confused:

D.H1cks 10-14-2010 08:09 AM

I have a custom button that accepts drag drop items. I get the item using:

newItem = args.DragDropInfo:GetShortcut():GetItem();

SanDBoX 10-14-2010 04:50 PM

Okay, thank you! will look more into that direction, but one problem I found is that when I collect the Item my "args" always ends up nil, are you using something other then the 'DragDrop(sender, args)' ?


EDIT:
and when I get DragDropInfo from the sender the GetShortcut() always comes back with just __Implementation, and GetItem() gets nil...

so confused, wish the api documentation was more then a "this is the methods we have, you figure out how they go"


All times are GMT -5. The time now is 06:31 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI