From 17c499ef176813ee1dfb0c3a41411b6f31c0c810 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 28 Jun 2012 11:06:36 +0200 Subject: [PATCH] CHANGED: #1471 CDBGroupSelectNumber is now part of the NELGUI library and is under the NLGUI namespace. Also had to add a workaround so that the linker doesn't drop the seemingly unused code from the library. Thanks goes to Kaetami for that! --- .../include/nel/gui/dbgroup_select_number.h | 96 +++++++ code/nel/include/nel/gui/dbview_bar3.h | 2 + code/nel/include/nel/gui/dbview_number.h | 2 + code/nel/src/gui/dbgroup_select_number.cpp | 234 +++++++++++++++++ code/nel/src/gui/dbview_bar3.cpp | 7 +- code/nel/src/gui/dbview_number.cpp | 4 + code/nel/src/gui/link_hack.cpp | 12 + code/nel/src/gui/widget_manager.cpp | 11 +- .../interface_v3/dbgroup_select_number.cpp | 237 ------------------ .../src/interface_v3/dbgroup_select_number.h | 98 -------- .../src/interface_v3/interface_parser.cpp | 2 +- .../register_interface_elements.cpp | 2 +- 12 files changed, 367 insertions(+), 340 deletions(-) create mode 100644 code/nel/include/nel/gui/dbgroup_select_number.h create mode 100644 code/nel/src/gui/dbgroup_select_number.cpp create mode 100644 code/nel/src/gui/link_hack.cpp delete mode 100644 code/ryzom/client/src/interface_v3/dbgroup_select_number.cpp delete mode 100644 code/ryzom/client/src/interface_v3/dbgroup_select_number.h diff --git a/code/nel/include/nel/gui/dbgroup_select_number.h b/code/nel/include/nel/gui/dbgroup_select_number.h new file mode 100644 index 000000000..1e12caaa3 --- /dev/null +++ b/code/nel/include/nel/gui/dbgroup_select_number.h @@ -0,0 +1,96 @@ +// 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 NL_DBGROUP_SELECT_NUMBER_H +#define NL_DBGROUP_SELECT_NUMBER_H + +#include "nel/misc/types_nl.h" +#include "nel/gui/interface_group.h" + + +namespace NLGUI +{ + class CCtrlBaseButton; + class CViewText; + class CViewBitmap; + + // *************************************************************************** + /** + * Widget to select a number + * \author Lionel Berenguier + * \author Nevrax France + * \date 2002 + */ + class CDBGroupSelectNumber : public CInterfaceGroup + { + public: + + /// Constructor + CDBGroupSelectNumber(const TCtorParam ¶m); + ~CDBGroupSelectNumber(); + + /// CInterfaceGroup Interface + virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); + virtual void updateCoords (); + virtual void checkCoords(); + virtual void draw (); + virtual void clearViews (); + virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc); + + // mod interface + void changeValue(sint delta); + + sint32 getMinValue () const { return _MinValue; } + void setMinValue (sint32 m) { _MinValue = m; } + sint32 getMaxValue () const { return _MaxValue; } + void setMaxValue (sint32 m) { _MaxValue = m; } + + sint32 getCurrentValue () const { return _Number.getSInt32(); } + void setCurrentValue (sint32 val) { _Number.setSInt32(val); } + + REFLECT_EXPORT_START(CDBGroupSelectNumber, CInterfaceGroup) + REFLECT_SINT32("min", getMinValue, setMinValue); + REFLECT_SINT32("max", getMaxValue, setMaxValue); + REFLECT_EXPORT_END + + protected: + + // sint32 + CInterfaceProperty _Number; + bool _LoopMode; + sint _MinValue; + sint _MaxValue; + sint _DeltaMultiplier; + + // Children + CViewBitmap *_SlotNumber; + CViewText *_TextNumber; + CCtrlBaseButton *_ButtonUp; + CCtrlBaseButton *_ButtonDown; + + private: + + void setup(); + + }; + +} + +#endif // NL_DBGROUP_SELECT_NUMBER_H + +/* End of dbgroup_select_number.h */ diff --git a/code/nel/include/nel/gui/dbview_bar3.h b/code/nel/include/nel/gui/dbview_bar3.h index 40301f1e2..ad931b304 100644 --- a/code/nel/include/nel/gui/dbview_bar3.h +++ b/code/nel/include/nel/gui/dbview_bar3.h @@ -70,6 +70,8 @@ namespace NLGUI REFLECT_SINT32 ("range3", getRange2, setRange2); REFLECT_EXPORT_END + static void forceLink(); + protected: CViewBitmap _Slot; diff --git a/code/nel/include/nel/gui/dbview_number.h b/code/nel/include/nel/gui/dbview_number.h index 9f288805f..9f40e97c1 100644 --- a/code/nel/include/nel/gui/dbview_number.h +++ b/code/nel/include/nel/gui/dbview_number.h @@ -48,6 +48,8 @@ namespace NLGUI _Number.link (dbprop.c_str()); } + static void forceLink(); + protected: sint64 getVal() { if (_Modulo == 0) return (_Number.getSInt64() / _Divisor); diff --git a/code/nel/src/gui/dbgroup_select_number.cpp b/code/nel/src/gui/dbgroup_select_number.cpp new file mode 100644 index 000000000..6b3dccd8c --- /dev/null +++ b/code/nel/src/gui/dbgroup_select_number.cpp @@ -0,0 +1,234 @@ +// 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/dbgroup_select_number.h" +#include "nel/gui/view_text.h" +#include "nel/gui/view_bitmap.h" +#include "nel/gui/ctrl_button.h" +#include "nel/gui/interface_property.h" +#include "nel/gui/action_handler.h" + +using namespace std; +using namespace NL3D; +using namespace NLMISC; + +namespace NLGUI +{ + NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupSelectNumber, std::string, "select_number"); + + // *************************************************************************** + CDBGroupSelectNumber::CDBGroupSelectNumber(const TCtorParam ¶m) : + CInterfaceGroup(param) + { + _SlotNumber= NULL; + _TextNumber= NULL; + _ButtonUp= NULL; + _ButtonDown= NULL; + _LoopMode= true; + _MinValue= 0; + _MaxValue= 9; + _DeltaMultiplier= 1; + } + + // *************************************************************************** + CDBGroupSelectNumber::~CDBGroupSelectNumber() + { + } + + // *************************************************************************** + bool CDBGroupSelectNumber::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) + { + if(!CInterfaceGroup::parse(cur, parentGroup)) + return false; + + // read params + CXMLAutoPtr ptr; + ptr = xmlGetProp (cur, (xmlChar*)"value"); + if ( ptr ) + _Number.link ( ptr ); + else + { + nlinfo ("no value in %s", _Id.c_str()); + return false; + } + + // Loop, min and max + _LoopMode= false; + ptr= xmlGetProp (cur, (xmlChar*)"loop"); + if(ptr) _LoopMode= convertBool(ptr); + _MinValue = 0; + ptr= xmlGetProp (cur, (xmlChar*)"min"); + if(ptr) fromString((const char*)ptr, _MinValue); + _MaxValue = 0; + ptr= xmlGetProp (cur, (xmlChar*)"max"); + if(ptr) fromString((const char*)ptr, _MaxValue); + ptr= xmlGetProp (cur, (xmlChar*)"delta"); + if(ptr) fromString((const char*)ptr, _DeltaMultiplier); + + // set min val in DB + _Number.setSInt32(_MinValue); + + return true; + } + + // *************************************************************************** + void CDBGroupSelectNumber::setup() + { + if (_SlotNumber != NULL) + return; + + // bind to the controls. + _SlotNumber= dynamic_cast(CInterfaceGroup::getView("slot_number")); + _TextNumber= dynamic_cast(CInterfaceGroup::getView("number")); + _ButtonUp= dynamic_cast(CInterfaceGroup::getCtrl("arrow_up")); + _ButtonDown= dynamic_cast(CInterfaceGroup::getCtrl("arrow_down")); + + // checks + if(_SlotNumber==NULL) + nlwarning("Interface: SelectNumberGroup: bitmap 'slot_number' missing or bad type"); + if(_TextNumber==NULL) + nlwarning("Interface: SelectNumberGroup: text view 'number' missing or bad type"); + if(_ButtonUp==NULL) + nlwarning("Interface: SelectNumberGroup: button 'arrow_up' missing or bad type"); + if(_ButtonDown==NULL) + nlwarning("Interface: SelectNumberGroup: button 'arrow_down' missing or bad type"); + if(_SlotNumber==NULL || _TextNumber==NULL || _ButtonUp==NULL || _ButtonDown==NULL) + return; + + // actions + _ButtonUp->setActionOnLeftClick("sn_up"); + _ButtonDown->setActionOnLeftClick("sn_down"); + } + + + // *************************************************************************** + void CDBGroupSelectNumber::updateCoords () + { + setup(); + CInterfaceGroup::updateCoords(); + } + + + + void CDBGroupSelectNumber::checkCoords() + { + if(_TextNumber) + _TextNumber->setText( toString(_Number.getSInt32()) ); + CInterfaceGroup::checkCoords(); + } + + // *************************************************************************** + void CDBGroupSelectNumber::draw () + { + CInterfaceGroup::draw(); + } + + // *************************************************************************** + void CDBGroupSelectNumber::clearViews () + { + CInterfaceGroup::clearViews(); + } + + // *************************************************************************** + bool CDBGroupSelectNumber::handleEvent (const NLGUI::CEventDescriptor &event) + { + if (event.getType() == NLGUI::CEventDescriptor::mouse) + { + const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event; + if (isIn(eventDesc.getX(), eventDesc.getY())) + { + if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel) + { + changeValue (eventDesc.getWheel()); + return true; + } + } + } + if (CInterfaceGroup::handleEvent(event)) return true; + return false; + } + + + // *************************************************************************** + void CDBGroupSelectNumber::changeValue(sint delta) + { + delta*= _DeltaMultiplier; + + // get DB and add + sint32 val= _Number.getSInt32(); + val+= delta; + + // Loop or clamp + if(_LoopMode) + { + sint32 dval= _MaxValue+1 - _MinValue; + if (dval <= 0) + { + val = 0; + return; + } + val -= _MinValue; + val = val% dval; val = (val+dval)% dval; + val += _MinValue; + } + else + { + clamp(val, _MinValue, _MaxValue); + } + + // set in DB + _Number.setSInt32(val); + if(_TextNumber) + _TextNumber->setText( toString(_Number.getSInt32()) ); + } + + + // *************************************************************************** + // *************************************************************************** + // Actions Handlers + // *************************************************************************** + // *************************************************************************** + + + // *************************************************************************** + class CSNUp : public IActionHandler + { + public: + virtual void execute (CCtrlBase *pCaller, const std::string &/* Params */) + { + CDBGroupSelectNumber *pSN = dynamic_cast(pCaller->getParent()); + if (pSN == NULL) return; + pSN->changeValue(+1); + } + }; + REGISTER_ACTION_HANDLER (CSNUp, "sn_up"); + + // *************************************************************************** + class CSNDown : public IActionHandler + { + public: + virtual void execute (CCtrlBase *pCaller, const std::string &/* Params */) + { + CDBGroupSelectNumber *pSN = dynamic_cast(pCaller->getParent()); + if (pSN == NULL) return; + pSN->changeValue(-1); + } + }; + REGISTER_ACTION_HANDLER (CSNDown, "sn_down"); + +} + diff --git a/code/nel/src/gui/dbview_bar3.cpp b/code/nel/src/gui/dbview_bar3.cpp index 03eda066d..4a1911e8c 100644 --- a/code/nel/src/gui/dbview_bar3.cpp +++ b/code/nel/src/gui/dbview_bar3.cpp @@ -17,9 +17,9 @@ #include "nel/gui/dbview_bar3.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" -#include "nel/gui/interface_group.h" using namespace std; using namespace NL3D; @@ -27,7 +27,6 @@ using namespace NLMISC; namespace NLGUI { - NLMISC_REGISTER_OBJECT(CViewBase, CDBViewBar3, std::string, "bar3"); // ---------------------------------------------------------------------------- @@ -235,5 +234,9 @@ namespace NLGUI } } } + + void CDBViewBar3::forceLink() + { + } } diff --git a/code/nel/src/gui/dbview_number.cpp b/code/nel/src/gui/dbview_number.cpp index ee6f762c7..74df94f42 100644 --- a/code/nel/src/gui/dbview_number.cpp +++ b/code/nel/src/gui/dbview_number.cpp @@ -124,5 +124,9 @@ namespace NLGUI CViewText::draw(); } + void CDBViewNumber::forceLink() + { + } + } diff --git a/code/nel/src/gui/link_hack.cpp b/code/nel/src/gui/link_hack.cpp new file mode 100644 index 000000000..a813014fd --- /dev/null +++ b/code/nel/src/gui/link_hack.cpp @@ -0,0 +1,12 @@ +#include "nel/gui/dbview_bar3.h" +#include "nel/gui/dbview_number.h" + +namespace NLGUI +{ + /// Necessary so the linker doesn't drop the code of these classes from the library + void LinkHack() + { + CDBViewBar3::forceLink(); + CDBViewNumber::forceLink(); + } +} \ No newline at end of file diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index f60349a69..da9870352 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -25,17 +25,26 @@ #include "nel/gui/group_editbox_base.h" #include "nel/gui/interface_options.h" +namespace NLGUI +{ + void LinkHack(); +} + namespace { const uint DOUBLE_CLICK_MIN = 50; const uint DOUBLE_CLICK_MAX = 750; const float ROLLOVER_MIN_DELTA_PER_MS = 0.28f; const float ROLLOVER_MAX_DELTA_PER_MS = 0.12f; + + void Hack() + { + NLGUI::LinkHack(); + } } namespace NLGUI { - CWidgetManager* CWidgetManager::instance = NULL; std::string CWidgetManager::_CtrlLaunchingModalId= "ctrl_launch_modal"; IParser* CWidgetManager::parser = NULL; diff --git a/code/ryzom/client/src/interface_v3/dbgroup_select_number.cpp b/code/ryzom/client/src/interface_v3/dbgroup_select_number.cpp deleted file mode 100644 index 1b7e7a0e5..000000000 --- a/code/ryzom/client/src/interface_v3/dbgroup_select_number.cpp +++ /dev/null @@ -1,237 +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 "stdpch.h" - - -#include "dbgroup_select_number.h" -#include "nel/gui/view_text.h" -#include "nel/gui/view_bitmap.h" -#include "nel/gui/ctrl_button.h" -#include "nel/gui/interface_property.h" -#include "interface_manager.h" -#include "nel/gui/action_handler.h" - - -using namespace std; -using namespace NL3D; -using namespace NLMISC; - -NLMISC_REGISTER_OBJECT(CViewBase, CDBGroupSelectNumber, std::string, "select_number"); - -// *************************************************************************** -CDBGroupSelectNumber::CDBGroupSelectNumber(const TCtorParam ¶m) -: CInterfaceGroup(param) -{ - _SlotNumber= NULL; - _TextNumber= NULL; - _ButtonUp= NULL; - _ButtonDown= NULL; - _LoopMode= true; - _MinValue= 0; - _MaxValue= 9; - _DeltaMultiplier= 1; -} - -// *************************************************************************** -CDBGroupSelectNumber::~CDBGroupSelectNumber() -{ -} - -// *************************************************************************** -bool CDBGroupSelectNumber::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) -{ - if(!CInterfaceGroup::parse(cur, parentGroup)) - return false; - - // read params - CXMLAutoPtr ptr; - ptr = xmlGetProp (cur, (xmlChar*)"value"); - if ( ptr ) - _Number.link ( ptr ); - else - { - nlinfo ("no value in %s", _Id.c_str()); - return false; - } - - // Loop, min and max - _LoopMode= false; - ptr= xmlGetProp (cur, (xmlChar*)"loop"); - if(ptr) _LoopMode= convertBool(ptr); - _MinValue = 0; - ptr= xmlGetProp (cur, (xmlChar*)"min"); - if(ptr) fromString((const char*)ptr, _MinValue); - _MaxValue = 0; - ptr= xmlGetProp (cur, (xmlChar*)"max"); - if(ptr) fromString((const char*)ptr, _MaxValue); - ptr= xmlGetProp (cur, (xmlChar*)"delta"); - if(ptr) fromString((const char*)ptr, _DeltaMultiplier); - - // set min val in DB - _Number.setSInt32(_MinValue); - - return true; -} - -// *************************************************************************** -void CDBGroupSelectNumber::setup() -{ - if (_SlotNumber != NULL) - return; - - // bind to the controls. - _SlotNumber= dynamic_cast(CInterfaceGroup::getView("slot_number")); - _TextNumber= dynamic_cast(CInterfaceGroup::getView("number")); - _ButtonUp= dynamic_cast(CInterfaceGroup::getCtrl("arrow_up")); - _ButtonDown= dynamic_cast(CInterfaceGroup::getCtrl("arrow_down")); - - // checks - if(_SlotNumber==NULL) - nlwarning("Interface: SelectNumberGroup: bitmap 'slot_number' missing or bad type"); - if(_TextNumber==NULL) - nlwarning("Interface: SelectNumberGroup: text view 'number' missing or bad type"); - if(_ButtonUp==NULL) - nlwarning("Interface: SelectNumberGroup: button 'arrow_up' missing or bad type"); - if(_ButtonDown==NULL) - nlwarning("Interface: SelectNumberGroup: button 'arrow_down' missing or bad type"); - if(_SlotNumber==NULL || _TextNumber==NULL || _ButtonUp==NULL || _ButtonDown==NULL) - return; - - // actions - _ButtonUp->setActionOnLeftClick("sn_up"); - _ButtonDown->setActionOnLeftClick("sn_down"); -} - - -// *************************************************************************** -void CDBGroupSelectNumber::updateCoords () -{ - setup(); - CInterfaceGroup::updateCoords(); -} - - - -void CDBGroupSelectNumber::checkCoords() -{ - if(_TextNumber) - _TextNumber->setText( toString(_Number.getSInt32()) ); - CInterfaceGroup::checkCoords(); -} - -// *************************************************************************** -void CDBGroupSelectNumber::draw () -{ - CInterfaceGroup::draw(); -} - -// *************************************************************************** -void CDBGroupSelectNumber::clearViews () -{ - CInterfaceGroup::clearViews(); -} - -// *************************************************************************** -bool CDBGroupSelectNumber::handleEvent (const NLGUI::CEventDescriptor &event) -{ - if (event.getType() == NLGUI::CEventDescriptor::mouse) - { - const NLGUI::CEventDescriptorMouse &eventDesc = (const NLGUI::CEventDescriptorMouse &)event; - if (isIn(eventDesc.getX(), eventDesc.getY())) - { - if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel) - { - changeValue (eventDesc.getWheel()); - return true; - } - } - } - if (CInterfaceGroup::handleEvent(event)) return true; - return false; -} - - -// *************************************************************************** -void CDBGroupSelectNumber::changeValue(sint delta) -{ - delta*= _DeltaMultiplier; - - // get DB and add - sint32 val= _Number.getSInt32(); - val+= delta; - - // Loop or clamp - if(_LoopMode) - { - sint32 dval= _MaxValue+1 - _MinValue; - if (dval <= 0) - { - val = 0; - return; - } - val -= _MinValue; - val = val% dval; val = (val+dval)% dval; - val += _MinValue; - } - else - { - clamp(val, _MinValue, _MaxValue); - } - - // set in DB - _Number.setSInt32(val); - if(_TextNumber) - _TextNumber->setText( toString(_Number.getSInt32()) ); -} - - -// *************************************************************************** -// *************************************************************************** -// Actions Handlers -// *************************************************************************** -// *************************************************************************** - - -// *************************************************************************** -class CSNUp : public IActionHandler -{ -public: - virtual void execute (CCtrlBase *pCaller, const std::string &/* Params */) - { - CDBGroupSelectNumber *pSN = dynamic_cast(pCaller->getParent()); - if (pSN == NULL) return; - pSN->changeValue(+1); - } -}; -REGISTER_ACTION_HANDLER (CSNUp, "sn_up"); - -// *************************************************************************** -class CSNDown : public IActionHandler -{ -public: - virtual void execute (CCtrlBase *pCaller, const std::string &/* Params */) - { - CDBGroupSelectNumber *pSN = dynamic_cast(pCaller->getParent()); - if (pSN == NULL) return; - pSN->changeValue(-1); - } -}; -REGISTER_ACTION_HANDLER (CSNDown, "sn_down"); - diff --git a/code/ryzom/client/src/interface_v3/dbgroup_select_number.h b/code/ryzom/client/src/interface_v3/dbgroup_select_number.h deleted file mode 100644 index 0b3b1a530..000000000 --- a/code/ryzom/client/src/interface_v3/dbgroup_select_number.h +++ /dev/null @@ -1,98 +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 NL_DBGROUP_SELECT_NUMBER_H -#define NL_DBGROUP_SELECT_NUMBER_H - -#include "nel/misc/types_nl.h" -#include "nel/gui/interface_group.h" - - -namespace NLGUI -{ - class CCtrlBaseButton; - class CViewText; - class CViewBitmap; -} - - - -// *************************************************************************** -/** - * Widget to select a number - * \author Lionel Berenguier - * \author Nevrax France - * \date 2002 - */ -class CDBGroupSelectNumber : public CInterfaceGroup -{ -public: - - /// Constructor - CDBGroupSelectNumber(const TCtorParam ¶m); - ~CDBGroupSelectNumber(); - - /// CInterfaceGroup Interface - virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); - virtual void updateCoords (); - virtual void checkCoords(); - virtual void draw (); - virtual void clearViews (); - virtual bool handleEvent (const NLGUI::CEventDescriptor &eventDesc); - - // mod interface - void changeValue(sint delta); - - sint32 getMinValue () const { return _MinValue; } - void setMinValue (sint32 m) { _MinValue = m; } - sint32 getMaxValue () const { return _MaxValue; } - void setMaxValue (sint32 m) { _MaxValue = m; } - - sint32 getCurrentValue () const { return _Number.getSInt32(); } - void setCurrentValue (sint32 val) { _Number.setSInt32(val); } - - REFLECT_EXPORT_START(CDBGroupSelectNumber, CInterfaceGroup) - REFLECT_SINT32("min", getMinValue, setMinValue); - REFLECT_SINT32("max", getMaxValue, setMaxValue); - REFLECT_EXPORT_END - -protected: - - // sint32 - CInterfaceProperty _Number; - bool _LoopMode; - sint _MinValue; - sint _MaxValue; - sint _DeltaMultiplier; - - // Children - CViewBitmap *_SlotNumber; - CViewText *_TextNumber; - CCtrlBaseButton *_ButtonUp; - CCtrlBaseButton *_ButtonDown; - -private: - - void setup(); - -}; - - -#endif // NL_DBGROUP_SELECT_NUMBER_H - -/* End of dbgroup_select_number.h */ diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index d07a8f154..1e59ad6fc 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -85,7 +85,7 @@ #include "nel/gui/group_tab.h" #include "group_table.h" // DBGroup -#include "dbgroup_select_number.h" +#include "nel/gui/dbgroup_select_number.h" #include "dbgroup_list_sheet.h" #include "dbgroup_combo_box.h" #include "dbgroup_list_sheet_trade.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 bfca22dd5..bad3da747 100644 --- a/code/ryzom/client/src/interface_v3/register_interface_elements.cpp +++ b/code/ryzom/client/src/interface_v3/register_interface_elements.cpp @@ -32,7 +32,7 @@ #include "nel/gui/group_container_base.h" #include "nel/gui/group_container.h" #include "nel/gui/group_list.h" -#include "dbgroup_select_number.h" +#include "nel/gui/dbgroup_select_number.h" #include "nel/gui/ctrl_button.h" #include "nel/gui/ctrl_text_button.h" #include "nel/gui/ctrl_col_pick.h"