Category:DFrame

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(add source file)
m (Added examples of removing unnecessary buttons and custom label color.)
 
Line 1: Line 1:
 
{{Panel
 
{{Panel
|Name=DFrame
 
 
|Parent=EditablePanel
 
|Parent=EditablePanel
 
|Description=The DFrame control is the foundation for any Derma menu. It holds all of your controls.
 
|Description=The DFrame control is the foundation for any Derma menu. It holds all of your controls.
 +
|Hooks=
 
|File=lua/vgui/dframe.lua
 
|File=lua/vgui/dframe.lua
 
}}
 
}}
Line 13: Line 13:
 
DermaPanel:SetDraggable( true )
 
DermaPanel:SetDraggable( true )
 
DermaPanel:MakePopup()
 
DermaPanel:MakePopup()
 +
}}
 +
{{Example
 +
|Description=Creates a DFrame with only close button.
 +
|Code=local DermaPanel = vgui.Create( "DFrame" )
 +
DermaPanel:SetPos( 100, 100 )
 +
DermaPanel:SetSize( 300, 200 )
 +
DermaPanel:SetTitle( "My new Derma frame" )
 +
DermaPanel:SetDraggable( true )
 +
DermaPanel:MakePopup()
 +
DermaPanel.btnMinim:SetVisible(false)
 +
DermaPanel.btnMaxim:SetVisible(false)
 +
}}
 +
{{Example
 +
|Description=Creates a DFrame with custom title color.
 +
|Code=local DermaPanel = vgui.Create( "DFrame" )
 +
DermaPanel:SetPos( 100, 100 )
 +
DermaPanel:SetSize( 300, 200 )
 +
DermaPanel:SetTitle( "My new Derma frame" )
 +
DermaPanel:SetDraggable( true )
 +
DermaPanel:MakePopup()
 +
DermaPanel.lblTitle.UpdateColours = function( label )
 +
label:SetTextStyleColor( color_green )
 +
end
 
}}
 
}}

Latest revision as of 12:00, 8 September 2019

Contents

DescriptionPanelPage

The DFrame control is the foundation for any Derma menu. It holds all of your controls.

Inherited Functions

Inherits the following functions from EditablePanel and its parents up to 3 levels deep:

Examples

Example

Creates a DFrame.

local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 100, 100 )
DermaPanel:SetSize( 300, 200 )
DermaPanel:SetTitle( "My new Derma frame" )
DermaPanel:SetDraggable( true )
DermaPanel:MakePopup()


Examples

Example

Creates a DFrame with only close button.

local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 100, 100 )
DermaPanel:SetSize( 300, 200 )
DermaPanel:SetTitle( "My new Derma frame" )
DermaPanel:SetDraggable( true )
DermaPanel:MakePopup()
DermaPanel.btnMinim:SetVisible(false)
DermaPanel.btnMaxim:SetVisible(false)


Examples

Example

Creates a DFrame with custom title color.

local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 100, 100 )
DermaPanel:SetSize( 300, 200 )
DermaPanel:SetTitle( "My new Derma frame" )
DermaPanel:SetDraggable( true )
DermaPanel:MakePopup()
DermaPanel.lblTitle.UpdateColours = function( label ) 
	label:SetTextStyleColor( color_green ) 
end


Personal tools
Navigation