DPropertySheet A.K.A Derma Tabs

So, I am working on a small project and had a question. How do I make multiple derma items in a tab? I have:

for k, v in pairs (player.GetAll()) do
if ConVarExists( “clientreport_visible” ) and ClReportVis:GetInt() == 1 then
PropertySheet:AddSheet( v:Name(), AdminChat,“gui/silkicons/group”, false, false, "Admin Report with: "…v:Name() )

That makes a tab with the player’s name and a DTextEntry, how do I make another derma item in this?

The best way to do this is to create a DPanel, then parent everything you want to the DPanel, and parent the single DPanel to your tab.

What you’ll want to do is create a DPanel for each player and then add each panel.

[editline]20th February 2011[/editline]


So like this?

for k, v in pairs (player.GetAll()) do
if ConVarExists( “clientreport_visible” ) and ClReportVis:GetInt() == 1 then
PlayerTabPanel = vgui.Create( “DFrame” )
PlayerTabPanel:SetSize( 300, 400 )
PlayerTabPanel:SetPos( (ScrW()/2) - 150, (ScrH()/2) - 200 )
PlayerTabPanel:ShowCloseButton( true )
PlayerTabPanel:SetTitle( “Admin -> Client Report” )
PlayerTabPanel:SetDraggable( true )
PlayerTabPanel:SetVisible( false )

		PlayerTabChat = vgui.Create( "DTextEntry", PlayerTabPanel )
		PlayerTabChat:SetPos( 10, 25 )
		PlayerTabChat:SetSize( 280, 330 )
		PlayerTabChat:SetEditable( false )
		PlayerTabChat:SetEnterAllowed( false )
		PlayerTabChat:SetMultiline( true )
		PlayerTabEnter = vgui.Create( "DTextEntry", PlayerTabPanel )
		PlayerTabEnter:SetPos( 10, 365 )
		PlayerTabEnter:SetSize( 240, 25 )
		PlayerTabEnter:SetEnterAllowed( true )
		PlayerTabEnter:SetEditable( true )
		PlayerTabEnter:SetMultiline( false )
		PlayerTabEnter.OnEnter = function()
			ClientChat:SetValue( PlayerTabChat:GetValue() .. LocalPlayer():GetName() .. ": " .. PlayerTabEnter:GetValue() .. "

" )
PlayerTabChat:SetValue( PlayerTabChat:GetValue() … LocalPlayer():GetName()… ": " … PlayerTabEnter:GetValue() … "
" )
PlayerTabEnter:SetValue( “” )
PropertySheet:AddSheet( v:Name(), PlayerTabPanel,“gui/silkicons/exclamation”, false, false, "Admin Report with: "…v:Name() )

yes, except make a DPanel to parent it to, not the DFrame.

Erm, if you don’t mind me asking; What is the difference between DPanel and DFrame?


I meant more like explain it, but I guess I will have to make it and get a visual.

[lua]function Example()
local DermaF= vgui.Create(“DFrame”)
DermaF:SetSize(200, 200)

local DermaP = vgui.Create("DPanel")
DermaP:SetPos(1, 1)
DermaP:SetSize(190, 190)

local DermaC = vgui.Create("DCheckBoxLabel")

DPropertySheet:AddSheet("FirstTab", DermaP, "gui/silkicons/user", false, false, "Tooltip thing")


Something like that, get it now?

[editline]21st February 2011[/editline]

except you need to create the DPropertySheet!

A DFrame is generally something you put everything in, like a Windows window, with close button and title bar and all that stuff.
A DPanel is just a rounded box, nothing else.

To get a little technical, a DFrame is a DPanel. It just has extra features like a frame and a certain background color and a few features. At their core, both objects are just containers.