Garry's Mod Wiki

Revision Difference

DScrollPanel#516718

<panel>⤶ <parent>DPanel</parent>⤶ <description>⤶ DScrollPanel is a VGUI Element similar to DPanel however it has a vertical scrollbar docked to the right which can be used to put more content in a smaller area. DScrollPanels are essentially <page>DPanel</page>s with the Scroll Bar. ⤶ This can be used to replace the <page>DPanelList</page> with <page>DPanelList:EnableVerticalScrollbar</page> and get similar functionality as well as using a non-deprecated element. ⤶ If you would like to paint or edit the elements of the scrollbar use {{VGUIElementMethodInternal|GetVBar⤶ </description>⤶ ⤶ </panel>⤶ ⤶ . If you want to see if the scrollbar is visible then use the VBar.Enabled variable on the scrollbar's VBar.⤶ ⤶ <note><page>Panel:DockPadding</page> will not have an effect on children of this panel. Use the function on <page>DScrollPanel:GetCanvas</page> instead.</note>⤶ |Hooks=⤶ <panel⤶ |parent=dpanel⤶ |description=dscrollpanel is a vgui element similar to dpanel however it has a vertical scrollbar docked to the right which can be used to put more content in a smaller area. dscrollpanels are essentially <page>dpanel</page>s with the scroll bar.⤶ ⤶ this can be used to replace the <page>dpanellist</page> with <page>dpanellist:enableverticalscrollbar</page> and get similar functionality as well as using a non-deprecated element. ⤶ if you would like to paint or edit the elements of the scrollbar use {{vguielementmethodinternal|getvbar}}. if you want to see if the scrollbar is visible then use the vbar.enabled variable on the scrollbar's vbar. ⤶ <note><page>panel:dockpadding</page> will not have an effect on children of this panel. use the function on <page>dscrollpanel:getcanvas</page> instead.</note>>⤶ <hooks>⤶ }} <example>⤶ {{Example⤶ </hooks>⤶ <description>Creates a <page>DScrollPanel</page> and adds 100 <page>DButton</page>s to it.</description> <code> local frame = vgui.Create( "DFrame" ) frame:SetSize( 500, 500 ) frame:Center() frame:MakePopup() local DScrollPanel = vgui.Create( "DScrollPanel", frame ) DScrollPanel:Dock( FILL ) for i=0, 100 do local DButton = DScrollPanel:Add( "DButton" ) DButton:SetText( "Button #" .. i ) DButton:Dock( TOP ) DButton:DockMargin( 0, 0, 0, 5 ) end </code> ⤶ </example>⤶ ⤶ </panel⤶ |parent=dpanel⤶ |description=dscrollpanel is a vgui element similar to dpanel however it has a vertical scrollbar docked to the right which can be used to put more content in a smaller area. dscrollpanels are essentially <page>dpanel</page>s with the scroll bar.⤶ ⤶ this can be used to replace the <page>dpanellist</page> with <page>dpanellist:enableverticalscrollbar</page> and get similar functionality as well as using a non-deprecated element.⤶ ⤶ if you would like to paint or edit the elements of the scrollbar use {{vguielementmethodinternal|getvbar}}. if you want to see if the scrollbar is visible then use the vbar.enabled variable on the scrollbar's vbar.⤶ ⤶ <note><page>panel:dockpadding</page> will not have an effect on children of this panel. use the function on <page>dscrollpanel:getcanvas</page> instead.</note>>⤶