From 396abe14cf7a3e6abec24fc3d48bc728e5d185ea Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 16 Jun 2012 23:03:29 +0200 Subject: [PATCH] CHANGED: #1471 decoupled CViewText from CGroupContainer and CCtrlResizer. --- code/nel/include/nel/gui/ctrl_base.h | 4 ++++ code/nel/include/nel/gui/group_container_base.h | 2 ++ code/ryzom/client/src/interface_v3/group_container.cpp | 1 + code/ryzom/client/src/interface_v3/view_text.cpp | 8 +++----- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/code/nel/include/nel/gui/ctrl_base.h b/code/nel/include/nel/gui/ctrl_base.h index b22148b88..18c5c6535 100644 --- a/code/nel/include/nel/gui/ctrl_base.h +++ b/code/nel/include/nel/gui/ctrl_base.h @@ -50,6 +50,7 @@ namespace NLGUI // see interface.txt for meaning of auto _ToolTipParentPosRef= Hotspot_TTAuto; _ToolTipPosRef= Hotspot_TTAuto; + resizer = false; } /// Destructor @@ -125,6 +126,8 @@ namespace NLGUI // true if this ctrl is capturable (true by default, false for tooltip) virtual bool isCapturable() const {return true;} + bool isResizer() const{ return resizer; } + // from CInterfaceElement virtual void visit(CInterfaceElementVisitor *visitor); @@ -158,6 +161,7 @@ namespace NLGUI THotSpot _ToolTipPosRefAlt : 6; protected: void convertTooltipHotSpot(const char *prop, THotSpot &parentHS, THotSpot &childHS); + bool resizer; }; } diff --git a/code/nel/include/nel/gui/group_container_base.h b/code/nel/include/nel/gui/group_container_base.h index 9122f1027..a4c2a0ba6 100644 --- a/code/nel/include/nel/gui/group_container_base.h +++ b/code/nel/include/nel/gui/group_container_base.h @@ -76,6 +76,8 @@ namespace NLGUI REFLECT_STRING("on_alpha_settings_changed_aparams", getAHOnAlphaSettingsChangedParams, setAHOnAlphaSettingsChangedParams); REFLECT_EXPORT_END + virtual bool isMoving() const{ return false; } + protected: void triggerAlphaSettingsChangedAH(); diff --git a/code/ryzom/client/src/interface_v3/group_container.cpp b/code/ryzom/client/src/interface_v3/group_container.cpp index e4b80a016..ee6379722 100644 --- a/code/ryzom/client/src/interface_v3/group_container.cpp +++ b/code/ryzom/client/src/interface_v3/group_container.cpp @@ -107,6 +107,7 @@ CCtrlResizer::CCtrlResizer(const TCtorParam ¶m) _MouseDown = false; _XBias = 0; _YBias = 0; + resizer = true; } diff --git a/code/ryzom/client/src/interface_v3/view_text.cpp b/code/ryzom/client/src/interface_v3/view_text.cpp index b58ca9eaa..19812d86b 100644 --- a/code/ryzom/client/src/interface_v3/view_text.cpp +++ b/code/ryzom/client/src/interface_v3/view_text.cpp @@ -21,9 +21,8 @@ #include "interface_manager.h" #include "nel/gui/view_renderer.h" #include "nel/gui/widget_manager.h" -#include "group_container.h" // CCtrlResizer +#include "nel/gui/group_container_base.h" #include "nel/gui/ctrl_tooltip.h" - #include "nel/misc/xml_auto_ptr.h" #include "nel/gui/lua_ihm.h" @@ -381,8 +380,7 @@ void CViewText::checkCoords () CCtrlBase *pCB = CWidgetManager::getInstance()->getCapturePointerLeft(); if (pCB != NULL) { - CCtrlResizer *pCR = dynamic_cast(pCB); - if (pCR != NULL) + if( pCB->isResizer() ) { // We are resizing !!!! } @@ -644,7 +642,7 @@ void CViewText::draw () if(bFound) { // last check: the window must not be currently moved - CGroupContainer *gc= dynamic_cast(pIG); + CGroupContainerBase *gc= dynamic_cast(pIG); if(!gc || !gc->isMoving()) { CRGBA col= pIM->getSystemOption(CInterfaceManager::OptionViewTextOverBackColor).getValColor();