def createSettingsForFalagardElement(self, falagardElement): """ Creates a list of settings for any type of Falagard Element (except the WidgetLookFeel itself) :param falagardElement: :return: """ settings = [] if falagardElement is None: return settings from falagard_element_interface import FalagardElementInterface attributeList = FalagardElementInterface.getListOfAttributes( falagardElement) for attributeName in attributeList: attributeValue, attributeCeguiType = FalagardElementInterface.getAttributeValue( falagardElement, attributeName, self.visual.tabbedEditor) newSetting = self.createPropertyForFalagardElement( falagardElement, attributeName, attributeValue, attributeCeguiType, "") settings.append(newSetting) return settings
def __init__(self, falagardProperty, visual, falagardElement, attributeName, newValue, ignoreNextCallback=False): super(FalagardElementAttributeEdit, self).__init__() self.visual = visual """ :type : LookNFeelVisualEditing """ self.falagardElement = falagardElement self.attributeName = attributeName self.falagardProperty = falagardProperty """ :type : FalagardElementEditorProperty""" # We retrieve the momentary value using the getter callback and store it as old value from falagard_element_interface import FalagardElementInterface self.oldValue, ceguiType = FalagardElementInterface.getAttributeValue( falagardElement, attributeName, visual.tabbedEditor) self.oldValueAsString = unicode(self.oldValue) # If the value is a subtype of from ceed.cegui import ceguitypes newValueType = type(newValue) if issubclass(newValueType, ceguitypes.Base): # if it is a subclass of our ceguitypes, do some special handling self.newValueAsString = unicode(newValue) self.newValue = newValueType.toCeguiType(self.newValueAsString) elif newValueType is bool or newValueType is unicode: self.newValue = newValue self.newValueAsString = unicode(newValue) else: raise Exception("Unexpected type encountered") # Get the Falagard element's type as string so we can display better info from ceed.editors.looknfeel.falagard_element_interface import FalagardElementInterface self.falagardElementName = FalagardElementInterface.getFalagardElementTypeAsString( falagardElement) self.refreshText() self.ignoreNextCall = ignoreNextCallback
def createSettingsForFalagardElement(self, falagardElement): """ Creates a list of settings for any type of Falagard Element (except the WidgetLookFeel itself) :param falagardElement: :return: """ settings = [] if falagardElement is None: return settings from falagard_element_interface import FalagardElementInterface attributeList = FalagardElementInterface.getListOfAttributes(falagardElement) for attributeName in attributeList: attributeValue, attributeCeguiType = FalagardElementInterface.getAttributeValue(falagardElement, attributeName, self.visual.tabbedEditor) newSetting = self.createPropertyForFalagardElement(falagardElement, attributeName, attributeValue, attributeCeguiType, "") settings.append(newSetting) return settings
def __init__(self, falagardProperty, visual, falagardElement, attributeName, newValue, ignoreNextCallback=False): super(FalagardElementAttributeEdit, self).__init__() self.visual = visual """ :type : LookNFeelVisualEditing """ self.falagardElement = falagardElement self.attributeName = attributeName self.falagardProperty = falagardProperty """ :type : FalagardElementEditorProperty""" # We retrieve the momentary value using the getter callback and store it as old value from falagard_element_interface import FalagardElementInterface self.oldValue, ceguiType = FalagardElementInterface.getAttributeValue(falagardElement, attributeName, visual.tabbedEditor) self.oldValueAsString = unicode(self.oldValue) # If the value is a subtype of from ceed.cegui import ceguitypes newValueType = type(newValue) if issubclass(newValueType, ceguitypes.Base): # if it is a subclass of our ceguitypes, do some special handling self.newValueAsString = unicode(newValue) self.newValue = newValueType.toCeguiType(self.newValueAsString) elif newValueType is bool or newValueType is unicode: self.newValue = newValue self.newValueAsString = unicode(newValue) else: raise Exception("Unexpected type encountered") # Get the Falagard element's type as string so we can display better info from ceed.editors.looknfeel.falagard_element_interface import FalagardElementInterface self.falagardElementName = FalagardElementInterface.getFalagardElementTypeAsString(falagardElement) self.refreshText() self.ignoreNextCall = ignoreNextCallback