diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-22 22:39:44 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-22 22:39:44 +0400 |
commit | af02a0aa4e0b80c3c1154e7be095f4a387f81179 (patch) | |
tree | 3f714e683c96929cc4e44962570860ab0f635bc9 /source/blender/editors/interface/interface_anim.c | |
parent | 643d59bb9bf3bdd46f41a0b8c79384146629f9c8 (diff) |
UI
* Headers and menus can now be created in python.
* Replaced the uiMenuItem functions to create menus with equivalent
uiItem functions using a layout, removing duplicated code.
* More uiItem functions are now exposed to python.
* The text editor header, panels and one of its menus are now created
in space_text.py.
* Buttons window data context icon new changes depending on active
object.
Issues
* Icons are not wrapped yet, hardcoded ints at the moment.
* The ID browse template is unfinished.
Diffstat (limited to 'source/blender/editors/interface/interface_anim.c')
-rw-r--r-- | source/blender/editors/interface/interface_anim.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 6775a639597..af8aa91f358 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -114,44 +114,46 @@ void ui_but_anim_remove_driver(bContext *C) // TODO: refine the logic for adding/removing drivers... void ui_but_anim_menu(bContext *C, uiBut *but) { - uiMenuItem *head; + uiPopupMenu *pup; + uiLayout *layout; int length; if(but->rnapoin.data && but->rnaprop) { - head= uiPupMenuBegin(RNA_property_ui_name(but->rnaprop), 0); + pup= uiPupMenuBegin(RNA_property_ui_name(but->rnaprop), 0); + layout= uiPupMenuLayout(pup); length= RNA_property_array_length(but->rnaprop); if(but->flag & UI_BUT_ANIMATED_KEY) { if(length) { - uiMenuItemBooleanO(head, "Delete Keyframes", 0, "ANIM_OT_delete_keyframe_button", "all", 1); - uiMenuItemBooleanO(head, "Delete Single Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0); + uiItemBooleanO(layout, "Delete Keyframes", 0, "ANIM_OT_delete_keyframe_button", "all", 1); + uiItemBooleanO(layout, "Delete Single Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0); - uiMenuItemBooleanO(head, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 1); - uiMenuItemBooleanO(head, "Remove Single Driver", 0, "ANIM_OT_remove_driver_button", "all", 0); + uiItemBooleanO(layout, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 1); + uiItemBooleanO(layout, "Remove Single Driver", 0, "ANIM_OT_remove_driver_button", "all", 0); } else { - uiMenuItemBooleanO(head, "Delete Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0); + uiItemBooleanO(layout, "Delete Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0); - uiMenuItemBooleanO(head, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 0); + uiItemBooleanO(layout, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 0); } } else if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) { if(length) { - uiMenuItemBooleanO(head, "Insert Keyframes", 0, "ANIM_OT_insert_keyframe_button", "all", 1); - uiMenuItemBooleanO(head, "Insert Single Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0); + uiItemBooleanO(layout, "Insert Keyframes", 0, "ANIM_OT_insert_keyframe_button", "all", 1); + uiItemBooleanO(layout, "Insert Single Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0); - uiMenuItemBooleanO(head, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 1); - uiMenuItemBooleanO(head, "Add Single Driver", 0, "ANIM_OT_add_driver_button", "all", 0); + uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 1); + uiItemBooleanO(layout, "Add Single Driver", 0, "ANIM_OT_add_driver_button", "all", 0); } else { - uiMenuItemBooleanO(head, "Insert Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0); + uiItemBooleanO(layout, "Insert Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0); - uiMenuItemBooleanO(head, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 0); + uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 0); } } - uiPupMenuEnd(C, head); + uiPupMenuEnd(C, pup); } } |