From 48d50cb4091f84342b021de7a1889c285bddfa9c Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 2 Mar 2013 23:27:17 +0100 Subject: [PATCH] MODIFIED: Text buttons will now delete their text too when being deleted. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/ctrl_text_button.h | 1 + code/nel/src/gui/ctrl_text_button.cpp | 10 ++++++++++ code/nel/src/gui/interface_group.cpp | 6 +++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/nel/include/nel/gui/ctrl_text_button.h b/code/nel/include/nel/gui/ctrl_text_button.h index 2df1dee5d..5837a0fbf 100644 --- a/code/nel/include/nel/gui/ctrl_text_button.h +++ b/code/nel/include/nel/gui/ctrl_text_button.h @@ -42,6 +42,7 @@ namespace NLGUI /// Constructor CCtrlTextButton(const TCtorParam ¶m); + ~CCtrlTextButton(); std::string getProperty( const std::string &name ) const; void setProperty( const std::string &name, const std::string &value ); diff --git a/code/nel/src/gui/ctrl_text_button.cpp b/code/nel/src/gui/ctrl_text_button.cpp index fd118cfcb..332358b15 100644 --- a/code/nel/src/gui/ctrl_text_button.cpp +++ b/code/nel/src/gui/ctrl_text_button.cpp @@ -60,6 +60,16 @@ namespace NLGUI _ForceTextOver = false; } + CCtrlTextButton::~CCtrlTextButton() + { + if( _ViewText != NULL ) + { + if( getParent() != NULL ) + getParent()->delElement( _ViewText ); + _ViewText = NULL; + } + } + std::string CCtrlTextButton::getProperty( const std::string &name ) const { std::string prop; diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index c4ba1e950..bb643769a 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -141,12 +141,12 @@ namespace NLGUI // initStart = ryzomGetLocalTime (); clearGroups(); // nlinfo ("%d seconds for clearGroups '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str()); - // initStart = ryzomGetLocalTime (); - clearViews(); - // nlinfo ("%d seconds for clearViews '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str()); // initStart = ryzomGetLocalTime (); clearControls(); // nlinfo ("%d seconds for clearControls '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str()); + // initStart = ryzomGetLocalTime (); + clearViews(); + // nlinfo ("%d seconds for clearViews '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str()); CWidgetManager::getInstance()->removeRefOnGroup (this); #ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS