Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef VGUI_HELPERS_H
  8. #define VGUI_HELPERS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Panel.h>
  13. #include <vgui_controls/label.h>
  14. inline int PanelTop(vgui::Panel *pPanel) {int x,y,w,h; pPanel->GetBounds(x,y,w,h); return y;}
  15. inline int PanelLeft(vgui::Panel *pPanel) {int x,y,w,h; pPanel->GetBounds(x,y,w,h); return x;}
  16. inline int PanelRight(vgui::Panel *pPanel) {int x,y,w,h; pPanel->GetBounds(x,y,w,h); return x+w;}
  17. inline int PanelBottom(vgui::Panel *pPanel) {int x,y,w,h; pPanel->GetBounds(x,y,w,h); return y+h;}
  18. inline int PanelWidth(vgui::Panel *pPanel) {int x,y,w,h; pPanel->GetBounds(x,y,w,h); return w;}
  19. inline int PanelHeight(vgui::Panel *pPanel) {int x,y,w,h; pPanel->GetBounds(x,y,w,h); return h;}
  20. // Places child at the requested position inside pParent. iAlignment is from Label::Alignment.
  21. void AlignPanel(vgui::Panel *pChild, vgui::Panel *pParent, int alignment);
  22. #endif // VGUI_HELPERS_H