path: root/com32
diff options
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-09-07 15:03:28 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-09-07 15:03:28 -0700
commit66868cb27d32f490ae3682562ddc72a09e4c8aa1 (patch)
treeb854a719abeac997faf1ee813f9c9fa2f44b74ae /com32
parent8e7362ec8fcd84b5c1c95580663bcaf210c3b4ed (diff)
cmenu: redraw the current menu after exiting the keys_handler
After exiting the keys_handler, reset_ui() is not enough since it only resets the status line and title. The current menu needs to be redrawn. Note: only a submenu will be redrawn, not its parents. This means that not all the UI will be displayed after exiting the handler if invoked from whithin a submenu. We have already this problem nowadays when exiting a submenu of a submenu. The root parent is not redrawn, leading to some ugly states (the background color overrides part of the root menu). This will be fixed when we implement a real hierarchy (each submenu having access to its parents). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32')
1 files changed, 6 insertions, 0 deletions
diff --git a/com32/cmenu/libmenu/menu.c b/com32/cmenu/libmenu/menu.c
index dea19750..5a33a527 100644
--- a/com32/cmenu/libmenu/menu.c
+++ b/com32/cmenu/libmenu/menu.c
@@ -487,6 +487,12 @@ static pt_menuitem getmenuoption(pt_menu menu, uchar top, uchar left, uchar star
/* The handler may have changed the UI, reset it on exit */
+ // Cleanup menu using old number of items
+ cleanupmenu(menu, top, left, numitems);
+ // Recalculate the number of items
+ numitems = calc_visible(menu, 0);
+ // Reprint the menu
+ printmenu(menu, curr, top, left, first, radio);