2.5
- Added new popup menu type, which can be used to pass on a running operator too. Needed it for debug menu, allowing to set variables outside of operator "first do then tweak" system. :) void uiPupBlockOperator() Don't forget to tell invoke() return that operator now runs modal! - Test menu: alt+ctrl+d gives the G.rt debug value. Values of 0-16 now can be used to shrink areas, stuff like this then happens (rt==4): http://download.blender.org/institute/rt5.jpg Was looking at ways to visually distinguish areas and regions better. Yes I know, cute rounded corners, etc. Just testing!
This commit is contained in:
@@ -2080,3 +2080,20 @@ void uiPupBlock(bContext *C, uiBlockCreateFunc func, void *arg)
|
||||
uiPupBlockO(C, func, arg, NULL, 0);
|
||||
}
|
||||
|
||||
void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int opcontext)
|
||||
{
|
||||
wmWindow *window= CTX_wm_window(C);
|
||||
uiPopupBlockHandle *handle;
|
||||
|
||||
handle= ui_popup_block_create(C, NULL, NULL, func, NULL, op);
|
||||
handle->popup= 1;
|
||||
handle->retvalue= 1;
|
||||
|
||||
handle->popup_arg= op;
|
||||
handle->popup_func= operator_cb;
|
||||
handle->cancel_func= confirm_cancel_operator;
|
||||
handle->opcontext= opcontext;
|
||||
|
||||
UI_add_popup_handlers(C, &window->handlers, handle);
|
||||
WM_event_add_mousemove(C);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user