Revert the part of last check-in where I tried to remove focus when EGET_ELEMENT_REMOVED was called on a focused element.

Found a crash for that. Might give it another try some day, but giving up for now.
EGET_ELEMENT_REMOVED can stay - still should be useful (users can find out when elements got removed).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5560 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-11-01 21:13:14 +00:00
parent e2ca877234
commit a4c3a251f1
2 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,6 @@
--------------------------
Changes in 1.9 (not yet released)
- Add gui event EGET_ELEMENT_REMOVED. Remove active focus now from elements which got removed from the gui graph.
- Add gui event EGET_ELEMENT_REMOVED.
- Fix: IGUIContextMenu now raises sub-menu when they would otherwise be displayed below bottom-border of root gui element.
- Prevent initializing/quitting SDL several times when using more than one Irrlicht device.
- Reduce log-messages for "loaded texture" and "loaded mesh" from ELL_INFORMATION to ELL_DEBUG.

View File

@ -567,11 +567,9 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
if ( event.EventType == EET_GUI_EVENT
&& event.GUIEvent.EventType == EGET_ELEMENT_REMOVED )
{
if ( event.GUIEvent.Caller == Focus )
setFocus(0);
// TODO: In theory we could also check hovered and ToolTip.Element here.
// But not trivial (aka - test *a lot* when you try to change) and not so important.
// TODO: In theory we could also check Focus, Hovered and ToolTip.Element here.
// But not trivial (aka - test *a lot* when you try to change, especially GUI editor).
// Focus might still be the easiest to get working (and most important, it was one of the reasons I added EGET_ELEMENT_REMOVED ...)
if ( UserReceiver )
UserReceiver->OnEvent(event);