Can someone explain in simple terms how you make a tabbed DERMA menu.
Thanks
Should PropertySheet in the wiki, tuts on there.
The wiki doesn't have a decent tutorial on Tabbed DERMA menus.
It do.
[url]http://wiki.garrysmod.com/?title=Lua_Tutorial_Series[/url]
[QUOTE=Capsup;17865330]It do.
[url]http://wiki.garrysmod.com/?title=Lua_Tutorial_Series[/url][/QUOTE]
I said DECENT tutorials
There is no tutorial which explains how to bind multiple buttons to one tab and not the other.
Well, I learned, so you learn.
[lua]local DermaPanel = vgui.Create( "DFrame" ) -- Draws Derma Panel
DermaPanel:SetPos( 50, 50 ) -- Position
DermaPanel:SetSize( 350, 400 ) -- Size
DermaPanel:SetTitle( "Testing Derma Stuff" ) -- Title
DermaPanel:SetVisible( true ) --Visible?
DermaPanel:SetDraggable( false ) --Draggable?
DermaPanel:ShowCloseButton( true ) --Closebutton?
DermaPanel:MakePopup() --Makes pOp Up
local PropertySheet = vgui.Create( "DPropertySheet" ) --This is the parent to all your tabs
PropertySheet:SetParent( DermaPanel ) -- Parent is local DermaPanel
PropertySheet:SetPos( 5, 30 ) --Position
PropertySheet:SetSize( 340, 315 ) --Size
local SheetItemOne = vgui.Create( "DCheckBoxLabel" ) --Can be DListView, can be anything. Just as long as PropertySheet is it's Parent
SheetItemOne:SetText( "Use Props?" )
SheetItemOne:SetConVar( "some_convar" )
SheetItemOne:SetValue( 1 )
SheetItemOne:SizeToContents()
PropertySheet:AddSheet( "Some Menu", SheetItemOne, "gui/silkicons/user", false, false, "WOW It's a text box!!!" ) -- First is title -- Second is the Name of what is being called Third is icons -- sixth is the name when you move your mouse over the tab
--Example of mine
local Panel = vgui.Create("DFrame");
Panel:SetPos(100, 100);
Panel:SetSize(ScrW() - 100, ScrH() - 100);
Panel:SetTitle("Lanaya Chox);
Panel:MakePopup();
local Sheet = vgui.Create("DPropertySheet", Panel);
sheet:SetPos(2, 20);
sheet:SetSize(Panel:GetWide() - 4, Panel:GetTall() - 22)
local 187ciDerma = vgui.Create("DCheckBoxLabel", Sheet);
187ciDerma:SetParent(DermaPanel)
187ciDerma:SetPos(25, 50)
187ciDerma:SetSize(450, 625)
187ciDerma:SetMultiSelect(false)
187ciDerma:AddColumn("Name") -- Add column
187ciDerma:AddColumn("Steam ID")
for k,v in pairs(player.GetAll()) do
187ciDerma:AddLine(v:Nick(),v:SteamID())
end
sheet:AddSheet("Players", SheetItem, "gui/silkicons/user", false, false, "View All Players");[/lua]
[editline]09:35PM[/editline]
This at the bottom of that could should be
Replace this
[lua]sheet:AddSheet("Players", SheetItem, "gui/silkicons/user", false, false, "View All Players"); [/lua]
with
[lua]sheet:AddSheet("Players", 187Derma, "gui/silkicons/user", false, false, "View All Players"); [/lua]
[editline]09:36PM[/editline]
Also capitalize sheet and stuff or it can mess it up.
How do specify for a button to be on one sheet and not the other?
Well, you must first explain that to me, I only understand english.
[editline]09:52PM[/editline]
Oh, I think I get it. Add the button to the one sheet, don't add it to the other, lol. Simple as that. Use your brain boy.
[QUOTE=headshot119;17866220]How do specify for a button to be on one sheet and not the other?[/QUOTE]
Ok, I never liked the tutorial on property sheets either.
In order to add items to a property sheet, you must add a DPanel as the item to attach to the sheet - as only one item can be directly attached to each sheet.
Once you have those panels created, you can parent other derma items to it, and draw stuff on it, and so on. Basically, to add more items to a sheet, parent it to the sheet you intend to add it to.
[QUOTE=Justin37111;17866251]Well, you must first explain that to me, I only understand english.
[editline]09:52PM[/editline]
Oh, I think I get it. Add the button to the one sheet, don't add it to the other, lol. Simple as that. Use your brain boy.[/QUOTE]
For instance if we had two button "button1" and "button2" This line becomes:
sheet:AddSheet("Players", Button1, Button2, "gui/silkicons/user", false, false, "View All Players");
[QUOTE=headshot119;17866340]For instance if we had two button "button1" and "button2" This line becomes:
sheet:AddSheet("Players", Button1, Button2, "gui/silkicons/user", false, false, "View All Players");[/QUOTE]
No. Look at my post above which *might* explain it better, although I'm tired so I'm probably not making much sense right now.
You must add the button within the tab, not the thing calling it to make it a tab
"Players" is the title of it, then it it is the panel. Common sense dude, jesus.
Sorry, you need to Log In to post a reply to this thread.