Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_regions.c
| Show First 20 Lines • Show All 1,045 Lines • ▼ Show 20 Lines | void ui_searchbox_update(bContext *C, ARegion *ar, uiBut *but, const bool reset) | ||||
| } | } | ||||
| /* validate selected item */ | /* validate selected item */ | ||||
| ui_searchbox_select(C, ar, but, 0); | ui_searchbox_select(C, ar, but, 0); | ||||
| ED_region_tag_redraw(ar); | ED_region_tag_redraw(ar); | ||||
| } | } | ||||
| bool ui_searchbox_autocomplete(bContext *C, ARegion *ar, uiBut *but, char *str) | int ui_searchbox_autocomplete(bContext *C, ARegion *ar, uiBut *but, char *str) | ||||
| { | { | ||||
| uiSearchboxData *data = ar->regiondata; | uiSearchboxData *data = ar->regiondata; | ||||
| int match = AUTOCOMPLETE_NO_MATCH; | int match = AUTOCOMPLETE_NO_MATCH; | ||||
| if (str[0]) { | if (str[0]) { | ||||
| data->items.autocpl = autocomplete_begin(str, ui_get_but_string_max_length(but)); | data->items.autocpl = autocomplete_begin(str, ui_get_but_string_max_length(but)); | ||||
| but->search_func(C, but->search_arg, but->editstr, &data->items); | but->search_func(C, but->search_arg, but->editstr, &data->items); | ||||
| match = autocomplete_end(data->items.autocpl, str); | match = autocomplete_end(data->items.autocpl, str); | ||||
| data->items.autocpl = NULL; | data->items.autocpl = NULL; | ||||
| } | } | ||||
| return match != AUTOCOMPLETE_NO_MATCH; | |||||
| return match; | |||||
| } | } | ||||
| static void ui_searchbox_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) | static void ui_searchbox_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) | ||||
| { | { | ||||
| uiSearchboxData *data = ar->regiondata; | uiSearchboxData *data = ar->regiondata; | ||||
| /* pixel space */ | /* pixel space */ | ||||
| wmOrtho2(-0.01f, ar->winx - 0.01f, -0.01f, ar->winy - 0.01f); | wmOrtho2(-0.01f, ar->winx - 0.01f, -0.01f, ar->winy - 0.01f); | ||||
| ▲ Show 20 Lines • Show All 1,769 Lines • Show Last 20 Lines | |||||