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.

66 lines
1.7 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/HTML.h>
  10. using namespace vgui;
  11. //-----------------------------------------------------------------------------
  12. // HTML controls display HTML content.
  13. //-----------------------------------------------------------------------------
  14. class HTMLDemo: public DemoPage
  15. {
  16. public:
  17. HTMLDemo(Panel *parent, const char *name);
  18. ~HTMLDemo();
  19. private:
  20. HTML *m_pHTML;
  21. };
  22. //-----------------------------------------------------------------------------
  23. // Purpose: Constructor
  24. //-----------------------------------------------------------------------------
  25. HTMLDemo::HTMLDemo(Panel *parent, const char *name) : DemoPage(parent, name)
  26. {
  27. m_pHTML = new HTML(this, "AHTML");
  28. // Position the window and make it nice and wide, but preserve the
  29. // height to one line.
  30. m_pHTML->SetBounds(10, 10, 500, 300);
  31. // now open a URL
  32. m_pHTML->OpenURL("http://www.valvesoftware.com", NULL);
  33. // m_pHTML->OpenURL("file:///c:/temp/WebCap.plg");
  34. // the URL can be any valid URL accepted by Internet Explorer, use file:///c:/... for local filesystem files :)
  35. // this call causes the control to repaint itself every 1000msec or so, to allow animated gifs to work
  36. // bdawson:TODO
  37. //m_pHTML->StartAnimate(1000);
  38. }
  39. //-----------------------------------------------------------------------------
  40. // Purpose: Destructor
  41. //-----------------------------------------------------------------------------
  42. HTMLDemo::~HTMLDemo()
  43. {
  44. }
  45. Panel* HTMLDemo_Create(Panel *parent)
  46. {
  47. return new HTMLDemo(parent, "HTMLDemo");
  48. }