Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.c
| Context not available. | |||||
| static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut **butpp) | static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut **butpp) | ||||
| { | { | ||||
| /* flags from the buttons we want to refresh, may want to add more here... */ | /* flags from the buttons we want to refresh, may want to add more here... */ | ||||
| const int flag_copy = UI_BUT_REDALERT; | const int flag_copy = UI_BUT_REDALERT | UI_BUT_DRAG_MULTI; | ||||
| const int drawflag_copy = 0; /* None currently. */ | const int drawflag_copy = 0; /* None currently. */ | ||||
| uiBlock *oldblock; | uiBlock *oldblock; | ||||
| Context not available. | |||||
| /* note: if layout hasn't been applied yet, it uses old button pointers... */ | /* note: if layout hasn't been applied yet, it uses old button pointers... */ | ||||
| } | } | ||||
| else { | else { | ||||
| but->flag = (but->flag & ~flag_copy) | (oldbut->flag & flag_copy); | |||||
| /* ensures one button can get activated, and in case the buttons | /* ensures one button can get activated, and in case the buttons | ||||
| * draw are the same this gives O(1) lookup for each button */ | * draw are the same this gives O(1) lookup for each button */ | ||||
| BLI_remlink(&oldblock->buttons, oldbut); | BLI_remlink(&oldblock->buttons, oldbut); | ||||
| Context not available. | |||||
| /* simulate button click */ | /* simulate button click */ | ||||
| void uiButExecute(const bContext *C, uiBut *but) | void uiButExecute(const bContext *C, uiBut *but) | ||||
| { | { | ||||
| ui_button_execute_do((bContext *)C, CTX_wm_region(C), but); | void *active_back; | ||||
| ui_button_execute_begin((bContext *)C, CTX_wm_region(C), but, &active_back); | |||||
| /* Value is applied in begin. No further action required. */ | |||||
| ui_button_execute_end((bContext *)C, CTX_wm_region(C), but, active_back); | |||||
| } | } | ||||
| /* use to check if we need to disable undo, but don't make any changes | /* use to check if we need to disable undo, but don't make any changes | ||||
| Context not available. | |||||