CHANGED: #1471 decoupled CViewText from CGroupContainer and CCtrlResizer.

This commit is contained in:
dfighter1985 2012-06-16 23:03:29 +02:00
parent f8df1159ff
commit 396abe14cf
4 changed files with 10 additions and 5 deletions

View file

@ -50,6 +50,7 @@ namespace NLGUI
// see interface.txt for meaning of auto // see interface.txt for meaning of auto
_ToolTipParentPosRef= Hotspot_TTAuto; _ToolTipParentPosRef= Hotspot_TTAuto;
_ToolTipPosRef= Hotspot_TTAuto; _ToolTipPosRef= Hotspot_TTAuto;
resizer = false;
} }
/// Destructor /// Destructor
@ -125,6 +126,8 @@ namespace NLGUI
// true if this ctrl is capturable (true by default, false for tooltip) // true if this ctrl is capturable (true by default, false for tooltip)
virtual bool isCapturable() const {return true;} virtual bool isCapturable() const {return true;}
bool isResizer() const{ return resizer; }
// from CInterfaceElement // from CInterfaceElement
virtual void visit(CInterfaceElementVisitor *visitor); virtual void visit(CInterfaceElementVisitor *visitor);
@ -158,6 +161,7 @@ namespace NLGUI
THotSpot _ToolTipPosRefAlt : 6; THotSpot _ToolTipPosRefAlt : 6;
protected: protected:
void convertTooltipHotSpot(const char *prop, THotSpot &parentHS, THotSpot &childHS); void convertTooltipHotSpot(const char *prop, THotSpot &parentHS, THotSpot &childHS);
bool resizer;
}; };
} }

View file

@ -76,6 +76,8 @@ namespace NLGUI
REFLECT_STRING("on_alpha_settings_changed_aparams", getAHOnAlphaSettingsChangedParams, setAHOnAlphaSettingsChangedParams); REFLECT_STRING("on_alpha_settings_changed_aparams", getAHOnAlphaSettingsChangedParams, setAHOnAlphaSettingsChangedParams);
REFLECT_EXPORT_END REFLECT_EXPORT_END
virtual bool isMoving() const{ return false; }
protected: protected:
void triggerAlphaSettingsChangedAH(); void triggerAlphaSettingsChangedAH();

View file

@ -107,6 +107,7 @@ CCtrlResizer::CCtrlResizer(const TCtorParam &param)
_MouseDown = false; _MouseDown = false;
_XBias = 0; _XBias = 0;
_YBias = 0; _YBias = 0;
resizer = true;
} }

View file

@ -21,9 +21,8 @@
#include "interface_manager.h" #include "interface_manager.h"
#include "nel/gui/view_renderer.h" #include "nel/gui/view_renderer.h"
#include "nel/gui/widget_manager.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/gui/ctrl_tooltip.h"
#include "nel/misc/xml_auto_ptr.h" #include "nel/misc/xml_auto_ptr.h"
#include "nel/gui/lua_ihm.h" #include "nel/gui/lua_ihm.h"
@ -381,8 +380,7 @@ void CViewText::checkCoords ()
CCtrlBase *pCB = CWidgetManager::getInstance()->getCapturePointerLeft(); CCtrlBase *pCB = CWidgetManager::getInstance()->getCapturePointerLeft();
if (pCB != NULL) if (pCB != NULL)
{ {
CCtrlResizer *pCR = dynamic_cast<CCtrlResizer*>(pCB); if( pCB->isResizer() )
if (pCR != NULL)
{ {
// We are resizing !!!! // We are resizing !!!!
} }
@ -644,7 +642,7 @@ void CViewText::draw ()
if(bFound) if(bFound)
{ {
// last check: the window must not be currently moved // last check: the window must not be currently moved
CGroupContainer *gc= dynamic_cast<CGroupContainer*>(pIG); CGroupContainerBase *gc= dynamic_cast<CGroupContainerBase*>(pIG);
if(!gc || !gc->isMoving()) if(!gc || !gc->isMoving())
{ {
CRGBA col= pIM->getSystemOption(CInterfaceManager::OptionViewTextOverBackColor).getValColor(); CRGBA col= pIM->getSystemOption(CInterfaceManager::OptionViewTextOverBackColor).getValColor();