CHANGED: #1471 Implemented property querying for for CViewTextIDFormated.

This commit is contained in:
dfighter1985 2012-08-02 19:46:00 +02:00
parent 9a0e7661ca
commit 289adb12a4
3 changed files with 31 additions and 0 deletions

View file

@ -38,6 +38,8 @@ namespace NLGUI
public: public:
CViewTextIDFormated(const TCtorParam &param) : CViewTextID(param) CViewTextIDFormated(const TCtorParam &param) : CViewTextID(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

@ -26,6 +26,16 @@ NLMISC_REGISTER_OBJECT(CViewBase, CViewTextIDFormated, std::string, "text_id_for
namespace NLGUI namespace NLGUI
{ {
std::string CViewTextIDFormated::getProperty( const std::string &name ) const
{
if( name == "format" )
{
return getFormatString().toString();
}
else
return CViewTextID::getProperty( name );
}
// ********************************************************************************* // *********************************************************************************
bool CViewTextIDFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup) bool CViewTextIDFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup)
{ {

View file

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