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.

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