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.

68 lines
1.9 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 <vgui_controls/TextImage.h>
  10. using namespace vgui;
  11. //-----------------------------------------------------------------------------
  12. // A TextImage is an Image that handles drawing of a text string
  13. // They are not panels.
  14. //-----------------------------------------------------------------------------
  15. class TextImageDemo: public DemoPage
  16. {
  17. public:
  18. TextImageDemo(Panel *parent, const char *name);
  19. ~TextImageDemo();
  20. void Paint();
  21. private:
  22. TextImage *m_pTextImage;
  23. };
  24. //-----------------------------------------------------------------------------
  25. // Purpose: Constructor
  26. //-----------------------------------------------------------------------------
  27. TextImageDemo::TextImageDemo(Panel *parent, const char *name) : DemoPage(parent, name)
  28. {
  29. // Create a TextImage object that says "Text Image Text"
  30. //m_pTextImage = new TextImage("Text Image Text", GetScheme());
  31. m_pTextImage = new TextImage("Text Image Text");
  32. // Set the position
  33. m_pTextImage->SetPos(100, 100);
  34. }
  35. //-----------------------------------------------------------------------------
  36. // Purpose: Destructor
  37. //-----------------------------------------------------------------------------
  38. TextImageDemo::~TextImageDemo()
  39. {
  40. }
  41. //-----------------------------------------------------------------------------
  42. // Purpose: Paint the image on screen. TextImages are not panels, you must
  43. // call this method explicitly for them.
  44. //-----------------------------------------------------------------------------
  45. void TextImageDemo::Paint()
  46. {
  47. m_pTextImage->Paint();
  48. }
  49. Panel* TextImageDemo_Create(Panel *parent)
  50. {
  51. return new TextImageDemo(parent, "TextImageDemo");
  52. }