diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-16 22:47:42 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-16 22:47:42 +0400 |
commit | 3a6bf17b3ef696c572207d5af3381c6327fe6a92 (patch) | |
tree | b95e5d5b869fc2c16a77e0a2ef1142899a6cb6e4 /source/blender/editors/interface/interface.c | |
parent | de59f34be0a2da17a90950aef1c87a0bb6c74052 (diff) |
UI
* Fix problem with curve mapping / color ramps not updating
things like previews propertly. Now it uses the RNA update
of the pointer from the material/texture/.. so each of those
can define their own update, but still share the RNA struct.
* Code for these templates is now in interface_templates.c
* Fix exception for "axis" property, now it always shows normal
widget with the PROP_DIRECTION subtype.
* Remove context from uiBlockLayoutResolve, no longer needed.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 221618b340e..2d4b2caa845 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -622,7 +622,7 @@ void uiEndBlock(const bContext *C, uiBlock *block) } /* handle pending stuff */ - if(block->layouts.first) uiBlockLayoutResolve(C, block, NULL, NULL); + if(block->layouts.first) uiBlockLayoutResolve(block, NULL, NULL); ui_block_do_align(block); if(block->flag & UI_BLOCK_LOOP) ui_menu_block_set_keymaps(C, block); @@ -1684,6 +1684,9 @@ void uiFreeBlock(const bContext *C, uiBlock *block) ui_free_but(C, but); } + if(block->func_argN) + MEM_freeN(block->func_argN); + CTX_store_free_list(&block->contexts); BLI_freelistN(&block->saferct); @@ -2232,6 +2235,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short but->func= block->func; but->func_arg1= block->func_arg1; but->func_arg2= block->func_arg2; + + but->funcN= block->funcN; + if(block->func_argN) + but->func_argN= MEM_dupallocN(block->func_argN); but->pos= -1; /* cursor invisible */ @@ -2945,6 +2952,16 @@ void uiBlockSetFunc(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2 block->func_arg2= arg2; } +void uiBlockSetNFunc(uiBlock *block, uiButHandleFunc func, void *argN, void *arg2) +{ + if(block->func_argN) + MEM_freeN(block->func_argN); + + block->funcN= func; + block->func_argN= argN; + block->func_arg2= arg2; +} + void uiButSetRenameFunc(uiBut *but, uiButHandleRenameFunc func, void *arg1) { but->rename_func= func; @@ -2967,6 +2984,9 @@ void uiButSetFunc(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2) void uiButSetNFunc(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2) { + if(but->func_argN) + MEM_freeN(but->func_argN); + but->funcN= funcN; but->func_argN= argN; but->func_arg2= arg2; @@ -3003,6 +3023,8 @@ uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, char * { uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip); but->block_create_func= func; + if(but->func_argN) + MEM_freeN(but->func_argN); but->func_argN= argN; ui_check_but(but); return but; |