CHANGED: #1471 CInterfaceGroup no longer depends on CGroupContainer.

This commit is contained in:
dfighter1985 2012-06-06 05:48:51 +02:00
parent 60c5ad2bfd
commit 2488cf5c15
7 changed files with 19 additions and 14 deletions

View file

@ -1319,7 +1319,8 @@ public:
}
// Clear input string
pEB->setInputString (ucstring(""));
CGroupContainer *gc = pEB->getEnclosingContainer();
CGroupContainer *gc = static_cast< CGroupContainer* >( pEB->getEnclosingContainer() );
if (gc)
{
// Restore position of enclosing container if it hasn't been moved/scaled/poped by the user

View file

@ -1071,7 +1071,8 @@ void CGroupEditBox::updateCoords()
if (_BackupFatherContainerPos)
{
CGroupContainer *gc = getEnclosingContainer();
CGroupContainer *gc = static_cast< CGroupContainer* >( getEnclosingContainer() );
if (gc && !gc->getTouchFlag(true))
{

View file

@ -858,7 +858,8 @@ void CGroupMap::updateCoords()
{
updateSelectionAxisSize();
//
CGroupContainer *enclosingContainer = getEnclosingContainer();
CGroupContainer *enclosingContainer = static_cast< CGroupContainer* >( getEnclosingContainer() );
if (!enclosingContainer || !enclosingContainer->getActive()) return;
// update position of landmarks
updateScale();

View file

@ -22,9 +22,9 @@
#include "interface_group.h"
#include "interface_link.h"
#include "ctrl_scroll.h"
#include "widget_manager.h"
#include "group_container.h"
#include "ctrl_scroll.h"
#include "group_editbox.h"
#include "group_scrolltext.h"
#include "lua_ihm_ryzom.h"
@ -1539,15 +1539,17 @@ void CInterfaceGroup::setRightClickHandler(const std::string &handler)
}
// ------------------------------------------------------------------------------------------------
CGroupContainer *CInterfaceGroup::getEnclosingContainer()
CInterfaceGroup* CInterfaceGroup::getEnclosingContainer()
{
CInterfaceGroup *ig = this;
do
{
if (ig->isGroupContainer()) return static_cast<CGroupContainer *>(ig);
if( ig->isGroupContainer() )
return ig;
ig = ig->getParent();
}
while(ig);
while( ig != NULL );
return NULL;
}

View file

@ -22,8 +22,6 @@
#include "ctrl_base.h"
#include "action_handler.h"
class CGroupContainer;
// ----------------------------------------------------------------------------
class CInterfaceGroup : public CCtrlBase
{
@ -251,7 +249,7 @@ public:
// quick way to know if the group is a CGroupContainer
bool isGroupContainer() const { return _IsGroupContainer; }
CGroupContainer *getEnclosingContainer();
CInterfaceGroup* getEnclosingContainer();
sint getInsertionOrder(CViewBase *vb) const;

View file

@ -2189,7 +2189,8 @@ class CHandlerTellContact : public IActionHandler
if (!pCaller) return;
CInterfaceGroup *ig = pCaller->getParent();
if (!ig) return;
CGroupContainer *gc = ig->getEnclosingContainer();
CGroupContainer *gc = static_cast< CGroupContainer* >( ig->getEnclosingContainer() );
if (!gc) return;
CPeopleList *list;
uint peopleIndex;

View file

@ -572,7 +572,7 @@ void CPeopleList::reset()
removeAllPeoples();
_BaseContainer->setContent(NULL);
CGroupContainer *father = dynamic_cast<CGroupContainer *>(_BaseContainer->getParent()->getEnclosingContainer());
CGroupContainer *father = static_cast<CGroupContainer *>(_BaseContainer->getParent()->getEnclosingContainer());
if (father)
{
father->delGroup(_BaseContainer);
@ -894,7 +894,8 @@ class CHandlerContactEntry : public IActionHandler
// Well, we could have used CChatWindow class to handle this, but CPeopleList was written earlier, so for now
// it is simpler to keep it as it and to just use this action handler to manage user input.
if (!pCaller || !pCaller->getParent()) return;
CGroupContainer *gc = pCaller->getParent()->getEnclosingContainer();
CGroupContainer *gc = static_cast< CGroupContainer* >( pCaller->getParent()->getEnclosingContainer() );
// title gives the name of the player
ucstring playerName = gc->getUCTitle();