DermaMenu Active Tab

I’m searching for a code that whenever you close your menu and open it back up its on the same tab as before. Anyone care to help me out?

**[DPropertySheet.GetActiveTab

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=DPropertySheet.GetActiveTab)**

**[DPropertySheet.SetActiveTab

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=DPropertySheet.SetActiveTab)**

Thank you. As well I was searching for DListView and sorting. All I found was this: List:SortByColumn(1)

That did not sort my first column like the wiki said it would.
http://wiki.garrysmod.com/?title=DListView.SortByColumn

SetActiveTab doesn’t work it returns as a nil value.
GetActiveTab doesn’t work either it returns nil aswell.

Post your code.

[lua]
local DermaPanel, sheet1, sheet2 = nil, nil, nil

function testDFrame()
DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos( 50, 50 )
DermaPanel:SetSize( 350, 400 )
DermaPanel:SetTitle( “Testing Derma Stuff” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local PropertySheet = vgui.Create( "DPropertySheet", DermaPanel )
PropertySheet:SetPos( 5, 30 )
PropertySheet:SetSize( 340, 315 )

local SheetItemOne = vgui.Create( "DCheckBoxLabel" )
SheetItemOne:SetText( "Use Props?" )
SheetItemOne:SetConVar( "some_convar" )
SheetItemOne:SetValue( 1 )
SheetItemOne:SizeToContents()

local SheetItemTwo = vgui.Create( "DCheckBoxLabel" , CategoryContentTwo )
SheetItemTwo:SetText( "Use SENTs?" )
SheetItemTwo:SetConVar( "some_convar" )
SheetItemTwo:SetValue( 1 )
SheetItemTwo:SizeToContents()

local sheet1 = PropertySheet:AddSheet( "Some Menu", SheetItemOne, "gui/silkicons/user", false, false, "WOW It's a text box!!!" )
local sheet2 = PropertySheet:AddSheet( "Super Menu", SheetItemTwo, "gui/silkicons/group", false, false, "Can I haz meh cheezburger now?" )

DermaPanel:SetActiveTab( sheet2.Tab )

end
concommand.Add(“open”, testDFrame)
[/lua]
This is directly from the wiki.

The SetActiveTab() works on a PropertySheet. Instead of “DermaPanel:SetActiveTab( sheet2.Tab)” do “PropertySheet:SetActiveTab( sheet2.Tab)”.

Thanks i’ll try that :smiley:

[editline]20th January 2012[/editline]

Thanks but it didnt work…
[lua]
local Sheet1 = Sheet:AddSheet( “Entities”, EntitiesPanel, “gui/silkicons/user”, false, false, “Supplies!” )
local Sheet2 = Sheet:AddSheet( “PlayerInfo”, ScoreBoard, “gui/silkicons/user”, false, false, “Player Information!” )
if Sheet:GetActiveTab( )==Sheet1 then
Sheet:SetActiveTab( Sheet1.Tab )
elseif Sheet:GetActiveTab( )==Sheet2 then
Sheet:SetActiveTab( Sheet2.Tab )
end
[/lua]
This is the other code that doesnt show the active tab is actually it. It only shows the one thats NOT active.
[lua]
if Sheet:GetActiveTab( )==Sheet2 then
print( " The active tab is ‘Super Menu’." )
else
print( “The active tab is NOT ‘Super Menu’.” )

end

[/lua]