Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.c
| Show First 20 Lines • Show All 817 Lines • ▼ Show 20 Lines | else if ((found == true) && (isactive == false)) { | ||||
| BLI_remlink(&block->buttons, but); | BLI_remlink(&block->buttons, but); | ||||
| ui_but_free(C, but); | ui_but_free(C, but); | ||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *ar, uiBlock *block) | |||||
| { | |||||
| bool done = false; | |||||
| for (uiBut *but = block->buttons.first; but; but = but->next) { | |||||
| if (!done && ui_but_is_editable(but)) { | |||||
| if (but->flag & UI_BUT_ACTIVATE_INIT) { | |||||
| if (UI_but_active_only(C, ar, block, but)) { | |||||
| done = true; | |||||
| } | |||||
| } | |||||
| } | |||||
| but->flag &= ~UI_BUT_ACTIVATE_INIT; | |||||
| } | |||||
| return done; | |||||
| } | |||||
| /* simulate button click */ | /* simulate button click */ | ||||
| void UI_but_execute(const bContext *C, uiBut *but) | void UI_but_execute(const bContext *C, uiBut *but) | ||||
| { | { | ||||
| ARegion *ar = CTX_wm_region(C); | ARegion *ar = CTX_wm_region(C); | ||||
| void *active_back; | void *active_back; | ||||
| ui_but_execute_begin((bContext *)C, ar, but, &active_back); | ui_but_execute_begin((bContext *)C, ar, but, &active_back); | ||||
| /* Value is applied in begin. No further action required. */ | /* Value is applied in begin. No further action required. */ | ||||
| ui_but_execute_end((bContext *)C, ar, but, active_back); | ui_but_execute_end((bContext *)C, ar, but, active_back); | ||||
| ▲ Show 20 Lines • Show All 4,227 Lines • Show Last 20 Lines | |||||