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
67
68
69
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");
}
|