Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | |||||
| #define BUTTON_FLASH_DELAY 0.020 | #define BUTTON_FLASH_DELAY 0.020 | ||||
| #define MENU_SCROLL_INTERVAL 0.1 | #define MENU_SCROLL_INTERVAL 0.1 | ||||
| #define PIE_MENU_INTERVAL 0.01 | #define PIE_MENU_INTERVAL 0.01 | ||||
| #define BUTTON_AUTO_OPEN_THRESH 0.2 | #define BUTTON_AUTO_OPEN_THRESH 0.2 | ||||
| #define BUTTON_MOUSE_TOWARDS_THRESH 1.0 | #define BUTTON_MOUSE_TOWARDS_THRESH 1.0 | ||||
| /* pixels to move the cursor to get out of keyboard navigation */ | /* pixels to move the cursor to get out of keyboard navigation */ | ||||
| #define BUTTON_KEYNAV_PX_LIMIT 8 | #define BUTTON_KEYNAV_PX_LIMIT 8 | ||||
| #define MENU_TOWARDS_MARGIN 20 /* margin in pixels */ | #define MENU_TOWARDS_MARGIN 20 /* margin in pixels */ | ||||
| #define MENU_TOWARDS_WIGGLE_ROOM 64 /* tolerance in pixels */ | #define MENU_TOWARDS_WIGGLE_ROOM 64 /* tolerance in pixels */ | ||||
| /* drag-lock distance threshold in pixels */ | /* drag-lock distance threshold in pixels */ | ||||
| #define BUTTON_DRAGLOCK_THRESH 3 | #define BUTTON_DRAGLOCK_THRESH 3 | ||||
| typedef enum uiButtonActivateType { | typedef enum uiButtonActivateType { | ||||
| BUTTON_ACTIVATE_OVER, | BUTTON_ACTIVATE_OVER, | ||||
| BUTTON_ACTIVATE, | BUTTON_ACTIVATE, | ||||
| BUTTON_ACTIVATE_APPLY, | BUTTON_ACTIVATE_APPLY, | ||||
| ▲ Show 20 Lines • Show All 3,220 Lines • ▼ Show 20 Lines | if (UI_but_is_utf8(but)) { | ||||
| if (strip) { | if (strip) { | ||||
| /* wont happen often so isn't that annoying to keep it here for a while */ | /* wont happen often so isn't that annoying to keep it here for a while */ | ||||
| printf("%s: invalid utf8 - stripped chars %d\n", __func__, strip); | printf("%s: invalid utf8 - stripped chars %d\n", __func__, strip); | ||||
| } | } | ||||
| } | } | ||||
| if (data->searchbox) { | if (data->searchbox) { | ||||
| if (data->cancel == false) { | if (data->cancel == false) { | ||||
| BLI_assert(but->type == UI_BTYPE_SEARCH_MENU); | |||||
| uiButSearch *but_search = (uiButSearch *)but; | |||||
| if ((ui_searchbox_apply(but, data->searchbox) == false) && | if ((ui_searchbox_apply(but, data->searchbox) == false) && | ||||
| (ui_searchbox_find_index(data->searchbox, but->editstr) == -1)) { | (ui_searchbox_find_index(data->searchbox, but->editstr) == -1) && | ||||
| !but_search->all_strings_valid) { | |||||
| data->cancel = true; | data->cancel = true; | ||||
| /* ensure menu (popup) too is closed! */ | /* ensure menu (popup) too is closed! */ | ||||
| data->escapecancel = true; | data->escapecancel = true; | ||||
| WM_reportf(RPT_ERROR, "Failed to find '%s'", but->editstr); | WM_reportf(RPT_ERROR, "Failed to find '%s'", but->editstr); | ||||
| WM_report_banner_show(); | WM_report_banner_show(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 7,721 Lines • Show Last 20 Lines | |||||