VGUI Panel: Difference between revisions
Jump to navigation
Jump to search
m (→Keyvalues: am i doing this right?) |
m (cleanup) |
||
Line 1: | Line 1: | ||
==Object description== | |||
==Object | |||
An object that can have other objects placed inside it. | An object that can have other objects placed inside it. | ||
Also a base object from which other objects are derived. | Also a base object from which other objects are derived. | ||
Often used as the main 'window' of a VGUI display. | Often used as the main 'window' of a VGUI display. | ||
From the header file Panel.h: | From the header file Panel.h: | ||
<pre> | <pre> | ||
//----------------------------------------------------------------------------- | //--------------------------------------------------------------------------------------------------------- | ||
// Purpose: Base interface to all | // Purpose: Base interface to all VGUI windows | ||
// All | // All VGUI controls that receive message and/or have a physical presence | ||
// on screen are be derived from Panel. | // on screen are be derived from Panel. | ||
// This is designed as an easy-access to the vgui-functionality; for more | // This is designed as an easy-access to the vgui-functionality; for more | ||
// low-level access to vgui functions use the IPanel/IClientPanel interfaces directly | // low-level access to vgui functions use the IPanel/IClientPanel interfaces directly | ||
//----------------------------------------------------------------------------- | //--------------------------------------------------------------------------------------------------------- | ||
</pre> | </pre> | ||
== | == Availability == | ||
This object is available in all Source games. | This object is available in all Source games. | ||
In code it is represented by class '''Panel''', defined in <code>public/vgui_controls/Panel.h</code> and contained in the namespace <code>vgui</code>. | In code it is represented by class '''Panel''', defined in <code>public/vgui_controls/Panel.h</code> and contained in the namespace <code>vgui</code>. | ||
The source file is located at: <code>vgui2/controls/Panel.cpp</code> | The source file is located at: <code>vgui2/controls/Panel.cpp</code> | ||
==Keyvalues== | == Keyvalues == | ||
*'''xpos''' | *'''xpos''' | ||
:<string> X Position (column) of the panel. | :<string> X Position (column) of the panel. | ||
Line 62: | Line 59: | ||
*'''visible''' | *'''visible''' | ||
:<integer> | :<integer> Whether the control is visible or not. | ||
:Default: 1 | :Default: 1 | ||
:Valid range: 0, 1 | :Valid range: 0, 1 | ||
Line 105: | Line 102: | ||
*'''PinCorner''' | *'''PinCorner''' | ||
:<string> Controls where the 'pin' | :<string> Controls where the 'pin' pull-down menu is displayed | ||
:Default: "topleft" | :Default: "topleft" | ||
:Valid range: TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT | :Valid range: TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT | ||
Line 113: | Line 110: | ||
*'''UnpinnedCornerOffsetX''' | *'''UnpinnedCornerOffsetX''' | ||
*'''UnpinnedCornerOffsetY''' | *'''UnpinnedCornerOffsetY''' | ||
[[Category:VGUI_Controls]] | [[Category:VGUI_Controls]] |
Revision as of 04:03, 1 October 2007
Object description
An object that can have other objects placed inside it. Also a base object from which other objects are derived.
Often used as the main 'window' of a VGUI display.
From the header file Panel.h:
//--------------------------------------------------------------------------------------------------------- // Purpose: Base interface to all VGUI windows // All VGUI controls that receive message and/or have a physical presence // on screen are be derived from Panel. // This is designed as an easy-access to the vgui-functionality; for more // low-level access to vgui functions use the IPanel/IClientPanel interfaces directly //---------------------------------------------------------------------------------------------------------
Availability
This object is available in all Source games.
In code it is represented by class Panel, defined in public/vgui_controls/Panel.h
and contained in the namespace vgui
.
The source file is located at: vgui2/controls/Panel.cpp
Keyvalues
- xpos
- <string> X Position (column) of the panel.
- Examples:
- "xpos" "300"
- Will position on x = 300, where x = 0 is the first position to the left and grows to the right.
- "xpos" "r300"
- Will position on x = 300, where x = 0 is the first position to the right and grows to the left.
- "xpos" "c300"
- Will position on x = 300, where x = 0 is at the center of the screen and grows to the right.
- The numeric value is parsed with atoi().
- ypos
- <string> Y Position (row) of the panel.
- Examples:
- "ypos" "300"
- Will position on y = 300, where y = 0 is the first position from the top and grows to the bottom.
- "ypos" "r300"
- Will position on y = 300, where y = 0 is the first position from the bottom and grows to the top.
- "ypos" "c300"
- Will position on y = 300, where y = 0 is at the center of the screen and grows to the bottom.
- The numeric value is parsed with atoi().
- zpos
- <string> Positions on z. Default is 1
- wide
- <string> Control width.
- tall
- <string> Control height.
- IgnoreScheme
- <integer> Default 0
- Valid range: 0, 1
- // only get colors if we're ignoring the scheme
- visible
- <integer> Whether the control is visible or not.
- Default: 1
- Valid range: 0, 1
- enabled
- <integer> Wether the control can be used.
- Default: 1
- Valid range: 0, 1
- tabPosition
- <integer> Controls the tab sequence.
- Used to set the order of what object gets the focus when tab is pressed.
- Default: 0
- Valid range: 0, ... 255
- tooltiptext
- <string> Text displayed when mouse is hovered over control
- Doesnt work on XBOX
- paintbackground
- <integer> Draw the background of the object or not.
- Default: -1, no action will be taken
- Valid range: 0, 1
- 0 will call SetPaintBackgroundEnabled( false );
- 1 will call SetPaintBackgroundEnabled( true );
- paintborder
- <integer> Draw the border of the object or not.
- Default: -1, no action will be taken
- Valid range: 0, 1
- 0 will call SetPaintBorderEnabled( false );
- 1 will call SetPaintBorderEnabled( true );
- fieldName
- <string> Sets the control's name, default NULL
- AutoResize
- <string> Controls resizing ability
- Default: "no"
- Valid range: NO, RIGHT, DOWN, DOWNANDRIGHT
- PinCorner
- <string> Controls where the 'pin' pull-down menu is displayed
- Default: "topleft"
- Valid range: TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT
- PinnedCornerOffsetX
- PinnedCornerOffsetY
- UnpinnedCornerOffsetX
- UnpinnedCornerOffsetY