Ejemplo n.º 1
0
    def setPropertyInitialiserValue(propertyInitialiser, value):

        valueType = type(value)

        pythonType = FalagardElementAttributesManager.getPythonTypeFromCeguiType(valueType)

        from ceed.cegui import ceguitypes
        if issubclass(pythonType, ceguitypes.Base):
            # if the value's type is a subclass of a python ceguitype, convert the value to a string
            valueAsString = pythonType.toString(value)
        else:
            valueAsString = unicode(value)

        propertyInitialiser.setInitialiserValue(valueAsString)
Ejemplo n.º 2
0
    def setPropertyInitialiserValue(propertyInitialiser, value):

        valueType = type(value)

        pythonType = FalagardElementAttributesManager.getPythonTypeFromCeguiType(valueType)

        from ceed.cegui import ceguitypes
        if issubclass(pythonType, ceguitypes.Base):
            # if the value's type is a subclass of a python ceguitype, convert the value to a string
            valueAsString = pythonType.toString(value)
        else:
            valueAsString = unicode(value)

        propertyInitialiser.setInitialiserValue(valueAsString)
Ejemplo n.º 3
0
    def convertToCeguiValueAndCeguiType(valueAsString, dataTypeAsString):
        """
        Converts a string based CEGUI value and CEGUI type to the native CEGUI value and CEGUI type
        :param valueAsString: str
        :param dataTypeAsString: str
        :return:
        """
        from ceed.propertysetinspector import CEGUIPropertyManager
        pythonDataType = CEGUIPropertyManager.getPythonTypeFromStringifiedCeguiType(dataTypeAsString)

        value = FalagardElementInterface.getCeguiTypeValueFromString(pythonDataType, valueAsString)
        valueType = FalagardElementAttributesManager.getCeguiTypeTypeFromPythonType(pythonDataType)

        return value, valueType
Ejemplo n.º 4
0
    def convertToCeguiValueAndCeguiType(valueAsString, dataTypeAsString):
        """
        Converts a string based CEGUI value and CEGUI type to the native CEGUI value and CEGUI type
        :param valueAsString: str
        :param dataTypeAsString: str
        :return:
        """
        from ceed.propertysetinspector import CEGUIPropertyManager
        pythonDataType = CEGUIPropertyManager.getPythonTypeFromStringifiedCeguiType(dataTypeAsString)

        value = FalagardElementInterface.getCeguiTypeValueFromString(pythonDataType, valueAsString)
        valueType = FalagardElementAttributesManager.getCeguiTypeTypeFromPythonType(pythonDataType)

        return value, valueType