forked from bartvdbraak/blender
replace debug popup function with call to generic function WM_operator_props_dialog_popup().
This commit is contained in:
parent
97aa2287fa
commit
46ce8cdf58
@ -1034,37 +1034,9 @@ int WM_operator_redo_popup(bContext *C, wmOperator *op)
|
||||
|
||||
/* ***************** Debug menu ************************* */
|
||||
|
||||
static uiBlock *wm_block_create_menu(bContext *C, ARegion *ar, void *arg_op)
|
||||
{
|
||||
wmOperator *op= arg_op;
|
||||
uiBlock *block;
|
||||
uiLayout *layout;
|
||||
uiStyle *style= U.uistyles.first;
|
||||
|
||||
block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
|
||||
uiBlockClearFlag(block, UI_BLOCK_LOOP);
|
||||
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT);
|
||||
|
||||
layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 300, 20, style);
|
||||
uiItemL(layout, op->type->name, 0);
|
||||
|
||||
if(op->type->ui) {
|
||||
op->layout= layout;
|
||||
op->type->ui(C, op);
|
||||
op->layout= NULL;
|
||||
}
|
||||
else
|
||||
uiDefAutoButsRNA(layout, op->ptr, NULL, 'H');
|
||||
|
||||
uiPopupBoundsBlock(block, 4.0f, 0, 0);
|
||||
uiEndBlock(C, block);
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
static int wm_debug_menu_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
G.rt= RNA_int_get(op->ptr, "debugval");
|
||||
G.rt= RNA_int_get(op->ptr, "debug_value");
|
||||
ED_screen_refresh(CTX_wm_manager(C), CTX_wm_window(C));
|
||||
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
||||
|
||||
@ -1073,13 +1045,8 @@ static int wm_debug_menu_exec(bContext *C, wmOperator *op)
|
||||
|
||||
static int wm_debug_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
|
||||
{
|
||||
|
||||
RNA_int_set(op->ptr, "debugval", G.rt);
|
||||
|
||||
/* pass on operator, so return modal */
|
||||
uiPupBlockOperator(C, wm_block_create_menu, op, WM_OP_EXEC_DEFAULT);
|
||||
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
RNA_int_set(op->ptr, "debug_value", G.rt);
|
||||
return WM_operator_props_dialog_popup(C, op, 180, 20);
|
||||
}
|
||||
|
||||
static void WM_OT_debug_menu(wmOperatorType *ot)
|
||||
@ -1092,7 +1059,7 @@ static void WM_OT_debug_menu(wmOperatorType *ot)
|
||||
ot->exec= wm_debug_menu_exec;
|
||||
ot->poll= WM_operator_winactive;
|
||||
|
||||
RNA_def_int(ot->srna, "debugval", 0, -10000, 10000, "Debug Value", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "debug_value", 0, -10000, 10000, "Debug Value", "", INT_MIN, INT_MAX);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user