CHANGED: #1471 Implemented property querying for for CViewTextFormated.

This commit is contained in:
dfighter1985 2012-08-02 19:33:03 +02:00
parent 94fb0bbb8a
commit 7390abe71c
3 changed files with 30 additions and 0 deletions

View file

@ -46,6 +46,7 @@ namespace NLGUI
CViewTextFormated (const TCtorParam &param) : CViewText(param) CViewTextFormated (const TCtorParam &param) : CViewText(param)
{} {}
std::string getProperty( const std::string &name ) const;
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
virtual void checkCoords(); virtual void checkCoords();
const ucstring &getFormatString() const { return _FormatString; } const ucstring &getFormatString() const { return _FormatString; }

View file

@ -25,6 +25,16 @@ namespace NLGUI
CViewTextFormated::IViewTextFormatter *CViewTextFormated::textFormatter = NULL; CViewTextFormated::IViewTextFormatter *CViewTextFormated::textFormatter = NULL;
std::string CViewTextFormated::getProperty( const std::string &name ) const
{
if( name == "format" )
{
return getFormatString().toString();
}
else
return CViewText::getProperty( name );
}
// **************************************************************************** // ****************************************************************************
bool CViewTextFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup) bool CViewTextFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup)
{ {

View file

@ -0,0 +1,19 @@
<widget>
<header>
<name>ViewTextFormated</name>
<guiname>CViewTextFormated</guiname>
<ancestor>ViewText</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>format</name>
<type>string</type>
<default></default>
</property>
</properties>
</widget>