CHANGED: #1471 Implemented property querying for CGroupScrollText and CGroupHTML.

This commit is contained in:
dfighter1985 2012-08-01 08:05:27 +02:00
parent a3b7a78961
commit 963936c503
7 changed files with 563 additions and 0 deletions

View file

@ -87,6 +87,8 @@ namespace NLGUI
CGroupHTML(const TCtorParam &param);
~CGroupHTML();
std::string getProperty( const std::string &name ) const;
// CInterfaceGroup Interface
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
virtual void draw ();

View file

@ -43,6 +43,8 @@ namespace NLGUI
CGroupScrollText(const TCtorParam &param);
~CGroupScrollText();
std::string getProperty( const std::string &name ) const;
/// CInterfaceGroup Interface
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
virtual void updateCoords ();

View file

@ -1905,6 +1905,246 @@ namespace NLGUI
delete _LibWWW;
}
std::string CGroupHTML::getProperty( const std::string &name ) const
{
if( name == "url" )
{
return _URL;
}
else
if( name == "title_prefix" )
{
return _TitlePrefix.toString();
}
else
if( name == "background_color" )
{
return toString( BgColor );
}
else
if( name == "error_color" )
{
return toString( ErrorColor );
}
else
if( name == "link_color" )
{
return toString( LinkColor );
}
else
if( name == "h1_color" )
{
return toString( H1Color );
}
else
if( name == "h2_color" )
{
return toString( H2Color );
}
else
if( name == "h3_color" )
{
return toString( H3Color );
}
else
if( name == "h4_color" )
{
return toString( H4Color );
}
else
if( name == "h5_color" )
{
return toString( H5Color );
}
else
if( name == "h6_color" )
{
return toString( H6Color );
}
else
if( name == "error_color_global_color" )
{
return toString( ErrorColorGlobalColor );
}
else
if( name == "link_color_global_color" )
{
return toString( LinkColorGlobalColor );
}
else
if( name == "text_color_global_color" )
{
return toString( TextColorGlobalColor );
}
else
if( name == "h1_color_global_color" )
{
return toString( H1ColorGlobalColor );
}
else
if( name == "h2_color_global_color" )
{
return toString( H2ColorGlobalColor );
}
else
if( name == "h3_color_global_color" )
{
return toString( H3ColorGlobalColor );
}
else
if( name == "h4_color_global_color" )
{
return toString( H4ColorGlobalColor );
}
else
if( name == "h5_color_global_color" )
{
return toString( H5ColorGlobalColor );
}
else
if( name == "h6_color_global_color" )
{
return toString( H6ColorGlobalColor );
}
else
if( name == "text_font_size" )
{
return toString( TextFontSize );
}
else
if( name == "h1_font_size" )
{
return toString( H1FontSize );
}
else
if( name == "h2_font_size" )
{
return toString( H2FontSize );
}
else
if( name == "h3_font_size" )
{
return toString( H3FontSize );
}
else
if( name == "h4_font_size" )
{
return toString( H4FontSize );
}
else
if( name == "h5_font_size" )
{
return toString( H5FontSize );
}
else
if( name == "h6_font_size" )
{
return toString( H6FontSize );
}
else
if( name == "td_begin_space" )
{
return toString( TDBeginSpace );
}
else
if( name == "paragraph_begin_space" )
{
return toString( PBeginSpace );
}
else
if( name == "li_begin_space" )
{
return toString( LIBeginSpace );
}
else
if( name == "ul_begin_space" )
{
return toString( ULBeginSpace );
}
else
if( name == "li_indent" )
{
return toString( LIIndent );
}
else
if( name == "ul_indent" )
{
return toString( ULIndent );
}
else
if( name == "multi_line_space_factor" )
{
return toString( LineSpaceFontFactor );
}
else
if( name == "form_text_area_group" )
{
return DefaultFormTextGroup;
}
else
if( name == "form_select_group" )
{
return DefaultFormSelectGroup;
}
else
if( name == "checkbox_bitmap_normal" )
{
return DefaultCheckBoxBitmapNormal;
}
else
if( name == "checkbox_bitmap_pushed" )
{
return DefaultCheckBoxBitmapPushed;
}
else
if( name == "checkbox_bitmap_over" )
{
return DefaultCheckBoxBitmapOver;
}
else
if( name == "background_bitmap_view" )
{
return DefaultBackgroundBitmapView;
}
else
if( name == "home" )
{
return Home;
}
else
if( name == "browse_next_time" )
{
return toString( _BrowseNextTime );
}
else
if( name == "browse_tree" )
{
return _BrowseTree;
}
else
if( name == "browse_undo" )
{
return _BrowseUndoButton;
}
else
if( name == "browse_redo" )
{
return _BrowseRedoButton;
}
else
if( name == "browse_refresh" )
{
return _BrowseRefreshButton;
}
else
if( name == "timeout" )
{
return toString( _TimeoutValue );
}
else
return CGroupScrollText::getProperty( name );
}
// ***************************************************************************
bool CGroupHTML::parse(xmlNodePtr cur,CInterfaceGroup *parentGroup)

