CHANGED: #1471 decoupled CViewText from CGroupContainer and CCtrlResizer.

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

View file

@ -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;
};
}

View file

@ -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();

View file

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

View file

@ -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<CCtrlResizer*>(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<CGroupContainer*>(pIG);
CGroupContainerBase *gc= dynamic_cast<CGroupContainerBase*>(pIG);
if(!gc || !gc->isMoving())
{
CRGBA col= pIM->getSystemOption(CInterfaceManager::OptionViewTextOverBackColor).getValColor();