Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_operators.c
| Show First 20 Lines • Show All 878 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| static struct EnumSearchMenu search_menu; | static struct EnumSearchMenu search_menu; | ||||
| search_menu.op = op; | search_menu.op = op; | ||||
| UI_popup_block_invoke(C, wm_enum_search_menu, &search_menu); | UI_popup_block_invoke(C, wm_enum_search_menu, &search_menu); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| /* Can't be used as an invoke directly, needs message arg (can be NULL) */ | /* Can't be used as an invoke directly, needs message arg (can be NULL) */ | ||||
| int WM_operator_confirm_message_ex( | int WM_operator_confirm_message_ex(bContext *C, | ||||
| bContext *C, wmOperator *op, const char *title, const int icon, const char *message) | wmOperator *op, | ||||
| const char *title, | |||||
| const int icon, | |||||
| const char *message, | |||||
| const short opcontext) | |||||
| { | { | ||||
| uiPopupMenu *pup; | uiPopupMenu *pup; | ||||
| uiLayout *layout; | uiLayout *layout; | ||||
| IDProperty *properties = op->ptr->data; | IDProperty *properties = op->ptr->data; | ||||
| if (properties && properties->len) { | if (properties && properties->len) { | ||||
| properties = IDP_CopyProperty(op->ptr->data); | properties = IDP_CopyProperty(op->ptr->data); | ||||
| } | } | ||||
| else { | else { | ||||
| properties = NULL; | properties = NULL; | ||||
| } | } | ||||
| pup = UI_popup_menu_begin(C, title, icon); | pup = UI_popup_menu_begin(C, title, icon); | ||||
| layout = UI_popup_menu_layout(pup); | layout = UI_popup_menu_layout(pup); | ||||
| uiItemFullO_ptr( | uiItemFullO_ptr(layout, op->type, message, ICON_NONE, properties, opcontext, 0, NULL); | ||||
| layout, op->type, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0, NULL); | |||||
| UI_popup_menu_end(C, pup); | UI_popup_menu_end(C, pup); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message) | int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message) | ||||
| { | { | ||||
| return WM_operator_confirm_message_ex(C, op, IFACE_("OK?"), ICON_QUESTION, message); | return WM_operator_confirm_message_ex( | ||||
| C, op, IFACE_("OK?"), ICON_QUESTION, message, WM_OP_EXEC_REGION_WIN); | |||||
| } | } | ||||
| int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| return WM_operator_confirm_message(C, op, NULL); | return WM_operator_confirm_message(C, op, NULL); | ||||
| } | } | ||||
| int WM_operator_confirm_or_exec(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | int WM_operator_confirm_or_exec(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| ▲ Show 20 Lines • Show All 2,935 Lines • Show Last 20 Lines | |||||