From 8d5064233be04521fb991769e3cfce19adf06748 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 1 Aug 2012 08:05:27 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for CGroupScrollText and CGroupHTML. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/group_html.h | 2 + code/nel/include/nel/gui/group_scrolltext.h | 2 + code/nel/src/gui/group_html.cpp | 240 +++++++++++++++++ code/nel/src/gui/group_scrolltext.cpp | 8 + .../plugins/gui_editor/widgets/GroupHTML.xml | 247 ++++++++++++++++++ .../gui_editor/widgets/GroupParagraph.xml | 47 ++++ .../gui_editor/widgets/GroupScrollText.xml | 17 ++ 7 files changed, 563 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHTML.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupParagraph.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupScrollText.xml diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 44bad783f..20e1bd0a3 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -87,6 +87,8 @@ namespace NLGUI CGroupHTML(const TCtorParam ¶m); ~CGroupHTML(); + std::string getProperty( const std::string &name ) const; + // CInterfaceGroup Interface virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual void draw (); diff --git a/code/nel/include/nel/gui/group_scrolltext.h b/code/nel/include/nel/gui/group_scrolltext.h index 9806d61f4..bee09a68d 100644 --- a/code/nel/include/nel/gui/group_scrolltext.h +++ b/code/nel/include/nel/gui/group_scrolltext.h @@ -43,6 +43,8 @@ namespace NLGUI CGroupScrollText(const TCtorParam ¶m); ~CGroupScrollText(); + std::string getProperty( const std::string &name ) const; + /// CInterfaceGroup Interface virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual void updateCoords (); diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 2f0ad8f68..ccbf7fb1b 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -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) diff --git a/code/nel/src/gui/group_scrolltext.cpp b/code/nel/src/gui/group_scrolltext.cpp index b2e603bf8..07cb445b4 100644 --- a/code/nel/src/gui/group_scrolltext.cpp +++ b/code/nel/src/gui/group_scrolltext.cpp @@ -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) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHTML.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHTML.xml new file mode 100644 index 000000000..cc5cce4fb --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupHTML.xml @@ -0,0 +1,247 @@ + +
+ GroupHTML + CGroupHTML + GroupScrollText + + false + +
+ + + url + string + + + + title_prefix + string + + + + background_color + string + 0 0 0 255 + + + error_color + string + 255 0 0 255 + + + link_color + string + 0 0 255 255 + + + h1_color + string + 255 255 255 255 + + + h2_color + string + 255 255 255 255 + + + h3_color + string + 255 255 255 255 + + + h4_color + string + 255 255 255 255 + + + h5_color + string + 255 255 255 255 + + + h6_color + string + 255 255 255 255 + + + error_color_global_color + bool + false + + + link_color_global_color + bool + false + + + text_color_global_color + bool + false + + + h1_color_global_color + bool + false + + + h2_color_global_color + bool + false + + + h3_color_global_color + bool + false + + + h4_color_global_color + bool + false + + + h5_color_global_color + bool + false + + + h6_color_global_color + bool + false + + + text_font_size + int + 9 + + + h1_font_size + int + 18 + + + h2_font_size + int + 15 + + + h3_font_size + int + 12 + + + h4_font_size + int + 9 + + + h5_font_size + int + 9 + + + h6_font_size + int + 9 + + + td_begin_space + int + 0 + + + paragraph_begin_space + int + 12 + + + li_begin_space + int + 4 + + + ul_begin_space + int + 12 + + + li_indent + int + -10 + + + ul_indent + int + 30 + + + multi_line_space_factor + float + 0.5 + + + form_text_area_group + string + edit_box_widget_multiline + + + form_select_group + string + html_form_select_widget + + + checkbox_bitmap_normal + string + checkbox_normal.tga + + + checkbox_bitmap_pushed + string + checkbox_pushed.tga + + + checkbox_bitmap_over + string + checkbox_over.tga + + + background_bitmap_view + string + bg + + + home + string + + + + browse_next_time + bool + false + + + browse_tree + string + + + + browse_undo + string + + + + browse_redo + string + + + + browse_refresh + string + + + + timeout + int + 10 + + +
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupParagraph.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupParagraph.xml new file mode 100644 index 000000000..e5a7b4e34 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupParagraph.xml @@ -0,0 +1,47 @@ + +
+ GroupParagraph + CGroupParagraph + InterfaceGroup + + false + +
+ + + addelt + string + B + + + align + string + L + + + space + int + 0 + + + over + bool + false + + + col_over + string + 255 255 255 32 + + + hardtext + string + + + + textid + int + 0 + + +
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupScrollText.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupScrollText.xml new file mode 100644 index 000000000..c67244641 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupScrollText.xml @@ -0,0 +1,17 @@ + +
+ GroupScrollText + CGroupScrollText + InterfaceGroup + + false + +
+ + + invert_scroll_bar + bool + true + + +