diff options
author | Ton Roosendaal <ton@blender.org> | 2009-05-22 19:02:32 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-05-22 19:02:32 +0400 |
commit | 1a69eab4a09f77db63830aa337872fb306372f94 (patch) | |
tree | 5c0673ef771b9500be5625f282c66b4b924c5bb1 /source/blender/editors/interface/interface_regions.c | |
parent | 5bc3bd7b067bd2b4c23d802445b4485da565de19 (diff) |
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!
Diffstat (limited to 'source/blender/editors/interface/interface_regions.c')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 4148f36726b..a714d6a6f6f 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -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); +} |