[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1645] trunk/py/scripts/addons/modules/ extensions_framework/ui.py: extensions_framework: Add alternative UI draw mode for EnumProperties (prop_menu_enum)
Doug Hammond
doughammond at hamsterfight.co.uk
Tue Feb 22 22:45:42 CET 2011
Revision: 1645
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1645
Author: dougal2
Date: 2011-02-22 21:45:41 +0000 (Tue, 22 Feb 2011)
Log Message:
-----------
extensions_framework: Add alternative UI draw mode for EnumProperties (prop_menu_enum)
Modified Paths:
--------------
trunk/py/scripts/addons/modules/extensions_framework/ui.py
Modified: trunk/py/scripts/addons/modules/extensions_framework/ui.py
===================================================================
--- trunk/py/scripts/addons/modules/extensions_framework/ui.py 2011-02-22 21:36:24 UTC (rev 1644)
+++ trunk/py/scripts/addons/modules/extensions_framework/ui.py 2011-02-22 21:45:41 UTC (rev 1645)
@@ -156,7 +156,7 @@
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 @@
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,
More information about the Bf-extensions-cvs
mailing list