From 55c8a44ed4bba1997b9136488fbe91a13373fa76 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 2 Aug 2012 07:20:38 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for CViewBitmap. --- code/nel/include/nel/gui/view_bitmap.h | 2 + code/nel/src/gui/view_bitmap.cpp | 77 +++++++++++++++++++ .../plugins/gui_editor/widgets/ViewBitmap.xml | 73 ++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmap.xml diff --git a/code/nel/include/nel/gui/view_bitmap.h b/code/nel/include/nel/gui/view_bitmap.h index 00030caaa..c187e7448 100644 --- a/code/nel/include/nel/gui/view_bitmap.h +++ b/code/nel/include/nel/gui/view_bitmap.h @@ -58,6 +58,8 @@ namespace NLGUI _TxtHeight = -1; } + std::string getProperty( const std::string &name ) const; + /** * parse an xml node and initialize the base view mambers. Must call CViewBase::parse * \param cur : pointer to the xml node to be parsed diff --git a/code/nel/src/gui/view_bitmap.cpp b/code/nel/src/gui/view_bitmap.cpp index 8643b4162..50bb4f768 100644 --- a/code/nel/src/gui/view_bitmap.cpp +++ b/code/nel/src/gui/view_bitmap.cpp @@ -33,6 +33,83 @@ REGISTER_UI_CLASS(CViewBitmap) namespace NLGUI { + std::string CViewBitmap::getProperty( const std::string &name ) const + { + if( name == "color" ) + { + return toString( _Color ); + } + else + if( name == "txtoffsetx" ) + { + return toString( _TxtOffsetX ); + } + else + if( name == "txtoffsety" ) + { + return toString( _TxtOffsetY ); + } + else + if( name == "txtwidth" ) + { + return toString( _TxtWidth ); + } + else + if( name == "txtheight" ) + { + return toString( _TxtHeight ); + } + else + if( name == "texture" ) + { + return getTexture(); + } + else + if( name == "scale" ) + { + return toString( _Scale ); + } + else + if( name == "rot" ) + { + return toString( _Rot ); + } + else + if( name == "flip" ) + { + return toString( _Flip ); + } + else + if( name == "tile" ) + { + return toString( _Tile ); + } + else + if( name == "align" ) + { + std::string align; + + if( ( _Align & 1 ) != 0 ) + align += "R"; + else + align += "L"; + + if( ( _Align & 2 ) != 0 ) + align += "T"; + else + align += "B"; + + return align; + } + else + if( name == "inherit_gc_alpha" ) + { + return toString( _InheritGCAlpha ); + } + else + return CViewBase::getProperty( name ); + } + // ---------------------------------------------------------------------------- bool CViewBitmap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmap.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmap.xml new file mode 100644 index 000000000..193b61f53 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewBitmap.xml @@ -0,0 +1,73 @@ + +
+ ViewBitmap + CViewBitmap + CtrlBase + + false + +
+ + + color + string + 255 255 255 255 + + + txtoffsetx + int + 0 + + + txtoffsety + int + 0 + + + txtwidth + int + -1 + + + txtheight + int + -1 + + + texture + string + + + + scale + bool + false + + + rot + int + 0 + + + flip + bool + false + + + tile + bool + false + + + align + string + + + + inherit_gc_alpha + bool + false + + + +