From 11979dcc076e47101de6bec7fcb9a8f9777e35ab Mon Sep 17 00:00:00 2001 From: Ian Harrigan <ianharrigan@hotmail.com> Date: Fri, 26 Apr 2024 14:04:33 +0200 Subject: [PATCH] attempt to guess (convert) the property type --- haxe/ui/macros/Macros.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/haxe/ui/macros/Macros.hx b/haxe/ui/macros/Macros.hx index fef3f1edd..d0c09e24e 100644 --- a/haxe/ui/macros/Macros.hx +++ b/haxe/ui/macros/Macros.hx @@ -18,6 +18,7 @@ import haxe.ui.macros.helpers.FieldBuilder; import haxe.ui.util.EventInfo; import haxe.ui.util.RTTI; import haxe.ui.util.StringUtil; +import haxe.ui.util.TypeConverter; using StringTools; @@ -142,7 +143,8 @@ class Macros { } var propName = key.split(".").pop(); var propValue = ModuleMacros.properties.get(key); - createDefaultsFn.add(macro $i{propName} = $v{propValue}); + var convertedPropValue = TypeConverter.convertFrom(propValue); + createDefaultsFn.add(macro $i{propName} = $v{convertedPropValue}); } } }