CHANGED: #1471 CInterfaceGroup no longer depends on CGroupContainer.

This commit is contained in:
dfighter1985 2012-06-06 05:48:51 +02:00
parent 8f562baf72
commit 6c9bd4d159
7 changed files with 19 additions and 14 deletions

View file

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

View file

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

View file

@ -22,9 +22,9 @@
#include "interface_group.h" #include "interface_group.h"
#include "interface_link.h" #include "interface_link.h"
#include "ctrl_scroll.h"
#include "widget_manager.h" #include "widget_manager.h"
#include "group_container.h"
#include "ctrl_scroll.h"
#include "group_editbox.h" #include "group_editbox.h"
#include "group_scrolltext.h" #include "group_scrolltext.h"
#include "lua_ihm_ryzom.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; CInterfaceGroup *ig = this;
do do
{ {
if (ig->isGroupContainer()) return static_cast<CGroupContainer *>(ig); if( ig->isGroupContainer() )
return ig;
ig = ig->getParent(); ig = ig->getParent();
} }
while(ig); while( ig != NULL );
return NULL; return NULL;
} }

View file

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

View file

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

View file

@ -572,7 +572,7 @@ void CPeopleList::reset()
removeAllPeoples(); removeAllPeoples();
_BaseContainer->setContent(NULL); _BaseContainer->setContent(NULL);
CGroupContainer *father = dynamic_cast<CGroupContainer *>(_BaseContainer->getParent()->getEnclosingContainer()); CGroupContainer *father = static_cast<CGroupContainer *>(_BaseContainer->getParent()->getEnclosingContainer());
if (father) if (father)
{ {
father->delGroup(_BaseContainer); 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 // 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. // it is simpler to keep it as it and to just use this action handler to manage user input.
if (!pCaller || !pCaller->getParent()) return; 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 // title gives the name of the player
ucstring playerName = gc->getUCTitle(); ucstring playerName = gc->getUCTitle();