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 747 Lines • ▼ Show 20 Lines | if (ui_afterfunc_check(block, but)) { | ||||
| after->optype = but->optype; | after->optype = but->optype; | ||||
| after->opcontext = but->opcontext; | after->opcontext = but->opcontext; | ||||
| after->opptr = but->opptr; | after->opptr = but->opptr; | ||||
| after->rnapoin = but->rnapoin; | after->rnapoin = but->rnapoin; | ||||
| after->rnaprop = but->rnaprop; | after->rnaprop = but->rnaprop; | ||||
| after->search_arg_free_func = but->search_arg_free_func; | if (but->type == UI_BTYPE_SEARCH_MENU) { | ||||
| after->search_arg = but->search_arg; | uiButSearch *search_but = (uiButSearch *)but; | ||||
| but->search_arg_free_func = NULL; | after->search_arg_free_func = search_but->item_collect_arg_free_func; | ||||
| but->search_arg = NULL; | after->search_arg = search_but->item_collect_arg; | ||||
| search_but->item_collect_arg_free_func = NULL; | |||||
| search_but->item_collect_arg = NULL; | |||||
| } | |||||
| if (but->context) { | if (but->context) { | ||||
| after->context = CTX_store_copy(but->context); | after->context = CTX_store_copy(but->context); | ||||
| } | } | ||||
| but->optype = NULL; | but->optype = NULL; | ||||
| but->opcontext = 0; | but->opcontext = 0; | ||||
| but->opptr = NULL; | but->opptr = NULL; | ||||
| ▲ Show 20 Lines • Show All 1,303 Lines • ▼ Show 20 Lines | #endif | ||||
| but->editvec = NULL; | but->editvec = NULL; | ||||
| but->editcoba = NULL; | but->editcoba = NULL; | ||||
| but->editcumap = NULL; | but->editcumap = NULL; | ||||
| but->editprofile = NULL; | but->editprofile = NULL; | ||||
| /* handle different types */ | /* handle different types */ | ||||
| switch (but->type) { | switch (but->type) { | ||||
| case UI_BTYPE_BUT: | case UI_BTYPE_BUT: | ||||
| case UI_BTYPE_DECORATOR: | |||||
| ui_apply_but_BUT(C, but, data); | ui_apply_but_BUT(C, but, data); | ||||
| break; | break; | ||||
| case UI_BTYPE_TEXT: | case UI_BTYPE_TEXT: | ||||
| case UI_BTYPE_SEARCH_MENU: | case UI_BTYPE_SEARCH_MENU: | ||||
| ui_apply_but_TEX(C, but, data); | ui_apply_but_TEX(C, but, data); | ||||
| break; | break; | ||||
| case UI_BTYPE_BUT_TOGGLE: | case UI_BTYPE_BUT_TOGGLE: | ||||
| case UI_BTYPE_TOGGLE: | case UI_BTYPE_TOGGLE: | ||||
| ▲ Show 20 Lines • Show All 1,224 Lines • ▼ Show 20 Lines | #endif | ||||
| /* set cursor pos to the end of the text */ | /* set cursor pos to the end of the text */ | ||||
| but->editstr = data->str; | but->editstr = data->str; | ||||
| but->pos = len; | but->pos = len; | ||||
| but->selsta = 0; | but->selsta = 0; | ||||
| but->selend = len; | but->selend = len; | ||||
| /* optional searchbox */ | /* optional searchbox */ | ||||
| if (but->type == UI_BTYPE_SEARCH_MENU) { | if (but->type == UI_BTYPE_SEARCH_MENU) { | ||||
| data->searchbox = but->search_create_func(C, data->region, but); | uiButSearch *search_but = (uiButSearch *)but; | ||||
| data->searchbox = search_but->popup_create_func(C, data->region, search_but); | |||||
| ui_searchbox_update(C, data->searchbox, but, true); /* true = reset */ | ui_searchbox_update(C, data->searchbox, but, true); /* true = reset */ | ||||
| } | } | ||||
| /* reset alert flag (avoid confusion, will refresh on exit) */ | /* reset alert flag (avoid confusion, will refresh on exit) */ | ||||
| but->flag &= ~UI_BUT_REDALERT; | but->flag &= ~UI_BUT_REDALERT; | ||||
| ui_but_update(but); | ui_but_update(but); | ||||
| ▲ Show 20 Lines • Show All 4,111 Lines • ▼ Show 20 Lines | static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *event) | ||||
| } | } | ||||
| if (but->flag & UI_BUT_DISABLED) { | if (but->flag & UI_BUT_DISABLED) { | ||||
| return WM_UI_HANDLER_CONTINUE; | return WM_UI_HANDLER_CONTINUE; | ||||
| } | } | ||||
| switch (but->type) { | switch (but->type) { | ||||
| case UI_BTYPE_BUT: | case UI_BTYPE_BUT: | ||||
| case UI_BTYPE_DECORATOR: | |||||
| retval = ui_do_but_BUT(C, but, data, event); | retval = ui_do_but_BUT(C, but, data, event); | ||||
| break; | break; | ||||
| case UI_BTYPE_KEY_EVENT: | case UI_BTYPE_KEY_EVENT: | ||||
| retval = ui_do_but_KEYEVT(C, but, data, event); | retval = ui_do_but_KEYEVT(C, but, data, event); | ||||
| break; | break; | ||||
| case UI_BTYPE_HOTKEY_EVENT: | case UI_BTYPE_HOTKEY_EVENT: | ||||
| retval = ui_do_but_HOTKEYEVT(C, but, data, event); | retval = ui_do_but_HOTKEYEVT(C, but, data, event); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 870 Lines • ▼ Show 20 Lines | while (region) { | ||||
| /* find active button */ | /* find active button */ | ||||
| activebut = NULL; | activebut = NULL; | ||||
| for (block = region->uiblocks.first; block; block = block->next) { | for (block = region->uiblocks.first; block; block = block->next) { | ||||
| for (but = block->buttons.first; but; but = but->next) { | for (but = block->buttons.first; but; but = but->next) { | ||||
| ui_but_anim_flag(but, (scene) ? scene->r.cfra : 0.0f); | ui_but_anim_flag(but, (scene) ? scene->r.cfra : 0.0f); | ||||
| ui_but_override_flag(but); | ui_but_override_flag(but); | ||||
| if (UI_but_is_decorator(but)) { | if (UI_but_is_decorator(but)) { | ||||
| ui_but_anim_decorate_update_from_flag(but); | ui_but_anim_decorate_update_from_flag((uiButDecorator *)but); | ||||
| } | } | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| if (but->active) { | if (but->active) { | ||||
| activebut = but; | activebut = but; | ||||
| } | } | ||||
| else if (!activebut && (but->flag & UI_BUT_LAST_ACTIVE)) { | else if (!activebut && (but->flag & UI_BUT_LAST_ACTIVE)) { | ||||
| ▲ Show 20 Lines • Show All 2,648 Lines • Show Last 20 Lines | |||||