MODIFIED: Text buttons will now delete their text too when being deleted.

--HG--
branch : gsoc2012-gui-editor
This commit is contained in:
dfighter1985 2013-03-02 23:27:17 +01:00
parent 026ccfcd13
commit 48d50cb409
3 changed files with 14 additions and 3 deletions

View file

@ -42,6 +42,7 @@ namespace NLGUI
/// Constructor /// Constructor
CCtrlTextButton(const TCtorParam &param); CCtrlTextButton(const TCtorParam &param);
~CCtrlTextButton();
std::string getProperty( const std::string &name ) const; std::string getProperty( const std::string &name ) const;
void setProperty( const std::string &name, const std::string &value ); void setProperty( const std::string &name, const std::string &value );

View file

@ -60,6 +60,16 @@ namespace NLGUI
_ForceTextOver = false; _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 CCtrlTextButton::getProperty( const std::string &name ) const
{ {
std::string prop; std::string prop;

View file

@ -141,12 +141,12 @@ namespace NLGUI
// initStart = ryzomGetLocalTime (); // initStart = ryzomGetLocalTime ();
clearGroups(); clearGroups();
// nlinfo ("%d seconds for clearGroups '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str()); // 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 (); // initStart = ryzomGetLocalTime ();
clearControls(); clearControls();
// nlinfo ("%d seconds for clearControls '%s'", (uint32)(ryzomGetLocalTime ()-initStart)/1000, _Id.c_str()); // 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); CWidgetManager::getInstance()->removeRefOnGroup (this);
#ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS #ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS