Commit f8655a2d authored by cutealien's avatar cutealien

Send EGET_ELEMENT_CLOSED event when context menues should be closed (thx @ Mloren for reporting).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3550 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 4d7a3a3a
Changes in 1.8 (??.??.2011) Changes in 1.8 (??.??.2011)
- Send EGET_ELEMENT_CLOSED event when context menues should be closed (thx @ Mloren for reporting).
- Added treeview to GUI editor, provided by Armen - Added treeview to GUI editor, provided by Armen
- Added root type for GUI environment - Added root type for GUI environment
......
...@@ -288,8 +288,16 @@ bool CGUIContextMenu::OnEvent(const SEvent& event) ...@@ -288,8 +288,16 @@ bool CGUIContextMenu::OnEvent(const SEvent& event)
if (event.GUIEvent.Caller == this && !isMyChild(event.GUIEvent.Element) && AllowFocus) if (event.GUIEvent.Caller == this && !isMyChild(event.GUIEvent.Element) && AllowFocus)
{ {
// set event parent of submenus // set event parent of submenus
setEventParent(EventParent ? EventParent : Parent); IGUIElement * p = EventParent ? EventParent : Parent;
setEventParent(p);
SEvent event;
event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = EGET_ELEMENT_CLOSED;
if ( !p->OnEvent(event) )
{
if ( CloseHandling & ECMC_HIDE ) if ( CloseHandling & ECMC_HIDE )
{ {
setVisible(false); setVisible(false);
...@@ -298,6 +306,7 @@ bool CGUIContextMenu::OnEvent(const SEvent& event) ...@@ -298,6 +306,7 @@ bool CGUIContextMenu::OnEvent(const SEvent& event)
{ {
remove(); remove();
} }
}
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment