I think that create a HTML Lib is a BAD idea... reinvented the wheel.

My xml:

<message id="index">
  <div id="menuleft"><aside><header><h3>${user}</h3></header>
  ... ...
</message>

<message id="user">Usuário</message>

My cpp:

inline void fillText(Wt::WTemplate *tp, std::string str) {  fillText(tp,
str, str); }

void UtilsWt::fillText(WTemplate *tp, string str1, string str2) {
  tp->bindWidget(str1, new WText(WString::tr(str2)));
}

...
wTemplate_ = new WTemplate(WString::tr("index"), root());
utilswt->fillText(wTemplate_, "user");

or I can use: utilswt->fillText(wTemplate_, "user_login", "login_screen");


explain:

1) In cpp I read <message id="index"> and add to a WTemplate.

2) After I call my overloaded fillText function, send template object
and a 'tag name'.

3) The function fillText will bind the 'user' tag in template with the
'user' message.


I use the fillText funcion in hundreds places to change small texts of
many lines of HTML code.

HTML + CSS with XMLs is the best solution.


On 11/15/2011 06:05 AM, Koen Deforche wrote:
> Hey Parvinder,
> 
> 2011/11/12 PARVINDER RAJPUT <m...@parvinder.co.in>:
>> Hello All
>>
>>  We have any library or anyone develop a library, to text seen bold,
>> italic, or <h1> to <h6>. If no, then Please we can think about that.
>> Like if we attach 1 with WText() then it automatically pickup the h1
>> tag.
> 
> I think there is indeed room for improvement, to customize the tag
> used to render a WText.
> Could you post this as a feature request to our redmine issue tracker ?
> 
> Regards,
> koen


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to