DPropertySheet.GetActiveTab

From GMod Wiki

Jump to: navigation, search
Function
Syntax DPropertySheet:GetActiveTab( )
Description:
Returns the active sheet as a DTab control.
Returns: Panel
In Object: DPropertySheet
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DPropertySheet.GetActiveTab]DPropertySheet.GetActiveTab [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates a DPropertysheets and prints whether or not sheet 2 is selected.
Used onNewerClient.png
Code
 
	local 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?" )
 
	if DermaPanel:GetActiveTab( )==sheet2 then
		print( " The active tab is 'Super Menu'." )
	else
		print( "The active tab is NOT 'Super Menu'." )
 
	end
end
 
 
Outputprints "The active tab is NOT 'Super Menu'." in console


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox