Garry's Mod Wiki

DColumnSheet

Description

Similar to DPropertySheet, but with tabs on the left.

View source

Parent

Derives methods, etc not listed on this page from Panel.

Implements

Implements or overrides the following hooks/methods. If you want to override these, you probably want to call the original function too.

Methods

table DColumnSheet:AddSheet( string name, Panel pnl, string icon = "nil" )
Adds a new column/tab.
Panel DColumnSheet:GetActiveButton()
Returns the active button of this DColumnSheet.
DColumnSheet:SetActiveButton( Panel active )
This is used internally - although you're able to use it you probably shouldn't. Makes a button an active button for this DColumnSheet.
DColumnSheet:UseButtonOnlyStyle()
Makes the tabs/buttons show only the image and no text.

Example

Example of how you'd use this panel

local frame = vgui.Create( "DFrame" ) frame:SetSize( 500, 300 ) frame:Center() frame:MakePopup() local sheet = vgui.Create( "DColumnSheet", frame ) sheet:Dock( FILL ) local panel1 = vgui.Create( "DPanel", sheet ) panel1:Dock( FILL ) panel1.Paint = function( self, w, h ) draw.RoundedBox( 4, 0, 0, w, h, Color( 0, 128, 255 ) ) end sheet:AddSheet( "test", panel1, "icon16/cross.png" ) local panel2 = vgui.Create( "DPanel", sheet ) panel2:Dock( FILL ) panel2.Paint = function( self, w, h ) draw.RoundedBox( 4, 0, 0, w, h, Color( 255, 128, 0 ) ) end sheet:AddSheet( "test 2", panel2, "icon16/tick.png" )