diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/vgui_panel_zoo/HTMLDemo2.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/vgui_panel_zoo/HTMLDemo2.cpp')
| -rw-r--r-- | utils/vgui_panel_zoo/HTMLDemo2.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/utils/vgui_panel_zoo/HTMLDemo2.cpp b/utils/vgui_panel_zoo/HTMLDemo2.cpp new file mode 100644 index 0000000..59d7fa5 --- /dev/null +++ b/utils/vgui_panel_zoo/HTMLDemo2.cpp @@ -0,0 +1,70 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// +#include "DemoPage.h" + +#include <VGUI/IVGui.h> + +#include <vgui_controls/HTML.h> + + +using namespace vgui; + +//----------------------------------------------------------------------------- +// HTML controls display HTML content, 2 side by side. +//----------------------------------------------------------------------------- +class HTMLDemo2: public DemoPage +{ + public: + HTMLDemo2(Panel *parent, const char *name); + ~HTMLDemo2(); + + private: + + HTML *m_pHTML1; + HTML *m_pHTML2; +}; + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +HTMLDemo2::HTMLDemo2(Panel *parent, const char *name) : DemoPage(parent, name) +{ + m_pHTML1 = new HTML(this, "AHTML1"); + m_pHTML2 = new HTML(this, "AHTML2"); + + // Position the window and make it nice and wide, but preserve the + // height to one line. + m_pHTML1->SetBounds(10, 10, 240, 300); + + m_pHTML2->SetBounds(20+250, 10, 240, 300); + + // now open a URL + m_pHTML1->OpenURL("http://www.valvesoftware.com", NULL); + m_pHTML2->OpenURL("http://www.valve-erc.com", NULL); + // the URL can be any valid URL accepted by Internet Explorer, use file:///c:/... for local filesystem files :) + + // this call causes the control to repaint itself every 1000msec or so, to allow animated gifs to work + // bdawson:TODO + //m_pHTML1->StartAnimate(1000); +} + + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +HTMLDemo2::~HTMLDemo2() +{ +} + + +Panel* HTMLDemo2_Create(Panel *parent) +{ + return new HTMLDemo2(parent, "HTMLDemo2"); +} + + |