Project

General

Profile

Bug #3718 ยป test.cpp

Max Quatember, 01/08/2015 09:26 AM

 
1
#include	<Wt/WMessageBox>
2
#include	<Wt/WTemplate>
3

    
4
namespace
5
{
6
	class TestTemplate
7
		: public Wt::WApplication
8
	{
9
	public:
10
		TestTemplate( const Wt::WEnvironment& env )
11
			: Wt::WApplication( env )
12
		{
13
			auto t = new Wt::WTemplate;
14
			String templateText = R"(<div><iframe src="http://www.bitfactory.at" width="500" height="500">xxx</iframe></div>)";
15
			t->setTemplateText( templateText, Wt::XHTMLUnsafeText );
16
			root()->addWidget( t );
17
			auto w = new Wt::WContainerWidget;
18
			w->mouseWentDown().connect( [](...){ Wt::WMessageBox::show( "xx", "xx", Wt::Ok ); } );
19
			w->mouseWentUp().connect( [](...){ } );
20
			w->resize( 500, 500 );
21
			w->decorationStyle().setBackgroundColor( Wt::lightGray );
22
			root()->addWidget( w );
23
		}
24
	};
25
}
    (1-1/1)