Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hammond <doughammond@hamsterfight.co.uk>2011-02-23 00:45:41 +0300
committerDoug Hammond <doughammond@hamsterfight.co.uk>2011-02-23 00:45:41 +0300
commit858f39b417add0077a919c4ea8c8c9dda30587dc (patch)
treea0c48a932593d812bbd74a1d3c6bddcd3d23d7be /modules/extensions_framework
parent68ad532092fcd516092711992b2c72fbf6ae04e8 (diff)
extensions_framework: Add alternative UI draw mode for EnumProperties (prop_menu_enum)
Diffstat (limited to 'modules/extensions_framework')
-rw-r--r--modules/extensions_framework/ui.py37
1 files changed, 36 insertions, 1 deletions
diff --git a/modules/extensions_framework/ui.py b/modules/extensions_framework/ui.py
index f2342f95..94aafa03 100644
--- a/modules/extensions_framework/ui.py
+++ b/modules/extensions_framework/ui.py
@@ -156,7 +156,7 @@ class property_group_renderer(bpy.types.Panel):
if 'type' in current_property_keys:
if current_property['type'] in ['int', 'float',
- 'float_vector', 'enum', 'string']:
+ 'float_vector', 'string']:
layout.prop(
property_group,
control_list_item,
@@ -183,6 +183,41 @@ class property_group_renderer(bpy.types.Panel):
if 'emboss' in current_property_keys \
else True,
)
+ if current_property['type'] in ['enum']:
+ if 'use_menu' in current_property_keys and \
+ current_property['use_menu']:
+ layout.prop_menu_enum(
+ property_group,
+ control_list_item,
+ text = current_property['name']
+ )
+ else:
+ layout.prop(
+ property_group,
+ control_list_item,
+ text = current_property['name'],
+ expand = current_property['expand'] \
+ if 'expand' in current_property_keys \
+ else False,
+ slider = current_property['slider'] \
+ if 'slider' in current_property_keys \
+ else False,
+ toggle = current_property['toggle'] \
+ if 'toggle' in current_property_keys \
+ else False,
+ icon_only = current_property['icon_only'] \
+ if 'icon_only' in current_property_keys \
+ else False,
+ event = current_property['event'] \
+ if 'event' in current_property_keys \
+ else False,
+ full_event = current_property['full_event'] \
+ if 'full_event' in current_property_keys \
+ else False,
+ emboss = current_property['emboss'] \
+ if 'emboss' in current_property_keys \
+ else True,
+ )
if current_property['type'] in ['bool']:
layout.prop(
property_group,