From b9c9260740ef52d443ccd42d9517fa6abbe6f30f Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 24 Jun 2012 04:30:12 +0200 Subject: [PATCH] CHANGED: #1471 CDBViewBar is now part of the NELGUI library and is under the NLGUI namespace. --- code/nel/include/nel/gui/dbview_bar.h | 112 +++++++++ code/nel/src/gui/dbview_bar.cpp | 233 ++++++++++++++++++ .../src/interface_v3/action_handler_help.cpp | 2 +- .../src/interface_v3/action_phrase_faber.cpp | 2 +- .../client/src/interface_v3/dbview_bar.cpp | 227 ----------------- .../client/src/interface_v3/dbview_bar.h | 108 -------- .../client/src/interface_v3/group_skills.cpp | 2 +- .../src/interface_v3/interface_parser.cpp | 2 +- .../register_interface_elements.cpp | 2 +- 9 files changed, 350 insertions(+), 340 deletions(-) create mode 100644 code/nel/include/nel/gui/dbview_bar.h create mode 100644 code/nel/src/gui/dbview_bar.cpp delete mode 100644 code/ryzom/client/src/interface_v3/dbview_bar.cpp delete mode 100644 code/ryzom/client/src/interface_v3/dbview_bar.h diff --git a/code/nel/include/nel/gui/dbview_bar.h b/code/nel/include/nel/gui/dbview_bar.h new file mode 100644 index 000000000..ae322060e --- /dev/null +++ b/code/nel/include/nel/gui/dbview_bar.h @@ -0,0 +1,112 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + + +#ifndef RZ_DBVIEW_BAR_H +#define RZ_DBVIEW_BAR_H + +#include "nel/misc/types_nl.h" +#include "nel/gui/view_bitmap.h" + +namespace NLGUI +{ + + /** + * class implementing a bitmap used as the front texture of a progress bar + * the bitmap is drawn from _X to _W * _Range/_RangeMax + * \author Nicolas Brigand + * \author Nevrax France + * \date 2002 + */ + class CDBViewBar : public CViewBitmap + { + public: + enum TViewBar { ViewBar_UltraMini, ViewBar_Mini, ViewBar_Normal, ViewBar_MiniThick }; + public: + + /// Constructor + CDBViewBar(const TCtorParam ¶m) + : CViewBitmap(param), + _Slot(TCtorParam()) + { + _Color= NLMISC::CRGBA::White; + _ValueInt= 0; + _RangeInt = 255; + _ReferenceInt= 0; + _Type = ViewBar_Normal; + } + + void setType (TViewBar vb); + + bool parse(xmlNodePtr cur,CInterfaceGroup * parentGroup); + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } + virtual void updateCoords (); + virtual void draw (); + + /// Nbs: Values by Int are not used if the Links are setuped + void setValue (sint32 r) { _ValueInt = r; } + void setRange (sint32 r) { _RangeInt = r; } + void setReference (sint32 r) { _ReferenceInt = r; } + sint32 getValue () const { return _ValueInt; } + sint32 getRange () const { return _RangeInt; } + sint32 getReference () const { return _ReferenceInt; } + + void setValueDbLink (const std::string &r); + void setRangeDbLink (const std::string &r); + void setReferenceDbLink (const std::string &r); + std::string getValueDbLink () const; + std::string getRangeDbLink () const; + std::string getReferenceDbLink () const; + + // Reflect ValueInt (ie not used if the link is setuped) + REFLECT_EXPORT_START(CDBViewBar, CViewBitmap) + REFLECT_SINT32 ("value", getValue, setValue); + REFLECT_SINT32 ("range", getRange, setRange); + REFLECT_SINT32 ("reference", getReference, setReference); + REFLECT_STRING ("value_dblink", getValueDbLink, setValueDbLink); + REFLECT_STRING ("range_dblink", getRangeDbLink, setRangeDbLink); + REFLECT_STRING ("reference_dblink", getReferenceDbLink, setReferenceDbLink); + REFLECT_EXPORT_END + + protected: + + CViewBitmap _Slot; + TViewBar _Type; + sint32 _HBar; + NLMISC::CRGBA _ColorNegative; + + // Value of the progression in arbitrary units. should be integer + CInterfaceProperty _Value; + // Max range of the progression in arbitrary units. should be integer + CInterfaceProperty _Range; + // Reference of the progression (substracted from value and range). + CInterfaceProperty _Reference; + + /// Nbs: Values by Int are not used if the Links are setuped. NB: not overwritten by links + sint32 _ValueInt; + sint32 _RangeInt; + sint32 _ReferenceInt; + + void parseValProp(xmlNodePtr cur, CInterfaceProperty &dbProp, sint32 &intProp, const char *name); + sint64 getCurrentValProp(const CInterfaceProperty &dbProp, sint32 intProp); + }; + +} + +#endif // RZ_DBVIEW_BAR_H + +/* End of dbview_bar.h */ diff --git a/code/nel/src/gui/dbview_bar.cpp b/code/nel/src/gui/dbview_bar.cpp new file mode 100644 index 000000000..dce0f70fb --- /dev/null +++ b/code/nel/src/gui/dbview_bar.cpp @@ -0,0 +1,233 @@ +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#include "nel/gui/dbview_bar.h" +#include "nel/misc/xml_auto_ptr.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/widget_manager.h" +#include "nel/gui/db_manager.h" + +using namespace std; +using namespace NL3D; +using namespace NLMISC; + +NLMISC_REGISTER_OBJECT(CViewBase, CDBViewBar, std::string, "bar"); + +namespace NLGUI +{ + + // ---------------------------------------------------------------------------- + void CDBViewBar::parseValProp(xmlNodePtr cur, CInterfaceProperty &dbProp, sint32 &intProp, const char *name) + { + CXMLAutoPtr prop((const char*) xmlGetProp( cur, (xmlChar*)name )); + if (prop) + { + if ( isdigit(*prop.getDatas()) || *(prop.getDatas())=='-') + fromString((const char*)prop, intProp); + else + dbProp.link(prop); + } + } + + + // ---------------------------------------------------------------------------- + bool CDBViewBar::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) + { + if (!CViewBitmap::parse(cur, parentGroup)) + { + string tmp = "cannot parse view:"+getId()+", parent:"+parentGroup->getId(); + nlinfo(tmp.c_str()); + return false; + } + + CXMLAutoPtr prop; + + // read value, range and reference + parseValProp(cur, _Value, _ValueInt, "value"); + parseValProp(cur, _Range, _RangeInt, "range"); + parseValProp(cur, _Reference, _ReferenceInt, "reference"); + + // Get Visual props + prop= (char*) xmlGetProp( cur, (xmlChar*)"color_negative" ); + _ColorNegative = CRGBA(0,0,0,0); + if (prop) + _ColorNegative = convertColor (prop); + + // Bar Type + _Type = ViewBar_Normal; + + prop = (char*) xmlGetProp( cur, (xmlChar*)"mini" ); + if (prop) + if (convertBool(prop)) + setType(ViewBar_Mini); + + prop = (char*) xmlGetProp( cur, (xmlChar*)"ultra_mini" ); + if (prop) + if (convertBool(prop)) + setType(ViewBar_UltraMini); + + prop = (char*) xmlGetProp( cur, (xmlChar*)"mini_thick" ); + if (prop) + if (convertBool(prop)) + setType(ViewBar_MiniThick); + + if (_Type == ViewBar_Normal) + setType(ViewBar_Normal); + + return true; + } + + // ---------------------------------------------------------------------------- + void CDBViewBar::setType (TViewBar vb) + { + _Type = vb; + switch(_Type) + { + case ViewBar_Normal: _Slot.setTexture ("w_slot_jauge_1.tga"); break; + case ViewBar_Mini: _Slot.setTexture ("w_slot_jauge_1_mini.tga"); break; + case ViewBar_UltraMini: _Slot.setTexture ("w_slot_jauge_1_umin.tga"); break; + case ViewBar_MiniThick: _Slot.setTexture ("w_slot_jauge_1_tmin.tga"); break; + } + + _Slot.setPosRef (_PosRef); + _Slot.setParentPosRef (_ParentPosRef); + _Slot.setX (_X); + _Slot.setY (_Y); + + _Scale = true; + switch(_Type) + { + case ViewBar_Normal: setTexture ("w_jauge_fill.tga"); break; + case ViewBar_Mini: setTexture ("w_jauge_fill_mini.tga"); break; + case ViewBar_UltraMini: setTexture ("w_jauge_fill_umin.tga"); break; + case ViewBar_MiniThick: setTexture ("w_jauge_fill_tmin.tga"); break; + } + + // Get the Height Size. + sint32 wBar; + CViewRenderer::getInstance()->getTextureSizeFromId(_TextureId, wBar, _HBar); + } + + // ---------------------------------------------------------------------------- + void CDBViewBar::updateCoords () + { + if (_ParentPos == NULL) + _Slot.setParentPos (_Parent); + else + _Slot.setParentPos (_ParentPos); + _Slot.updateCoords(); + _W = _Slot.getW(); + _H = _Slot.getH(); + CViewBitmap::updateCoords(); + } + + // ---------------------------------------------------------------------------- + sint64 CDBViewBar::getCurrentValProp(const CInterfaceProperty &dbProp, sint32 intProp) + { + if(dbProp.getNodePtr()) + return dbProp.getSInt64(); + else + return intProp; + } + + // ---------------------------------------------------------------------------- + void CDBViewBar::draw () + { + float wBar = (float)(_Slot.getWReal()-4); + + sint64 value= getCurrentValProp(_Value, _ValueInt); + sint64 range= getCurrentValProp(_Range, _RangeInt); + sint64 reference= getCurrentValProp(_Reference, _ReferenceInt); + + // remove the reference + value-= reference; + range-= reference; + + // draw the bar + CRGBA color = _Color; + + if (range > 0) + { + float ratio= (float)value / range; + if (_ColorNegative.A != 0 && ratio < 0.0f) + { + ratio = - ratio; + color = _ColorNegative; + } + NLMISC::clamp(ratio, 0.f, 1.f); + wBar *= ratio; + } + else + wBar = 0; + + _WReal = (sint32)wBar; + + _Slot.draw(); + + CViewRenderer &rVR = *CViewRenderer::getInstance(); + + color.A = (uint8)(((sint32)color.A*((sint32)CWidgetManager::getInstance()->getGlobalColorForContent().A+1))>>8); + + // compute the DeltaY: mean of dif. + sint32 deltaY= (_H-_HBar)/2; + rVR.drawRotFlipBitmap (_RenderLayer, _XReal+2, _YReal+deltaY, _WReal, _HBar, 0, false, _TextureId, color); + } + + // ---------------------------------------------------------------------------- + void CDBViewBar::setValueDbLink (const std::string &r) + { + CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(r,false); + if (pNL != NULL) _Value.setNodePtr(pNL); + } + + // ---------------------------------------------------------------------------- + void CDBViewBar::setRangeDbLink (const std::string &r) + { + CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(r,false); + if (pNL != NULL) _Range.setNodePtr(pNL); + } + + // ---------------------------------------------------------------------------- + void CDBViewBar::setReferenceDbLink (const std::string &r) + { + CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(r,false); + if (pNL != NULL) _Reference.setNodePtr(pNL); + } + + // ---------------------------------------------------------------------------- + string CDBViewBar::getValueDbLink () const + { + if (_Value.getNodePtr() == NULL) return ""; + return _Value.getNodePtr()->getFullName(); + } + + // ---------------------------------------------------------------------------- + string CDBViewBar::getRangeDbLink () const + { + if (_Range.getNodePtr() == NULL) return ""; + return _Range.getNodePtr()->getFullName(); + } + + // ---------------------------------------------------------------------------- + string CDBViewBar::getReferenceDbLink () const + { + if (_Reference.getNodePtr() == NULL) return ""; + return _Reference.getNodePtr()->getFullName(); + } + +} + diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 987a6d1b4..b8573e74d 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -33,7 +33,7 @@ #include "../user_entity.h" #include "../entities.h" #include "dbgroup_combo_box.h" -#include "dbview_bar.h" +#include "nel/gui/dbview_bar.h" #include "../debug_client.h" #include "interface_3d_scene.h" #include "character_3d.h" diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index dd981f0b4..cfd442deb 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -31,7 +31,7 @@ #include "sbrick_manager.h" #include "sphrase_manager.h" #include "nel/gui/group_editbox.h" -#include "dbview_bar.h" +#include "nel/gui/dbview_bar.h" #include "skill_manager.h" #include "game_share/bot_chat_types.h" diff --git a/code/ryzom/client/src/interface_v3/dbview_bar.cpp b/code/ryzom/client/src/interface_v3/dbview_bar.cpp deleted file mode 100644 index 08975b4fc..000000000 --- a/code/ryzom/client/src/interface_v3/dbview_bar.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - -#include "dbview_bar.h" -#include "nel/misc/xml_auto_ptr.h" -#include "nel/gui/interface_group.h" -#include "nel/gui/widget_manager.h" -#include "nel/gui/db_manager.h" - -using namespace std; -using namespace NL3D; -using namespace NLMISC; - -NLMISC_REGISTER_OBJECT(CViewBase, CDBViewBar, std::string, "bar"); - -// ---------------------------------------------------------------------------- -void CDBViewBar::parseValProp(xmlNodePtr cur, CInterfaceProperty &dbProp, sint32 &intProp, const char *name) -{ - CXMLAutoPtr prop((const char*) xmlGetProp( cur, (xmlChar*)name )); - if (prop) - { - if ( isdigit(*prop.getDatas()) || *(prop.getDatas())=='-') - fromString((const char*)prop, intProp); - else - dbProp.link(prop); - } -} - - -// ---------------------------------------------------------------------------- -bool CDBViewBar::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) -{ - if (!CViewBitmap::parse(cur, parentGroup)) - { - string tmp = "cannot parse view:"+getId()+", parent:"+parentGroup->getId(); - nlinfo(tmp.c_str()); - return false; - } - - CXMLAutoPtr prop; - - // read value, range and reference - parseValProp(cur, _Value, _ValueInt, "value"); - parseValProp(cur, _Range, _RangeInt, "range"); - parseValProp(cur, _Reference, _ReferenceInt, "reference"); - - // Get Visual props - prop= (char*) xmlGetProp( cur, (xmlChar*)"color_negative" ); - _ColorNegative = CRGBA(0,0,0,0); - if (prop) - _ColorNegative = convertColor (prop); - - // Bar Type - _Type = ViewBar_Normal; - - prop = (char*) xmlGetProp( cur, (xmlChar*)"mini" ); - if (prop) - if (convertBool(prop)) - setType(ViewBar_Mini); - - prop = (char*) xmlGetProp( cur, (xmlChar*)"ultra_mini" ); - if (prop) - if (convertBool(prop)) - setType(ViewBar_UltraMini); - - prop = (char*) xmlGetProp( cur, (xmlChar*)"mini_thick" ); - if (prop) - if (convertBool(prop)) - setType(ViewBar_MiniThick); - - if (_Type == ViewBar_Normal) - setType(ViewBar_Normal); - - return true; -} - -// ---------------------------------------------------------------------------- -void CDBViewBar::setType (TViewBar vb) -{ - _Type = vb; - switch(_Type) - { - case ViewBar_Normal: _Slot.setTexture ("w_slot_jauge_1.tga"); break; - case ViewBar_Mini: _Slot.setTexture ("w_slot_jauge_1_mini.tga"); break; - case ViewBar_UltraMini: _Slot.setTexture ("w_slot_jauge_1_umin.tga"); break; - case ViewBar_MiniThick: _Slot.setTexture ("w_slot_jauge_1_tmin.tga"); break; - } - - _Slot.setPosRef (_PosRef); - _Slot.setParentPosRef (_ParentPosRef); - _Slot.setX (_X); - _Slot.setY (_Y); - - _Scale = true; - switch(_Type) - { - case ViewBar_Normal: setTexture ("w_jauge_fill.tga"); break; - case ViewBar_Mini: setTexture ("w_jauge_fill_mini.tga"); break; - case ViewBar_UltraMini: setTexture ("w_jauge_fill_umin.tga"); break; - case ViewBar_MiniThick: setTexture ("w_jauge_fill_tmin.tga"); break; - } - - // Get the Height Size. - sint32 wBar; - CViewRenderer::getInstance()->getTextureSizeFromId(_TextureId, wBar, _HBar); -} - -// ---------------------------------------------------------------------------- -void CDBViewBar::updateCoords () -{ - if (_ParentPos == NULL) - _Slot.setParentPos (_Parent); - else - _Slot.setParentPos (_ParentPos); - _Slot.updateCoords(); - _W = _Slot.getW(); - _H = _Slot.getH(); - CViewBitmap::updateCoords(); -} - -// ---------------------------------------------------------------------------- -sint64 CDBViewBar::getCurrentValProp(const CInterfaceProperty &dbProp, sint32 intProp) -{ - if(dbProp.getNodePtr()) - return dbProp.getSInt64(); - else - return intProp; -} - -// ---------------------------------------------------------------------------- -void CDBViewBar::draw () -{ - float wBar = (float)(_Slot.getWReal()-4); - - sint64 value= getCurrentValProp(_Value, _ValueInt); - sint64 range= getCurrentValProp(_Range, _RangeInt); - sint64 reference= getCurrentValProp(_Reference, _ReferenceInt); - - // remove the reference - value-= reference; - range-= reference; - - // draw the bar - CRGBA color = _Color; - - if (range > 0) - { - float ratio= (float)value / range; - if (_ColorNegative.A != 0 && ratio < 0.0f) - { - ratio = - ratio; - color = _ColorNegative; - } - NLMISC::clamp(ratio, 0.f, 1.f); - wBar *= ratio; - } - else - wBar = 0; - - _WReal = (sint32)wBar; - - _Slot.draw(); - - CViewRenderer &rVR = *CViewRenderer::getInstance(); - - color.A = (uint8)(((sint32)color.A*((sint32)CWidgetManager::getInstance()->getGlobalColorForContent().A+1))>>8); - - // compute the DeltaY: mean of dif. - sint32 deltaY= (_H-_HBar)/2; - rVR.drawRotFlipBitmap (_RenderLayer, _XReal+2, _YReal+deltaY, _WReal, _HBar, 0, false, _TextureId, color); -} - -// ---------------------------------------------------------------------------- -void CDBViewBar::setValueDbLink (const std::string &r) -{ - CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(r,false); - if (pNL != NULL) _Value.setNodePtr(pNL); -} - -// ---------------------------------------------------------------------------- -void CDBViewBar::setRangeDbLink (const std::string &r) -{ - CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(r,false); - if (pNL != NULL) _Range.setNodePtr(pNL); -} - -// ---------------------------------------------------------------------------- -void CDBViewBar::setReferenceDbLink (const std::string &r) -{ - CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(r,false); - if (pNL != NULL) _Reference.setNodePtr(pNL); -} - -// ---------------------------------------------------------------------------- -string CDBViewBar::getValueDbLink () const -{ - if (_Value.getNodePtr() == NULL) return ""; - return _Value.getNodePtr()->getFullName(); -} - -// ---------------------------------------------------------------------------- -string CDBViewBar::getRangeDbLink () const -{ - if (_Range.getNodePtr() == NULL) return ""; - return _Range.getNodePtr()->getFullName(); -} - -// ---------------------------------------------------------------------------- -string CDBViewBar::getReferenceDbLink () const -{ - if (_Reference.getNodePtr() == NULL) return ""; - return _Reference.getNodePtr()->getFullName(); -} diff --git a/code/ryzom/client/src/interface_v3/dbview_bar.h b/code/ryzom/client/src/interface_v3/dbview_bar.h deleted file mode 100644 index f3ee02129..000000000 --- a/code/ryzom/client/src/interface_v3/dbview_bar.h +++ /dev/null @@ -1,108 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#ifndef RZ_DBVIEW_BAR_H -#define RZ_DBVIEW_BAR_H - -#include "nel/misc/types_nl.h" -#include "nel/gui/view_bitmap.h" - -/** - * class implementing a bitmap used as the front texture of a progress bar - * the bitmap is drawn from _X to _W * _Range/_RangeMax - * \author Nicolas Brigand - * \author Nevrax France - * \date 2002 - */ -class CDBViewBar : public CViewBitmap -{ -public: - enum TViewBar { ViewBar_UltraMini, ViewBar_Mini, ViewBar_Normal, ViewBar_MiniThick }; -public: - - /// Constructor - CDBViewBar(const TCtorParam ¶m) - : CViewBitmap(param), - _Slot(TCtorParam()) - { - _Color= NLMISC::CRGBA::White; - _ValueInt= 0; - _RangeInt = 255; - _ReferenceInt= 0; - _Type = ViewBar_Normal; - } - - void setType (TViewBar vb); - - bool parse(xmlNodePtr cur,CInterfaceGroup * parentGroup); - virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } - virtual void updateCoords (); - virtual void draw (); - - /// Nbs: Values by Int are not used if the Links are setuped - void setValue (sint32 r) { _ValueInt = r; } - void setRange (sint32 r) { _RangeInt = r; } - void setReference (sint32 r) { _ReferenceInt = r; } - sint32 getValue () const { return _ValueInt; } - sint32 getRange () const { return _RangeInt; } - sint32 getReference () const { return _ReferenceInt; } - - void setValueDbLink (const std::string &r); - void setRangeDbLink (const std::string &r); - void setReferenceDbLink (const std::string &r); - std::string getValueDbLink () const; - std::string getRangeDbLink () const; - std::string getReferenceDbLink () const; - - // Reflect ValueInt (ie not used if the link is setuped) - REFLECT_EXPORT_START(CDBViewBar, CViewBitmap) - REFLECT_SINT32 ("value", getValue, setValue); - REFLECT_SINT32 ("range", getRange, setRange); - REFLECT_SINT32 ("reference", getReference, setReference); - REFLECT_STRING ("value_dblink", getValueDbLink, setValueDbLink); - REFLECT_STRING ("range_dblink", getRangeDbLink, setRangeDbLink); - REFLECT_STRING ("reference_dblink", getReferenceDbLink, setReferenceDbLink); - REFLECT_EXPORT_END - -protected: - - CViewBitmap _Slot; - TViewBar _Type; - sint32 _HBar; - NLMISC::CRGBA _ColorNegative; - - // Value of the progression in arbitrary units. should be integer - CInterfaceProperty _Value; - // Max range of the progression in arbitrary units. should be integer - CInterfaceProperty _Range; - // Reference of the progression (substracted from value and range). - CInterfaceProperty _Reference; - - /// Nbs: Values by Int are not used if the Links are setuped. NB: not overwritten by links - sint32 _ValueInt; - sint32 _RangeInt; - sint32 _ReferenceInt; - - void parseValProp(xmlNodePtr cur, CInterfaceProperty &dbProp, sint32 &intProp, const char *name); - sint64 getCurrentValProp(const CInterfaceProperty &dbProp, sint32 intProp); -}; - - -#endif // RZ_DBVIEW_BAR_H - -/* End of dbview_bar.h */ diff --git a/code/ryzom/client/src/interface_v3/group_skills.cpp b/code/ryzom/client/src/interface_v3/group_skills.cpp index c73082c1e..d24e1afc5 100644 --- a/code/ryzom/client/src/interface_v3/group_skills.cpp +++ b/code/ryzom/client/src/interface_v3/group_skills.cpp @@ -26,7 +26,7 @@ #include "nel/gui/view_text.h" #include "nel/gui/view_bitmap.h" #include "dbview_number.h" -#include "dbview_bar.h" +#include "nel/gui/dbview_bar.h" #include "game_share/skills.h" #include "nel/misc/xml_auto_ptr.h" diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index 5f27cf92e..484d46bea 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -46,7 +46,7 @@ #include "view_radar.h" #include "view_pointer.h" // DBView (View linked to the database) -#include "dbview_bar.h" +#include "nel/gui/dbview_bar.h" #include "dbview_bar3.h" #include "dbview_number.h" #include "dbview_quantity.h" diff --git a/code/ryzom/client/src/interface_v3/register_interface_elements.cpp b/code/ryzom/client/src/interface_v3/register_interface_elements.cpp index f71ccb5a2..e2375447c 100644 --- a/code/ryzom/client/src/interface_v3/register_interface_elements.cpp +++ b/code/ryzom/client/src/interface_v3/register_interface_elements.cpp @@ -43,7 +43,7 @@ #include "nel/gui/group_editbox.h" #include "nel/gui/group_tree.h" #include "nel/gui/reflect.h" -#include "dbview_bar.h" +#include "nel/gui/dbview_bar.h" #include "dbview_bar3.h" #include "nel/gui/ctrl_scroll_base.h" #include "nel/gui/ctrl_scroll.h"