DHorizontalDivider
Description
Creates an invisible vertical divider between two GUI elements.
Parent
Derives methods, etc not listed on this page from DPanel.
Methods
number DHorizontalDivider:GetDividerWidth()
Returns the width of the horizontal divider bar, set by DHorizontalDivider:SetDividerWidth.
boolean DHorizontalDivider:GetDragging()
Returns whether or not the player is currently dragging the middle divider bar.
number DHorizontalDivider:GetHoldPos()
This is used internally - although you're able to use it you probably shouldn't.
Returns the local X coordinate of where the player started dragging the thing
number DHorizontalDivider:GetLeftMin()
Returns the minimum width of the left side, set by DHorizontalDivider:SetLeftMin.
number DHorizontalDivider:GetLeftWidth()
Returns the current width of the left side, set by DHorizontalDivider:SetLeftWidth or by the user.
Panel DHorizontalDivider:GetMiddle()
Returns the middle content, set by DHorizontalDivider:SetMiddle.
number DHorizontalDivider:GetRightMin()
Returns the minimum width of the right side, set by DHorizontalDivider:SetRightMin.
DHorizontalDivider:SetDragging( boolean dragonot )
This is used internally - although you're able to use it you probably shouldn't.
Sets whether the player is dragging the divider or not
DHorizontalDivider:SetHoldPos( number x )
This is used internally - although you're able to use it you probably shouldn't.
Sets the local X coordinate of where the player started dragging the thing
DHorizontalDivider:SetLeftWidth( number width )
Sets the current/starting width of the left side.
The width of the right side is automatically calculated by subtracting this from the total width of the DHorizontalDivider.
DHorizontalDivider:SetMiddle( Panel middle )
Sets the middle content, over the draggable divider bar panel.
DHorizontalDivider:StartGrab()
This is used internally - although you're able to use it you probably shouldn't.
Example
local f = vgui.Create( "DFrame" )
f:SetSize( 400, 200 )
f:Center()
f:MakePopup()
local LeftPanel = vgui.Create( "DPanel", f ) -- Can be any panel, it will be stretched
local RightPanel = vgui.Create( "DPanel", f )
local div = vgui.Create( "DHorizontalDivider", f )
div:Dock( FILL ) -- Make the divider fill the space of the DFrame
div:SetLeft( LeftPanel ) -- Set what panel is in left side of the divider
div:SetRight( RightPanel )
div:SetDividerWidth( 4 ) -- Set the divider width. Default is 8
div:SetLeftMin( 20 ) -- Set the Minimum width of left side
div:SetRightMin( 20 )
div:SetLeftWidth( 50 ) -- Set the default left side width