Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
| Context not available. | |||||
| uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE); | uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE); | ||||
| uiPopupBoundsBlock(block, 6, -50, 26); | uiPopupBoundsBlock(block, 6, -50, 26); | ||||
| uiEndBlock(C, block); | |||||
| return block; | return block; | ||||
| } | } | ||||
| Context not available. | |||||
| uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE); | uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE); | ||||
| uiPopupBoundsBlock(block, 6, -50, 26); | uiPopupBoundsBlock(block, 6, -50, 26); | ||||
| uiEndBlock(C, block); | |||||
| return block; | return block; | ||||
| } | } | ||||
| Context not available. | |||||
| sub_v2_v2v2_int(mdiff, &event->x, menu->grab_xy_prev); | sub_v2_v2v2_int(mdiff, &event->x, menu->grab_xy_prev); | ||||
| copy_v2_v2_int(menu->grab_xy_prev, &event->x); | copy_v2_v2_int(menu->grab_xy_prev, &event->x); | ||||
| add_v2_v2v2_int(menu->popup_create_vars.event_xy, menu->popup_create_vars.event_xy, mdiff); | |||||
| ui_popup_translate(C, ar, mdiff); | ui_popup_translate(C, ar, mdiff); | ||||
| } | } | ||||
| Context not available. | |||||
| static int ui_handler_popup(bContext *C, const wmEvent *event, void *userdata) | static int ui_handler_popup(bContext *C, const wmEvent *event, void *userdata) | ||||
| { | { | ||||
| uiPopupBlockHandle *menu = userdata; | uiPopupBlockHandle *menu = userdata; | ||||
| struct ARegion *menu_region; | |||||
| /* we block all events, this is modal interaction, except for drop events which is described below */ | /* we block all events, this is modal interaction, except for drop events which is described below */ | ||||
| int retval = WM_UI_HANDLER_BREAK; | int retval = WM_UI_HANDLER_BREAK; | ||||
| menu_region = CTX_wm_menu(C); | |||||
| CTX_wm_menu_set(C, menu->region); | |||||
| if (event->type == EVT_DROP) { | if (event->type == EVT_DROP) { | ||||
| /* if we're handling drop event we'll want it to be handled by popup callee as well, | /* if we're handling drop event we'll want it to be handled by popup callee as well, | ||||
| * so it'll be possible to perform such operations as opening .blend files by dropping | * so it'll be possible to perform such operations as opening .blend files by dropping | ||||
| Context not available. | |||||
| /* delayed apply callbacks */ | /* delayed apply callbacks */ | ||||
| ui_apply_but_funcs_after(C); | ui_apply_but_funcs_after(C); | ||||
| CTX_wm_region_set(C, menu_region); | |||||
| return retval; | return retval; | ||||
| } | } | ||||
| Context not available. | |||||