Wt::WText *TopicWidget::addText(const Wt::WString& s, Wt::WContainerWidget *parent) { auto text = parent->addWidget(Wt::cpp14::make_unique<Wt::WText>(s)); bool literal; #ifndef WT_TARGET_JAVA literal = s.literal(); #else literal = WString(s).literal(); #endif if (!literal) text->setInternalPathEncoding(true); return text; }
TopicTemplate::TopicTemplate(const char *trKey) : Wt::WTemplate(tr(trKey)) { setInternalPathEncoding(true); #ifndef WT_TARGET_JAVA setCondition("if:cpp", true); setCondition("if:java", false); bindString("doc-url", "http://www.webtoolkit.eu/wt/doc/reference/html/"); #else setCondition("if:cpp", false); setCondition("if:java", true); bindString("doc-url", "http://www.webtoolkit.eu/" "jwt/latest/doc/javadoc/eu/webtoolkit/jwt/"); #endif }