10 #include <Wt/WApplication.h> 12 #include <Wt/WStringUtil.h> 19 langLayout->
addWidget(cpp14::make_unique<WText>(
tr(
"language")));
21 const char *lang[] = {
"en",
"nl" };
23 for (
int i = 0; i < 2; ++i) {
24 WText *t = langLayout->
addWidget(cpp14::make_unique<WText>(lang[i]));
42 bool haveLang =
false;
51 haveLang = haveLang || isLang;
55 languageSelects_[0]->setStyleClass(
"langcurrent");
56 WApplication::instance()
57 ->setLocale(languageSelects_[0]->text().toUTF8());
59 WApplication::instance()->setLocale(lang);
69 std::unique_ptr<WApplication> app
70 = cpp14::make_unique<WApplication>(env);
71 app->messageResourceBundle().use(WApplication::appRoot() +
"form-example");
72 app->setTitle(
"Form example");
74 app->root()->addWidget(cpp14::make_unique<FormExample>());
78 langStyle.
setCursor(Cursor::PointingHand);
81 app->styleSheet().addRule(
".lang", langStyle);
85 app->styleSheet().addRule(
".langcurrent", langStyle);
90 int main(
int argc,
char **argv)
void setSize(FontSize size)
Wt::Signals::connection connect(const F &function)
void setWeight(FontWeight weight, int value=400)
std::string toUTF8() const
const WString & text() const
void setForegroundColor(WColor color)
void setTextDecoration(WFlags< TextDecoration > decoration)