diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-03 04:09:30 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-03 04:09:30 +0400 |
commit | 084be86ea99673eb0f570ed723b235c70b98c7bc (patch) | |
tree | 5e798d5e28d4c72f7c6cecf4ce89c9c496073363 /source/blender/editors/interface/interface_handlers.c | |
parent | 9ed9acaf9a5a64a3471b4eca6a9e91bb8f0bc23e (diff) |
UI:
* Make modifier and constraint templates use left/right alignment for
buttons in the header.
* Added mdef bind operator as an example of how to use local context
for a modifier, and add some code I forgot to commit last time to
make this system actually work.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index e0e58e61752..5617874ab0e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -160,6 +160,8 @@ typedef struct uiAfterFunc { PointerRNA rnapoin; PropertyRNA *rnaprop; + + bContextStore *context; } uiAfterFunc; static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state); @@ -252,6 +254,9 @@ static void ui_apply_but_func(bContext *C, uiBut *but) after->rnapoin= but->rnapoin; after->rnaprop= but->rnaprop; + if(but->context) + after->context= CTX_store_copy(but->context); + but->optype= NULL; but->opcontext= 0; but->opptr= NULL; @@ -273,6 +278,9 @@ static void ui_apply_but_funcs_after(bContext *C) after= *afterf; /* copy to avoid memleak on exit() */ BLI_freelinkN(&funcs, afterf); + if(after.context) + CTX_store_set(C, after.context); + if(after.func) after.func(C, after.func_arg1, after.func_arg2); if(after.funcN) @@ -292,6 +300,11 @@ static void ui_apply_but_funcs_after(bContext *C) if(after.rnapoin.data) RNA_property_update(C, &after.rnapoin, after.rnaprop); + + if(after.context) { + CTX_store_set(C, NULL); + CTX_store_free(after.context); + } } } |