View file

@ -49,6 +49,14 @@ namespace NLGUI
{
}
std::string CGroupScrollText::getProperty( const std::string &name ) const
{
if( name == "invert_scroll_bar" )
return NLMISC::toString( _InvertScrollBar );
else
return CInterfaceGroup::getProperty( name );
}
//========================================================================
bool CGroupScrollText::parse(xmlNodePtr cur,CInterfaceGroup *parentGroup)
{

View file

@ -0,0 +1,247 @@
<widget>
<header>
<name>GroupHTML</name>
<guiname>CGroupHTML</guiname>
<ancestor>GroupScrollText</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>url</name>
<type>string</type>
<default></default>
</property>
<property>
<name>title_prefix</name>
<type>string</type>
<default></default>
</property>
<property>
<name>background_color</name>
<type>string</type>
<default>0 0 0 255</default>
</property>
<property>
<name>error_color</name>
<type>string</type>
<default>255 0 0 255</default>
</property>
<property>
<name>link_color</name>
<type>string</type>
<default>0 0 255 255</default>
</property>
<property>
<name>h1_color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>h2_color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>h3_color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>h4_color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>h5_color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>h6_color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>error_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>link_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>text_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>h1_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>h2_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>h3_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>h4_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>h5_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>h6_color_global_color</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>text_font_size</name>
<type>int</type>
<default>9</default>
</property>
<property>
<name>h1_font_size</name>
<type>int</type>
<default>18</default>
</property>
<property>
<name>h2_font_size</name>
<type>int</type>
<default>15</default>
</property>
<property>
<name>h3_font_size</name>
<type>int</type>
<default>12</default>
</property>
<property>
<name>h4_font_size</name>
<type>int</type>
<default>9</default>
</property>
<property>
<name>h5_font_size</name>
<type>int</type>
<default>9</default>
</property>
<property>
<name>h6_font_size</name>
<type>int</type>
<default>9</default>
</property>
<property>
<name>td_begin_space</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>paragraph_begin_space</name>
<type>int</type>
<default>12</default>
</property>
<property>
<name>li_begin_space</name>
<type>int</type>
<default>4</default>
</property>
<property>
<name>ul_begin_space</name>
<type>int</type>
<default>12</default>
</property>
<property>
<name>li_indent</name>
<type>int</type>
<default>-10</default>
</property>
<property>
<name>ul_indent</name>
<type>int</type>
<default>30</default>
</property>
<property>
<name>multi_line_space_factor</name>
<type>float</type>
<default>0.5</default>
</property>
<property>
<name>form_text_area_group</name>
<type>string</type>
<default>edit_box_widget_multiline</default>
</property>
<property>
<name>form_select_group</name>
<type>string</type>
<default>html_form_select_widget</default>
</property>
<property>
<name>checkbox_bitmap_normal</name>
<type>string</type>
<default>checkbox_normal.tga</default>
</property>
<property>
<name>checkbox_bitmap_pushed</name>
<type>string</type>
<default>checkbox_pushed.tga</default>
</property>
<property>
<name>checkbox_bitmap_over</name>
<type>string</type>
<default>checkbox_over.tga</default>
</property>
<property>
<name>background_bitmap_view</name>
<type>string</type>
<default>bg</default>
</property>
<property>
<name>home</name>
<type>string</type>
<default></default>
</property>
<property>
<name>browse_next_time</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>browse_tree</name>
<type>string</type>
<default></default>
</property>
<property>
<name>browse_undo</name>
<type>string</type>
<default></default>
</property>
<property>
<name>browse_redo</name>
<type>string</type>
<default></default>
</property>
<property>
<name>browse_refresh</name>
<type>string</type>
<default></default>
</property>
<property>
<name>timeout</name>
<type>int</type>
<default>10</default>
</property>
</properties>
</widget>

View file

@ -0,0 +1,47 @@
<widget>
<header>
<name>GroupParagraph</name>
<guiname>CGroupParagraph</guiname>
<ancestor>InterfaceGroup</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>addelt</name>
<type>string</type>
<default>B</default>
</property>
<property>
<name>align</name>
<type>string</type>
<default>L</default>
</property>
<property>
<name>space</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>over</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>col_over</name>
<type>string</type>
<default>255 255 255 32</default>
</property>
<property>
<name>hardtext</name>
<type>string</type>
<default></default>
</property>
<property>
<name>textid</name>
<type>int</type>
<default>0</default>
</property>
</properties>
</widget>

View file

@ -0,0 +1,17 @@
<widget>
<header>
<name>GroupScrollText</name>
<guiname>CGroupScrollText</guiname>
<ancestor>InterfaceGroup</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>invert_scroll_bar</name>
<type>bool</type>
<default>true</default>
</property>
</properties>
</widget>