2012-02-07 01:41:53 +01:00
|
|
|
UIMiniWindowContainer = extends(UIWidget)
|
|
|
|
|
|
|
|
function UIMiniWindowContainer.create()
|
|
|
|
local container = UIMiniWindowContainer.internalCreate()
|
|
|
|
container:setFocusable(false)
|
|
|
|
container:setPhantom(true)
|
|
|
|
return container
|
|
|
|
end
|
|
|
|
|
2012-03-27 00:24:01 +02:00
|
|
|
function UIMiniWindowContainer:onDrop(widget, mousePos)
|
2012-03-28 21:09:45 +02:00
|
|
|
if widget:getClassName() == 'UIMiniWindow' then
|
2012-06-11 07:38:08 +02:00
|
|
|
local oldParent = widget:getParent()
|
|
|
|
if oldParent == self then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
oldParent:removeChild(widget)
|
|
|
|
|
|
|
|
if widget.movedWidget then
|
|
|
|
local index = self:getChildIndex(widget.movedWidget)
|
|
|
|
self:insertChild(index + widget.movedIndex, widget)
|
|
|
|
else
|
|
|
|
self:addChild(widget)
|
|
|
|
end
|
|
|
|
|
2012-03-28 21:09:45 +02:00
|
|
|
return true
|
|
|
|
end
|
2012-03-27 00:24:01 +02:00
|
|
|
end
|
|
|
|
|
2012-02-07 01:41:53 +01:00
|
|
|
function UIMiniWindowContainer:getClassName()
|
|
|
|
return 'UIMiniWindowContainer'
|
|
|
|
end
|