try storing form_control in the hook data

it doesn't appear to be needed anywhere else
This commit is contained in:
Chris Young 2019-05-08 18:12:22 +01:00
parent 19742c826a
commit 944d8fc412
3 changed files with 3 additions and 28 deletions

View File

@ -302,7 +302,6 @@ struct gui_window
struct MinList *deferred_rects;
struct browser_window *bw;
float scale;
struct form_control *control;
};
struct ami_gui_tb_userdata {
@ -563,18 +562,6 @@ struct ami_menu_data **ami_gui2_get_menu_data(struct gui_window_2 *gwin)
return gwin->menu_data;
}
struct form_control *ami_gui_get_control(struct gui_window *gw)
{
assert(gw != NULL);
return gw->control;
}
void ami_gui_set_control(struct gui_window *gw, struct form_control *control)
{
assert(gw != NULL);
gw->control = control;
}
void ami_gui2_set_ctxmenu_history_tmp(struct gui_window_2 *gwin, int temp)
{
assert(gwin != NULL);

View File

@ -303,16 +303,6 @@ void ami_gui2_set_menu(struct gui_window_2 *gwin, struct Menu *menu);
*/
struct ami_menu_data **ami_gui2_get_menu_data(struct gui_window_2 *gwin);
/**
* Get control (for select menu) from gui_window
*/
struct form_control *ami_gui_get_control(struct gui_window *gw);
/**
* Set control (for select menu) to gui_window
*/
void ami_gui_set_control(struct gui_window *gw, struct form_control *control);
/**
* Set ctxmenu history tmp in gui_window_2
*/

View File

@ -71,10 +71,10 @@ BOOL ami_selectmenu_is_safe(void)
HOOKF(uint32, ami_popup_hook, Object *, item, APTR)
{
uint32 itemid = 0;
struct gui_window *gwin = hook->h_Data;
struct form_control *control = hook->h_Data;
if(GetAttr(PMIA_ID, item, &itemid)) {
form_select_process_selection(ami_gui_get_control(gwin), itemid);
form_select_process_selection(control, itemid);
}
return itemid;
@ -109,9 +109,7 @@ void gui_create_form_select_menu(struct gui_window *g,
selectmenuhook.h_Entry = ami_popup_hook;
selectmenuhook.h_SubEntry = NULL;
selectmenuhook.h_Data = g;
ami_gui_set_control(g, control);
selectmenuhook.h_Data = control;
selectmenuobj = PMMENU(form_control_get_name(control)),
PMA_MenuHandler, &selectmenuhook, End;