summaryrefslogtreecommitdiff
path: root/utils/vgui_panel_zoo/HTMLDemo.cpp
blob: 2dbb69b0b3d9d3cdbef1aa12a4d639c88bd9977b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//========= 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.
//-----------------------------------------------------------------------------
class HTMLDemo: public DemoPage
{
	public:
		HTMLDemo(Panel *parent, const char *name);
		~HTMLDemo();
		
	private:

		HTML *m_pHTML;				
};

//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
HTMLDemo::HTMLDemo(Panel *parent, const char *name) : DemoPage(parent, name)
{
	m_pHTML = new HTML(this, "AHTML");

	// Position the window and make it nice and wide, but preserve the 
	// height to one line.
	m_pHTML->SetBounds(10, 10, 500, 300);
	
	// now open a URL
	m_pHTML->OpenURL("http://www.valvesoftware.com", NULL);
//	m_pHTML->OpenURL("file:///c:/temp/WebCap.plg");
	// 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_pHTML->StartAnimate(1000);
}



//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
HTMLDemo::~HTMLDemo()
{
}


Panel* HTMLDemo_Create(Panel *parent)
{
	return new HTMLDemo(parent, "HTMLDemo");
}