diff --git a/source/gui/IGUIButtonBehavior.h b/source/gui/IGUIButtonBehavior.h index be6122890e..09152bc31b 100644 --- a/source/gui/IGUIButtonBehavior.h +++ b/source/gui/IGUIButtonBehavior.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2012 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -112,7 +112,8 @@ protected: */ virtual void ResetStates() { - m_MouseHovering = false; + // Notify the gui that we aren't hovered anymore + UpdateMouseOver(NULL); m_Pressed = false; } diff --git a/source/gui/IGUIObject.cpp b/source/gui/IGUIObject.cpp index 12bee11dc5..70bcd965db 100644 --- a/source/gui/IGUIObject.cpp +++ b/source/gui/IGUIObject.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2012 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -427,36 +427,6 @@ float IGUIObject::GetBufferedZ() const } } -// TODO Gee: keep this function and all??? -void IGUIObject::CheckSettingsValidity() -{ - bool hidden; - GUI::GetSetting(this, "hidden", hidden); - - // If we hide an object, reset many of its parts - if (hidden) - { - // Simulate that no object is hovered for this object and all its children - // why? because it's - try - { - GUI::RecurseObject(0, this, &IGUIObject::UpdateMouseOver, NULL); - } - catch (PSERROR_GUI&) - { - } - } - - try - { - // Send message to itself - SendEvent(GUIM_SETTINGS_UPDATED, "update"); - } - catch (PSERROR_GUI&) - { - } -} - void IGUIObject::RegisterScriptHandler(const CStr& Action, const CStr& Code, CGUI* pGUI) { const int paramCount = 1; diff --git a/source/gui/IGUIObject.h b/source/gui/IGUIObject.h index de5e60dc91..b02027bd9c 100644 --- a/source/gui/IGUIObject.h +++ b/source/gui/IGUIObject.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2012 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -248,20 +248,6 @@ public: */ virtual void UpdateCachedSize(); - /** - * Should be called every time the settings has been updated - * will also send a message GUIM_SETTINGS_UPDATED, so that - * if a derived object wants to add things to be updated, - * they add it in that message part, this is a better solution - * than making this virtual, since the updates that the base - * class does, are the most essential. - * This is not private since there should be no harm in - * checking validity. - * - * @throws TODO not quite settled yet. - */ - void CheckSettingsValidity(); - /** * Set a setting by string, regardless of what type it is. * @@ -394,7 +380,8 @@ protected: */ virtual void ResetStates() { - m_MouseHovering = false; + // Notify the gui that we aren't hovered anymore + UpdateMouseOver(NULL); } public: @@ -475,6 +462,16 @@ protected: void SetScriptHandler(const CStr& Action, JSObject* Function); + /** + * Inputes the object that is currently hovered, this function + * updates this object accordingly (i.e. if it's the object + * being inputted one thing happens, and not, another). + * + * @param pMouseOver Object that is currently hovered, + * can OF COURSE be NULL too! + */ + void UpdateMouseOver(IGUIObject * const &pMouseOver); + //@} private: //-------------------------------------------------------- @@ -496,16 +493,6 @@ private: */ void ChooseMouseOverAndClosest(IGUIObject* &pObject); - /** - * Inputes the object that is currently hovered, this function - * updates this object accordingly (i.e. if it's the object - * being inputted one thing happens, and not, another). - * - * @param pMouseOver Object that is currently hovered, - * can OF COURSE be NULL too! - */ - void UpdateMouseOver(IGUIObject * const &pMouseOver); - // Is the object a Root object, in philosophy, this means it // has got no parent, and technically, it's got the m_BaseObject // as parent.