Panel
Jump to navigation
Jump to search
vgui::Panel is the base class of all VGUI elements. It is a rectangle which covers an area of the screen and can draw itself, handle events, and host children.
Important functions
General
SetVisible(bool)- Whether the panel is drawn. Todo: Does processing continue?
Painting
A panel is drawn in its "paint" functions. PaintBackground() and Paint() are enabled by default.
PaintBackground()SetPaintBackgroundEnabled(bool)- Draws the background of the panel.
Paint()SetPaintEnabled(bool)- Draws the contents of the panel.
Confirm:Does not draw children. PaintBorder()SetPaintBorderEnabled(bool)SetBorder(IBorder *border)IBorder *GetBorder()- Paints a border around the panel.
SetBorder()must be called beforeSetPaintBorderEnabled().- Get an
IBorderfromIScheme::GetBorder()inApplySchemeSettings(). - See
swarm/resource/sourcescheme.resfor examples of border definitions.
- Get an
PostChildPaint()SetPostChildPaintEnabled(bool)- Performs arbitrary drawing after the panel's children have been painted (i.e. on top of them).