Merge remote-tracking branch 'origin/stevef/menus'

This commit is contained in:
Vincent Sanders 2014-01-29 09:57:46 +00:00
commit 829b4fd454
4 changed files with 26 additions and 2 deletions

View File

@ -1315,7 +1315,8 @@ void ro_gui_user_message(wimp_event_no event, wimp_message *message)
break;
case message_MENUS_DELETED:
ro_gui_menu_closed();
ro_gui_menu_message_deleted((wimp_message_menus_deleted *)
&message->data);
break;
case message_CLAIM_ENTITY:

View File

@ -118,6 +118,7 @@ wimp_menu *image_quality_menu, *proxy_type_menu, *languages_menu;
/**
* Create menu structures.
*/
void ro_gui_menu_init(void)
{
/* image quality menu */
@ -439,6 +440,28 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning)
}
}
/**
* Handle Message_MenusDeleted, removing our current record of an open menu
* if it matches the deleted menu handle.
*
* \param *deleted The message block.
*/
void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted)
{
if (deleted != NULL && deleted->menu == current_menu) {
ro_gui_wimp_event_menus_closed(current_menu_window,
current_menu_icon, current_menu);
current_menu = NULL;
current_menu_window = NULL;
current_menu_icon = 0;
current_menu_open = false;
}
}
/**
* Update the current menu by sending it a Menu Prepare event through wimp_event
* and then reopening it if the contents has changed.

View File

@ -173,6 +173,7 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i);
void ro_gui_menu_window_changed(wimp_w from, wimp_w to);
void ro_gui_menu_selection(wimp_selection* selection);
void ro_gui_menu_warning(wimp_message_menu_warning *warning);
void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted);
void ro_gui_menu_refresh(wimp_menu *menu);
void ro_gui_menu_init_structure(wimp_menu *menu, int entries);
const char *ro_gui_menu_find_menu_entry_key(wimp_menu *menu,

View File

@ -720,7 +720,6 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer)
ro_gui_dialog_add_persistent(current_menu_window,
pointer->w);
ro_gui_menu_closed();
gui_poll(true);
error = xwimp_open_window(PTR_WIMP_OPEN(&open));
if (error) {
LOG(("xwimp_open_window: 0x%x: %s",