From d5f9b0874ed1c20b06accef1355b53dde1e75fc6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Sep 2010 10:22:38 +0000 Subject: [PATCH] - fixed: Lines in the option menu that covered the same vertical space as the back button rendered the back button inoperable. SVN r2779 (trunk) --- src/menu/menu.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index cb557512fd..f74ac47949 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -104,12 +104,16 @@ DMenu::DMenu(DMenu *parent) bool DMenu::Responder (event_t *ev) { + bool res = false; if (ev->type == EV_GUI_Event) { if (ev->subtype == EV_GUI_LButtonDown) { - MouseEventBack(MOUSE_Click, ev->data1, ev->data2); - if (MouseEvent(MOUSE_Click, ev->data1, ev->data2)) + res = MouseEventBack(MOUSE_Click, ev->data1, ev->data2); + // make the menu's mouse handler believe that the current coordinate is outside the valid range + if (res) ev->data2 = -1; + res |= MouseEvent(MOUSE_Click, ev->data1, ev->data2); + if (res) { SetCapture(); } @@ -120,8 +124,9 @@ bool DMenu::Responder (event_t *ev) BackbuttonTime = BACKBUTTON_TIME; if (mMouseCapture || m_use_mouse == 1) { - MouseEventBack(MOUSE_Move, ev->data1, ev->data2); - return MouseEvent(MOUSE_Move, ev->data1, ev->data2); + res = MouseEventBack(MOUSE_Move, ev->data1, ev->data2); + if (res) ev->data2 = -1; + res |= MouseEvent(MOUSE_Move, ev->data1, ev->data2); } } else if (ev->subtype == EV_GUI_LButtonUp) @@ -129,8 +134,9 @@ bool DMenu::Responder (event_t *ev) if (mMouseCapture) { ReleaseCapture(); - MouseEventBack(MOUSE_Release, ev->data1, ev->data2); - return MouseEvent(MOUSE_Release, ev->data1, ev->data2); + res = MouseEventBack(MOUSE_Release, ev->data1, ev->data2); + if (res) ev->data2 = -1; + res |= MouseEvent(MOUSE_Release, ev->data1, ev->data2); } } } @@ -211,7 +217,7 @@ bool DMenu::MouseEventBack(int type, int x, int y) if (m_use_mouse == 2) mBackbuttonSelected = false; MenuEvent(MKEY_Back, true); } - return true; + return mBackbuttonSelected; } } return false;