CHANGED: #1471 CGroupTree no longer depends on CGroupContainer.
--HG-- branch : gui-refactoring
This commit is contained in:
parent
1d0a1e8f7f
commit
278ecff08b
2 changed files with 9 additions and 20 deletions
|
@ -85,6 +85,8 @@ namespace NLGUI
|
||||||
uint8 getCurrentContainerAlpha() const{ return _CurrentContainerAlpha; }
|
uint8 getCurrentContainerAlpha() const{ return _CurrentContainerAlpha; }
|
||||||
uint8 getCurrentContentAlpha() const{ return _CurrentContentAlpha; }
|
uint8 getCurrentContentAlpha() const{ return _CurrentContentAlpha; }
|
||||||
|
|
||||||
|
virtual bool isGrayed() const{ return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void triggerAlphaSettingsChangedAH();
|
void triggerAlphaSettingsChangedAH();
|
||||||
|
|
||||||
|
|
|
@ -16,22 +16,19 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "stdpch.h"
|
|
||||||
|
|
||||||
#include "group_tree.h"
|
#include "group_tree.h"
|
||||||
#include "interface_manager.h"
|
|
||||||
#include "nel/gui/interface_element.h"
|
#include "nel/gui/interface_element.h"
|
||||||
#include "nel/gui/view_bitmap.h"
|
#include "nel/gui/view_bitmap.h"
|
||||||
#include "nel/gui/view_text.h"
|
#include "nel/gui/view_text.h"
|
||||||
#include "group_container.h"
|
#include "nel/gui/group_container_base.h"
|
||||||
#include "nel/gui/action_handler.h"
|
#include "nel/gui/action_handler.h"
|
||||||
#include "nel/gui/lua_ihm.h"
|
#include "nel/gui/lua_ihm.h"
|
||||||
#include "lua_ihm_ryzom.h"
|
|
||||||
|
|
||||||
#include "nel/misc/i_xml.h"
|
#include "nel/misc/i_xml.h"
|
||||||
#include "nel/misc/i18n.h"
|
#include "nel/misc/i18n.h"
|
||||||
|
|
||||||
#include "nel/misc/xml_auto_ptr.h"
|
#include "nel/misc/xml_auto_ptr.h"
|
||||||
|
#include "nel/gui/widget_manager.h"
|
||||||
|
#include "nel/gui/view_renderer.h"
|
||||||
|
#include "nel/gui/view_pointer_base.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
|
@ -400,7 +397,6 @@ CGroupTree::~CGroupTree()
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool CGroupTree::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
bool CGroupTree::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
||||||
if (!CInterfaceGroup::parse(cur, parentGroup))
|
if (!CInterfaceGroup::parse(cur, parentGroup))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -521,7 +517,6 @@ void CGroupTree::updateCoords()
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void CGroupTree::drawSelection(sint x, sint y, sint w, CRGBA col)
|
void CGroupTree::drawSelection(sint x, sint y, sint w, CRGBA col)
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
||||||
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
||||||
|
|
||||||
if(!_RectangleOutlineMode)
|
if(!_RectangleOutlineMode)
|
||||||
|
@ -556,9 +551,6 @@ CGroupTree::SNode *CGroupTree::getNodeUnderMouse() const
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void CGroupTree::draw()
|
void CGroupTree::draw()
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
||||||
// CViewRenderer &rVR = *CViewRenderer::getInstance();
|
|
||||||
|
|
||||||
// get the clip area
|
// get the clip area
|
||||||
sint32 clipx, clipy, clipw, cliph;
|
sint32 clipx, clipy, clipw, cliph;
|
||||||
getClip(clipx, clipy, clipw, cliph);
|
getClip(clipx, clipy, clipw, cliph);
|
||||||
|
@ -622,13 +614,13 @@ void CGroupTree::draw()
|
||||||
{
|
{
|
||||||
// Find the first container
|
// Find the first container
|
||||||
CInterfaceGroup *pIG = _Parent;
|
CInterfaceGroup *pIG = _Parent;
|
||||||
CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(pIG);
|
CGroupContainerBase *pGC = dynamic_cast<CGroupContainerBase*>(pIG);
|
||||||
while (pIG != NULL)
|
while (pIG != NULL)
|
||||||
{
|
{
|
||||||
pIG = pIG->getParent();
|
pIG = pIG->getParent();
|
||||||
if (pIG == NULL) break;
|
if (pIG == NULL) break;
|
||||||
if (dynamic_cast<CGroupContainer*>(pIG) != NULL)
|
if (dynamic_cast<CGroupContainerBase*>(pIG) != NULL)
|
||||||
pGC = dynamic_cast<CGroupContainer*>(pIG);
|
pGC = dynamic_cast<CGroupContainerBase*>(pIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
// avoid if window grayed
|
// avoid if window grayed
|
||||||
|
@ -717,7 +709,6 @@ void CGroupTree::selectLine(uint line, bool runAH /*= true*/)
|
||||||
if(line>=_Lines.size())
|
if(line>=_Lines.size())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
||||||
if (!_Lines[line].Node)
|
if (!_Lines[line].Node)
|
||||||
{
|
{
|
||||||
// just deleted : must wait next draw to know the new line under mouse
|
// just deleted : must wait next draw to know the new line under mouse
|
||||||
|
@ -754,7 +745,6 @@ bool CGroupTree::rightButton(uint line)
|
||||||
|
|
||||||
if (line != (uint) _SelectedLine) selectLine(line, false);
|
if (line != (uint) _SelectedLine) selectLine(line, false);
|
||||||
|
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
||||||
CAHManager::getInstance()->runActionHandler ( _Lines[line].Node->AHNameRight,
|
CAHManager::getInstance()->runActionHandler ( _Lines[line].Node->AHNameRight,
|
||||||
this,
|
this,
|
||||||
_Lines[line].Node->AHParamsRight );
|
_Lines[line].Node->AHParamsRight );
|
||||||
|
@ -862,7 +852,6 @@ bool CGroupTree::handleEvent (const NLGUI::CEventDescriptor& event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
||||||
CAHManager::getInstance()->runActionHandler(changedNode->AHNameClose, this, changedNode->AHParamsClose);
|
CAHManager::getInstance()->runActionHandler(changedNode->AHNameClose, this, changedNode->AHParamsClose);
|
||||||
}
|
}
|
||||||
forceRebuild();
|
forceRebuild();
|
||||||
|
@ -1276,7 +1265,6 @@ CGroupTree::SNode *CGroupTree::selectNodeByIdRecurse(SNode *pNode, const std::s
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
bool CGroupTree::selectNodeById(const std::string &nodeId, bool triggerAH)
|
bool CGroupTree::selectNodeById(const std::string &nodeId, bool triggerAH)
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
|
||||||
SNode *selNode= NULL;
|
SNode *selNode= NULL;
|
||||||
|
|
||||||
// Avoid infinite recurs
|
// Avoid infinite recurs
|
||||||
|
@ -1330,7 +1318,6 @@ class CHandlerTreeReset : public IActionHandler
|
||||||
public:
|
public:
|
||||||
void execute (CCtrlBase * /* pCaller */, const std::string &sParams)
|
void execute (CCtrlBase * /* pCaller */, const std::string &sParams)
|
||||||
{
|
{
|
||||||
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
||||||
CGroupTree *pTree = dynamic_cast<CGroupTree*>(CWidgetManager::getInstance()->getElementFromId(sParams));
|
CGroupTree *pTree = dynamic_cast<CGroupTree*>(CWidgetManager::getInstance()->getElementFromId(sParams));
|
||||||
if (pTree != NULL)
|
if (pTree != NULL)
|
||||||
pTree->reset();
|
pTree->reset();
|
||||||
|
|
Loading…
Reference in a new issue