DPropertySheet.AddSheet

From GMod Wiki

Jump to: navigation, search
Function
Syntax DPropertySheet:AddSheet( String label, Panel panel, String icon, Boolean NoStretchX, Boolean NoStretchY, String tooltip )
Description:
Adds a tab to a DPropertySheet.
Returns: Table Panels
In Object: DPropertySheet
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DPropertySheet.AddSheet]DPropertySheet.AddSheet [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates a frame with a property sheet with one tab in it.
Used onNewerClient.png
Code
 local Panel = vgui.Create("DFrame");
 Panel:SetPos(100, 100);
 Panel:SetSize(ScrW() - 100, ScrH() - 100);
 Panel:SetTitle("Test Frame");
 Panel:MakePopup();
 
 local Sheet = vgui.Create("DPropertySheet", Panel);
 Sheet:SetPos(2, 20);
 Sheet:SetSize(Panel:GetWide() - 4, Panel:GetTall() - 22);
 
 local SheetItem = vgui.Create("DCheckBoxLabel", Sheet);
 SheetItem:SetText("Cheats");
 SheetItem:SetConVar("sv_cheats");
 SheetItem:SetValue(1);
 SheetItem:SizeToContents();
 
 Sheet:AddSheet("A sheet", SheetItem, "gui/silkicons/user", false, false, "Activate sv_cheats from here");
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox