DFrame
Description
The DFrame is the moma of basically all VGUI elements. 98% of the time you will parent your element to this.
Parent
Derives methods, etc not listed on this page from EditablePanel.
Events
DFrame:OnClose()
Called when the DFrame is closed with DFrame:Close. This applies when the close button in the DFrame's control box is clicked.
This function does nothing and is safe to override.
This is not called when the DFrame is removed with Panel:Remove, see PANEL:OnRemove for that.
Methods
DFrame:Center()
Centers the frame relative to the whole screen and invalidates its layout. This overrides Panel:Center.
DFrame:Close()
Hides or removes the DFrame, and calls DFrame:OnClose.
To set whether the frame is hidden or removed, use DFrame:SetDeleteOnClose.
boolean DFrame:GetBackgroundBlur()
Gets whether the background behind the frame is being blurred.
boolean DFrame:GetDeleteOnClose()
Determines whether or not the DFrame will be removed when it is closed. This is set with DFrame:SetDeleteOnClose.
boolean DFrame:GetDraggable()
Gets whether or not the frame is draggable by the user.
Gets whether or not the frame is part of a derma menu. This is set with DFrame:SetIsMenu.
number DFrame:GetMinHeight()
Gets the minimum height the DFrame can be resized to by the user.
You must call DFrame:SetSizable before the user can resize the frame.
number DFrame:GetMinWidth()
Gets the minimum width the DFrame can be resized to by the user.
You must call DFrame:SetSizable before the user can resize the frame.
boolean DFrame:GetPaintShadow()
Gets whether or not the shadow effect bordering the DFrame is being drawn.
boolean DFrame:GetScreenLock()
Gets whether or not the DFrame is restricted to the boundaries of the screen resolution.
boolean DFrame:GetSizable()
Gets whether or not the DFrame can be resized by the user.
This is achieved by clicking and dragging in the bottom right corner of the frame.
DFrame:SetBackgroundBlur( boolean blur )
Indicate that the background elements won't be usable.
DFrame:SetDeleteOnClose( boolean shouldDelete )
Determines whether or not the DFrame is removed when it is closed with DFrame:Close.
DFrame:SetDraggable( boolean draggable )
Sets whether the frame should be draggable by the user. The DFrame can only be dragged from its title bar.
Sets whether the frame is part of a derma menu or not.
If this is set to true, CloseDermaMenus will not be called when the frame is clicked, and thus any open menus will remain open.
DFrame:SetMinHeight( number minH )
Sets the minimum height the DFrame can be resized to by the user.
This only applies to users attempting to resize the frame; Panel:SetTall and similar methods will not be affected. You must call DFrame:SetSizable before the user can resize the frame.
DFrame:SetMinWidth( number minW )
Sets the minimum width the DFrame can be resized to by the user.
This only applies to users attempting to resize the frame; Panel:SetWide and similar methods will not be affected. You must call DFrame:SetSizable before the user can resize the frame.
DFrame:SetPaintShadow( boolean shouldPaint )
Sets whether or not the shadow effect bordering the DFrame should be drawn.
DFrame:SetScreenLock( boolean lock )
Sets whether the DFrame is restricted to the boundaries of the screen resolution.
DFrame:SetSizable( boolean sizeable )
Sets whether or not the DFrame can be resized by the user.
This is achieved by clicking and dragging in the bottom right corner of the frame.
You can set the minimum size using DFrame:SetMinWidth and DFrame:SetMinHeight.
DFrame:ShowCloseButton( boolean show )
Determines whether the DFrame's control box (close, minimise and maximise buttons) is displayed.
Example
Creates a basic DFrame.
Example
Create an advanced customized DFrame.