DPropertySheet.SizeToContentWidth

From GMod Wiki

Jump to: navigation, search
Function
Syntax DPropertySheet:SizeToContentWidth( )
Description:
Sizes the width of the DPropertySheet to fit it's contents.
Returns: Nil
In Object: DPropertySheet
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DPropertySheet.SizeToContentWidth]DPropertySheet.SizeToContentWidth [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionCreates a DPropertySheet and sizes it's width to match that of it's contents
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 sheet1 = PropertySheet:AddSheet( "Tab 1", SheetItemOne, "gui/silkicons/user", false, false, "Tooltip 1" )
 
	DermaPanel:SizeToContentWidth()
end
 
 
OutputDPropertySheet sized to match the width of it's contents


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox