Create menu_input_dialog_start_search

This commit is contained in:
twinaphex 2016-09-15 17:18:24 +02:00
parent b9320514cb
commit d9e631de69
3 changed files with 22 additions and 17 deletions

View File

@ -629,11 +629,11 @@ bool menu_input_mouse_check_vector_inside_hitbox(menu_input_ctx_hitbox_t *hitbox
}
static const char **menu_input_keyboard_buffer;
static char menu_input_keyboard_label_setting[256];
static const char *menu_input_keyboard_label = NULL;
bool menu_input_ctl(enum menu_input_ctl_state state, void *data)
{
static char menu_input_keyboard_label_setting[256];
static const char *menu_input_keyboard_label = NULL;
static bool pointer_dragging = false;
menu_input_t *menu_input = menu_input_get_ptr();
@ -657,19 +657,6 @@ bool menu_input_ctl(enum menu_input_ctl_state state, void *data)
memset(menu_input, 0, sizeof(menu_input_t));
pointer_dragging = false;
break;
case MENU_INPUT_CTL_SEARCH_START:
{
menu_handle_t *menu = NULL;
if (!menu_driver_ctl(
RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return false;
menu_input->keyboard.display = true;
menu_input_keyboard_label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SEARCH);
menu_input_keyboard_buffer =
input_keyboard_start_line(menu, menu_input_search_cb);
}
break;
case MENU_INPUT_CTL_MOUSE_PTR:
{
unsigned *ptr = (unsigned*)data;
@ -770,6 +757,23 @@ bool menu_input_ctl(enum menu_input_ctl_state state, void *data)
return true;
}
bool menu_input_dialog_start_search(void)
{
bool keyboard_display = true;
menu_handle_t *menu = NULL;
if (!menu_driver_ctl(
RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return false;
menu_input_ctl(MENU_INPUT_CTL_SET_KEYBOARD_DISPLAY,
&keyboard_display);
menu_input_keyboard_label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SEARCH);
menu_input_keyboard_buffer =
input_keyboard_start_line(menu, menu_input_search_cb);
return true;
}
bool menu_input_dialog_start(menu_input_ctx_line_t *line)
{
bool keyboard_display = true;

View File

@ -85,7 +85,6 @@ enum menu_input_ctl_state
MENU_INPUT_CTL_KEYBOARD_LABEL_SETTING,
MENU_INPUT_CTL_SET_KEYBOARD_LABEL_SETTING,
MENU_INPUT_CTL_UNSET_KEYBOARD_LABEL_SETTING,
MENU_INPUT_CTL_SEARCH_START,
MENU_INPUT_CTL_DEINIT,
MENU_INPUT_CTL_BIND_NONE,
MENU_INPUT_CTL_BIND_SINGLE,
@ -117,6 +116,8 @@ typedef struct menu_input_ctx_line
input_keyboard_line_complete_t cb;
} menu_input_ctx_line_t;
bool menu_input_dialog_start_search(void);
bool menu_input_dialog_start(menu_input_ctx_line_t *line);
void menu_input_dialog_end(void);

View File

@ -402,7 +402,7 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
entry->label, entry->type, i);
break;
case MENU_ACTION_SEARCH:
menu_input_ctl(MENU_INPUT_CTL_SEARCH_START, NULL);
menu_input_dialog_start_search();
break;
case MENU_ACTION_SCAN: