Team Fortress 2 Source Code as on 22/4/2020
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.

53 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "DemoPage.h"
  8. #include "vgui/IVGui.h"
  9. #include "tier1/KeyValues.h"
  10. #include <vgui_controls/Label.h>
  11. using namespace vgui;
  12. //-----------------------------------------------------------------------------
  13. // A Label is a panel class to handle the display of images and text strings.
  14. // Here we demonstrate a simple text only label.
  15. //-----------------------------------------------------------------------------
  16. class LabelDemo: public DemoPage
  17. {
  18. public:
  19. LabelDemo(Panel *parent, const char *name);
  20. ~LabelDemo();
  21. private:
  22. Label *m_pLabel;
  23. };
  24. //-----------------------------------------------------------------------------
  25. // Purpose: Constructor
  26. //-----------------------------------------------------------------------------
  27. LabelDemo::LabelDemo(Panel *parent, const char *name) : DemoPage(parent, name)
  28. {
  29. m_pLabel = new Label(this, "ALabel", "LabelText");
  30. m_pLabel->SetPos(100, 100);
  31. }
  32. //-----------------------------------------------------------------------------
  33. // Purpose: Destructor
  34. //-----------------------------------------------------------------------------
  35. LabelDemo::~LabelDemo()
  36. {
  37. }
  38. Panel* LabelDemo_Create(Panel *parent)
  39. {
  40. return new LabelDemo(parent, "LabelDemo");
  41. }