Project

General

Profile

Bug #1191 ยป area.cpp

Boris Nagaev, 03/18/2012 06:19 PM

 
#include <boost/bind.hpp>

#include <Wt/WApplication>
#include <Wt/WImage>
#include <Wt/WText>
#include <Wt/WBreak>
#include <Wt/WCircleArea>

using namespace Wt;

class MyApp : public WApplication {
public:
MyApp(const WEnvironment& env):
WApplication(env) {
WText* clicked = new WText(root());
new WBreak(root());
WText* path = new WText(root());
new WBreak(root());
WImage* image = new WImage("http://gravatar.com/avatar/7.jpg", root());
image->resize(80, 80);
WCircleArea* area = new WCircleArea(40, 40, 40);
image->addArea(area);
//
// bug 1: path change in chrome
area->setCursor(PointingHandCursor);
//
// bug 2: fails in HTML
area->clicked().connect(boost::bind(&WText::setText,
clicked, "Ok, area clicked"));
//
setInternalPath("/test/");
internalPathChanged().connect(boost::bind(&WText::setText,
path, "Bug: path changed"));
}
};

WApplication* createApplication(const WEnvironment& env) {
return new MyApp(env);
}

int main(int argc, char** argv) {
return WRun(argc, argv, &createApplication);
}

    (1-1/1)