local function DoDrop( self, panels, bDoDrop, Command, x, y )
if ( bDoDrop )
then
for k, v
in pairs( panels )
do
self:
AddItem( v )
end
end
end
concommand.
Add(
"test2",
function()
local frame
= vgui.
Create(
"DFrame" )
frame:
SetSize(
500,
300 )
frame:
SetTitle(
"Frame" )
frame:
MakePopup()
frame:
Center()
local left
= vgui.
Create(
"DScrollPanel", frame )
left:
Dock( LEFT )
left:
SetWidth(
frame:
GetWide()
/ 2 - 7 )
left:
SetPaintBackground(
true )
left:
DockMargin(
0,
0,
4,
0 )
left:
Receiver(
"myDNDname", DoDrop )
local right
= vgui.
Create(
"DScrollPanel", frame )
right:
Dock( FILL )
right:
SetPaintBackground(
true )
right:
Receiver(
"myDNDname", DoDrop )
for i
= 1,
30 do
local but
= vgui.
Create(
"DButton" )
but:
SetText( i )
but:
SetSize(
36,
24 )
but:
Dock( TOP )
but:
Droppable(
"myDNDname" )
right:
AddItem( but )
end
end )