From 8193f484bf8c1b0d1140aa0180058ad36c377348 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Fri, 22 Jun 2012 04:27:53 +0200 Subject: [PATCH] CHANGED: #1471 CViewBitmapCombo no longer depends on CViewPointer. --HG-- branch : gui-refactoring --- code/nel/include/nel/gui/view_pointer_base.h | 8 ++++++++ code/nel/src/gui/view_pointer_base.cpp | 3 ++- .../src/interface_v3/view_bitmap_combo.cpp | 17 ++++++++--------- .../client/src/interface_v3/view_pointer.cpp | 3 +-- .../client/src/interface_v3/view_pointer.h | 7 ------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/code/nel/include/nel/gui/view_pointer_base.h b/code/nel/include/nel/gui/view_pointer_base.h index bcc38fea4..ab7629a19 100644 --- a/code/nel/include/nel/gui/view_pointer_base.h +++ b/code/nel/include/nel/gui/view_pointer_base.h @@ -18,6 +18,7 @@ #ifndef VIEW_POINTER_BASE_H #define VIEW_POINTER_BASE_H +#include "nel/misc/events.h" #include "nel/gui/view_base.h" namespace NLGUI @@ -52,6 +53,11 @@ namespace NLGUI bool show() const {return _PointerVisible;} void draw(){} + + /// set button state + void setButtonState(NLMISC::TMouseButton state) { _Buttons = state; } + /// get buttons state + NLMISC::TMouseButton getButtonState() const { return _Buttons; } protected: // (x,y) is from the TopLeft corner of the window @@ -66,6 +72,8 @@ namespace NLGUI bool _PointerDrag; // Is the pointer down and we have moved ? bool _PointerVisible; // Is the pointer visible or hidden ? + NLMISC::TMouseButton _Buttons; + private: diff --git a/code/nel/src/gui/view_pointer_base.cpp b/code/nel/src/gui/view_pointer_base.cpp index 976263eb1..221fffbf4 100644 --- a/code/nel/src/gui/view_pointer_base.cpp +++ b/code/nel/src/gui/view_pointer_base.cpp @@ -21,7 +21,8 @@ namespace NLGUI { CViewPointerBase::CViewPointerBase( const CViewBase::TCtorParam ¶m ) : - CViewBase( param ) + CViewBase( param ), + _Buttons( NLMISC::noButton ) { _PointerX = _PointerY = _PointerOldX = _PointerOldY = _PointerDownX = _PointerDownY = 0; _PointerDown = false; diff --git a/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp b/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp index 34aebfaf8..c4f230129 100644 --- a/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp +++ b/code/ryzom/client/src/interface_v3/view_bitmap_combo.cpp @@ -14,13 +14,13 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - - -#include "stdpch.h" - #include "view_bitmap_combo.h" -#include "interface_manager.h" #include "nel/misc/xml_auto_ptr.h" +#include "nel/gui/db_manager.h" +#include "nel/gui/view_renderer.h" +#include "nel/gui/widget_manager.h" +#include "nel/gui/view_pointer_base.h" +#include "nel/gui/interface_group.h" using namespace NLMISC; @@ -275,7 +275,6 @@ void CViewBitmapCombo::draw() if (numRow == 0 || numCol == 0) return; sint32 mx = 0, my = 0; - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance(); const std::vector &rVB = CWidgetManager::getInstance()->getViewsUnderPointer(); if (!CWidgetManager::getInstance()->getPointer()) return; @@ -361,7 +360,7 @@ void CViewBitmapCombo::draw() && my < py + (sint32) itemh) { overItem = true; - if ( static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton) + if ( CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsPushedId, texIndex); color = getCol(_ColPushed, texIndex); @@ -416,7 +415,7 @@ void CViewBitmapCombo::draw() // if (_CD.Unrolled.getBool()) { - if (overItem && static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton) + if (overItem && CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsId, selectedTexIndex); color = getCol(_Col, selectedTexIndex); @@ -436,7 +435,7 @@ void CViewBitmapCombo::draw() && my < py + (sint32) itemh ) { - if ( static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() )->getButtonState() & NLMISC::leftButton) + if ( CWidgetManager::getInstance()->getPointer()->getButtonState() & NLMISC::leftButton) { textId = getTexId(_TexsPushedId, selectedTexIndex); color = getCol(_ColPushed, selectedTexIndex); diff --git a/code/ryzom/client/src/interface_v3/view_pointer.cpp b/code/ryzom/client/src/interface_v3/view_pointer.cpp index a78a4b47f..e1e18248d 100644 --- a/code/ryzom/client/src/interface_v3/view_pointer.cpp +++ b/code/ryzom/client/src/interface_v3/view_pointer.cpp @@ -42,8 +42,7 @@ NLMISC_REGISTER_OBJECT(CViewBase, CViewPointer, std::string, "pointer"); // -------------------------------------------------------------------------------------------------------------------- CViewPointer::CViewPointer (const TCtorParam ¶m) - : CViewPointerBase(param), - _Buttons(NLMISC::noButton) + : CViewPointerBase(param) { _TxIdDefault = -2; _TxIdMoveWindow = -2; diff --git a/code/ryzom/client/src/interface_v3/view_pointer.h b/code/ryzom/client/src/interface_v3/view_pointer.h index 274d07a56..8696ce245 100644 --- a/code/ryzom/client/src/interface_v3/view_pointer.h +++ b/code/ryzom/client/src/interface_v3/view_pointer.h @@ -63,11 +63,6 @@ public: } // TEMP PATCH - /// set button state - void setButtonState(NLMISC::TMouseButton state) { _Buttons = state; } - /// get buttons state - NLMISC::TMouseButton getButtonState() const { return _Buttons; } - private: /// Show or hide the pointer. Please, use SetMouseMode (bool freelook) instead. @@ -120,8 +115,6 @@ private: sint32 _OffsetX; sint32 _OffsetY; - NLMISC::TMouseButton _Buttons; - CGroupContainer *_LastHightLight; // Cursor mode