diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-25 00:17:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-25 00:17:14 +0300 |
commit | 5f4e24d5990a7ecd6198ee394da8b7c07277cd91 (patch) | |
tree | 9a1909d90276f0243d50c6624da43c794cc52dad /source/blender/makesrna/intern/rna_wm_api.c | |
parent | 4b8bc301c62784d111f2cffcbc35cf9c6189e37b (diff) |
operator draw function working again. needed to add layout to the operator to give access to "self.layout" - like panels, headers and manu's have
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_api.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index dcaff1a7c07..1afedf1c6a6 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -205,14 +205,14 @@ void RNA_api_operator(StructRNA *srna) /* poll */ func= RNA_def_function(srna, "poll", NULL); RNA_def_function_ui_description(func, "Test if the operator can be called or not."); - RNA_def_function_flag(func, FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); RNA_def_pointer(func, "context", "Context", "", ""); /* exec */ func= RNA_def_function(srna, "execute", NULL); RNA_def_function_ui_description(func, "Execute the operator."); - RNA_def_function_flag(func, FUNC_REGISTER); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_pointer(func, "context", "Context", "", ""); parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); // better name? @@ -222,13 +222,19 @@ void RNA_api_operator(StructRNA *srna) /* invoke */ func= RNA_def_function(srna, "invoke", NULL); RNA_def_function_ui_description(func, "Invoke the operator."); - RNA_def_function_flag(func, FUNC_REGISTER); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_pointer(func, "event", "Event", "", ""); parm= RNA_def_enum(func, "result", operator_return_items, 0, "result", ""); // better name? RNA_def_property_flag(parm, PROP_ENUM_FLAG); RNA_def_function_return(func, parm); + + /* draw */ + func= RNA_def_function(srna, "draw", NULL); + RNA_def_function_ui_description(func, "Draw function for the operator."); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); + RNA_def_pointer(func, "context", "Context", "", ""); } void RNA_api_keyconfig(StructRNA *srna) |