Garry's Mod Wiki

DDragBase

Description

This is used internally - although you're able to use it you probably shouldn't.

A VGUI base panel providing drag/drop functionality. Used by DIconLayout, DListLayout and DTileLayout.

Parent

Derives from DPanel.

Methods

DDragBase:DropAction_Copy( table drops, boolean bDoDrop, string command, number y, number x )
This is used internally - although you're able to use it you probably shouldn't. Internal function used in DDragBase:MakeDroppable
DDragBase:DropAction_Normal( table drops, boolean bDoDrop, string command, number y, number x )
This is used internally - although you're able to use it you probably shouldn't. Internal function used in DDragBase:DropAction_Copy
DDragBase:DropAction_Simple( table drops, boolean bDoDrop, string command, number y, number x )
This is used internally - although you're able to use it you probably shouldn't. Internal function used in DDragBase:DropAction_Normal
string DDragBase:GetDnD()
No Description
boolean DDragBase:GetUseLiveDrag()
No Description
DDragBase:MakeDroppable( string name, boolean allowCopy )
Makes the panel a receiver for any droppable panel with the same DnD name. Internally calls Panel:Receiver.
DDragBase:OnModified()
Called when anything is dropped on or rearranged within the DDragBase.
DDragBase:SetDnD( string name )
No Description
DDragBase:SetDropPos( string pos = "5" )
Determines where you can drop stuff. "4" for left "5" for center "6" for right "8" for top "2" for bottom
DDragBase:SetUseLiveDrag( boolean newState )
No Description
DDragBase:UpdateDropTarget( number drop, Panel pnl )
This is used internally - although you're able to use it you probably shouldn't. Internal function used in DDragBase:DropAction_Normal

Example

local frame = vgui.Create( "DFrame" ) frame:SetSize( 300, 500 ) frame:Center() frame:MakePopup() local dragbase = vgui.Create( "DDragBase", frame ) dragbase:Dock( FILL ) dragbase:MakeDroppable( "test" ) dragbase:SetDropPos( "82" ) for i = 0, 10 do local butt = dragbase:Add( "DButton" ) //butt:Dock( TOP ) butt:SetPos( 25, i * 25 ) butt:SetWidth( 100 ) butt:Droppable( "test" ) butt.id = i butt.Think = function( s ) s:SetText( "ID: " .. i .. " ZPOS: " .. s:GetZPos() ) end end

Page Links


Special Pages


Wikis

?

Render Time: 42ms

DB GetPage 2
Generate Html 11
SaveChanges (1) 8
Render Body 0
Render Sidebar 18