2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-22 18:05:23 +01:00
hlsdk-xash3d/game_shared/vgui_helpers.h

73 lines
1.2 KiB
C
Raw Normal View History

2016-06-04 15:24:23 +02:00
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#pragma once
#ifndef VGUI_HELPERS_H
2021-06-20 00:53:07 +02:00
#define VGUI_HELPERS_H
2016-06-04 15:24:23 +02:00
#include "VGUI_Panel.h"
#include "VGUI_Label.h"
2016-06-04 15:24:23 +02:00
inline int PanelTop( vgui::Panel *pPanel )
{
int x, y, w, h;
2016-06-04 15:24:23 +02:00
pPanel->getBounds( x, y, w, h );
2016-06-04 15:24:23 +02:00
return y;
}
inline int PanelLeft( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return x;
}
inline int PanelRight( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return x + w;
}
inline int PanelBottom( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return y + h;
}
inline int PanelWidth( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return w;
}
inline int PanelHeight( vgui::Panel *pPanel )
{
int x, y, w, h;
pPanel->getBounds( x, y, w, h );
return h;
}
2016-06-04 15:24:23 +02:00
// Places child at the requested position inside pParent. iAlignment is from Label::Alignment.
void AlignPanel( vgui::Panel *pChild, vgui::Panel *pParent, int alignment );
2016-06-04 15:24:23 +02:00
#endif // VGUI_HELPERS_H