From 040eaad94c620e6389ace88936c375f8db2c3eb4 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 21 Jun 2012 21:28:13 +0200 Subject: [PATCH] CHANGED: #1471 CCtrlTextButton no longer depends on CGroupContainer. --HG-- branch : gui-refactoring --- code/nel/include/nel/gui/group_container_base.h | 6 +++++- .../src/interface_v3/ctrl_text_button.cpp | 17 +++-------------- .../client/src/interface_v3/ctrl_text_button.h | 1 - 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/code/nel/include/nel/gui/group_container_base.h b/code/nel/include/nel/gui/group_container_base.h index a4c2a0ba6..988050341 100644 --- a/code/nel/include/nel/gui/group_container_base.h +++ b/code/nel/include/nel/gui/group_container_base.h @@ -19,6 +19,7 @@ #define GROUP_CONTAINER_BASE_H #include "nel/gui/interface_group.h" +#include "nel/misc/rgba.h" namespace NLGUI { @@ -76,7 +77,10 @@ namespace NLGUI REFLECT_STRING("on_alpha_settings_changed_aparams", getAHOnAlphaSettingsChangedParams, setAHOnAlphaSettingsChangedParams); REFLECT_EXPORT_END - virtual bool isMoving() const{ return false; } + virtual bool isMoving() const{ return false; } + + // Get the header color draw. NB: depends if grayed, and if active. + virtual NLMISC::CRGBA getDrawnHeaderColor () const{ return NLMISC::CRGBA(); }; protected: void triggerAlphaSettingsChangedAH(); diff --git a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp index bdba8c1f0..fff7127f0 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_text_button.cpp @@ -14,23 +14,14 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - - - - -#include "stdpch.h" - #include "ctrl_text_button.h" -#include "interface_manager.h" #include "nel/misc/xml_auto_ptr.h" #include "nel/gui/view_text.h" #include "nel/gui/view_text_id.h" -#include "group_container.h" +#include "nel/gui/group_container_base.h" #include "nel/gui/lua_ihm.h" -#include "lua_ihm_ryzom.h" +#include "nel/gui/widget_manager.h" - -// *************************************************************************** using namespace std; using namespace NLMISC; using namespace NL3D; @@ -69,7 +60,6 @@ CCtrlTextButton::CCtrlTextButton(const TCtorParam ¶m) bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) { CXMLAutoPtr prop; - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance(); //try to get props that can be inherited from groups @@ -272,7 +262,6 @@ void CCtrlTextButton::draw () CViewRenderer::CTextureId *pTxId = NULL; CRGBA color; - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance(); CRGBA globalColor= CWidgetManager::getInstance()->getGlobalColorForContent(); @@ -392,7 +381,7 @@ void CCtrlTextButton::draw () CInterfaceGroup *pIG= getRootWindow(); if(pIG->isGroupContainer()) { - CGroupContainer *pGC= static_cast(pIG); + CGroupContainerBase *pGC = static_cast(pIG); viewTextColor= pGC->getDrawnHeaderColor(); } } diff --git a/code/ryzom/client/src/interface_v3/ctrl_text_button.h b/code/ryzom/client/src/interface_v3/ctrl_text_button.h index fd90e2d7e..677690e50 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_text_button.h +++ b/code/ryzom/client/src/interface_v3/ctrl_text_button.h @@ -28,7 +28,6 @@ namespace NLGUI class CEventDescriptor; class CViewText; } -class CInterfaceManager; // *************************************************************************** /**