CHANGED: #1471 Implemented property querying for CGroupFrame.
--HG-- branch : gsoc2012-gui-editor
This commit is contained in:
parent
f0b11577a0
commit
7efbd2ff7e
3 changed files with 54 additions and 0 deletions
|
@ -40,6 +40,8 @@ namespace NLGUI
|
|||
/// Constructor
|
||||
CGroupFrame(const TCtorParam ¶m);
|
||||
|
||||
std::string getProperty( const std::string &name ) const;
|
||||
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||
virtual void draw ();
|
||||
|
||||
|
@ -65,6 +67,8 @@ namespace NLGUI
|
|||
|
||||
uint8 _DispType;
|
||||
|
||||
std::string _Options;
|
||||
|
||||
// Fields Defined in the XML => must not herit them from extends=""
|
||||
bool _DisplayFrameDefined : 1;
|
||||
bool _ColorDefined : 1;
|
||||
|
|
|
@ -44,6 +44,26 @@ namespace NLGUI
|
|||
_DispTypeDefined= false;
|
||||
}
|
||||
|
||||
std::string CGroupFrame::getProperty( const std::string &name ) const
|
||||
{
|
||||
if( name == "display" )
|
||||
{
|
||||
return toString( _DisplayFrame );
|
||||
}
|
||||
else
|
||||
if( name == "color" )
|
||||
{
|
||||
return toString( _Color );
|
||||
}
|
||||
else
|
||||
if( name == "options" )
|
||||
{
|
||||
return _Options;
|
||||
}
|
||||
else
|
||||
return CInterfaceGroup::getProperty( name );
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
bool CGroupFrame::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
||||
{
|
||||
|
@ -78,7 +98,10 @@ namespace NLGUI
|
|||
CInterfaceOptions *pIO = NULL;
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
_Options = std::string( ptr );
|
||||
pIO = CWidgetManager::getInstance()->getOptions(ptr);
|
||||
}
|
||||
|
||||
// The first type in display type struct is the default display type
|
||||
if (_DispTypes.size() == 0)
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<widget>
|
||||
<header>
|
||||
<name>GroupFrame</name>
|
||||
<guiname>CGroupFrame</guiname>
|
||||
<ancestor>InterfaceGroup</ancestor>
|
||||
<description></description>
|
||||
<abstract>true</abstract>
|
||||
<icon></icon>
|
||||
</header>
|
||||
<properties>
|
||||
<property>
|
||||
<name>display</name>
|
||||
<type>bool</type>
|
||||
<default>true</default>
|
||||
</property>
|
||||
<property>
|
||||
<name>color</name>
|
||||
<type>string</type>
|
||||
<default>255 255 255 255</default>
|
||||
</property>
|
||||
<property>
|
||||
<name>options</name>
|
||||
<type>string</type>
|
||||
<default></default>
|
||||
</property>
|
||||
</properties>
|
||||
</widget>
|
Loading…
Reference in a new issue