/usr/lib/Wt/examples/widgetgallery/EventDisplayer.C is in witty-examples 3.1.10-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | #include "EventDisplayer.h"
#include <Wt/WText>
using namespace Wt;
EventDisplayer::EventDisplayer(WContainerWidget *parent):
WContainerWidget(parent),
eventCount_(0),
text_(new WText("Events will be shown here.", this))
{
setStyleClass("events");
}
void EventDisplayer::showSignal(Signal<WString>& signal,
const std::string& data)
{
signal.connect(boost::bind(&EventDisplayer::showWStringSignal,
this, data, _1));
}
void EventDisplayer::showSignalImpl(const std::string& str)
{
showEventImpl("Last activated signal: " + str);
}
void EventDisplayer::showWStringSignal(const std::string& str,
const WString& wstr)
{
showEventImpl("Last activated signal: " + str + wstr);
}
void EventDisplayer::setStatus(const WString &msg)
{
showEventImpl("Last status message: " + msg);
}
void EventDisplayer::showEventImpl(const WString& str)
{
if (str == lastEventStr_) {
++eventCount_;
text_->setText(str + " (" + boost::lexical_cast<std::string>(eventCount_)
+ " times)");
} else {
lastEventStr_ = str;
eventCount_ = 1;
text_->setText(str);
}
}
|