Beispiel #1
0
	def renderStyle(self):
		objStyle 	= dotDict();
		
		# style
		if 'style' in self.objFrm:
			# px style
			arrStyle = ['left', 'right', 'top', 'bottom', 'width', 'height', 'margin', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'maxWidth', 'minWidth', 'maxHeight', 'minHeight']
			for strStyle in arrStyle:
				if strStyle in self.objFrm.style:
					objStyle[strStyle] = widget.addPx(self.objFrm.style[strStyle])
			
			# non-px style
			arrStyle = ['cursor', 'overflow', 'float', 'clear']
			for strStyle in arrStyle:
				if strStyle in self.objFrm.style:
					objStyle[strStyle] = self.objFrm.style[strStyle]
			
			# visibility
			#if self.objFrm.style.visible == False:
			#	objStyle.visibility = 'hidden'
			#else:
			#	objStyle.visibility = 'inherit'
			objStyle.visible = self.objFrm.style.visible;
		return objStyle
Beispiel #2
0
	def compilePy(self, objFrm):
		# id
		strPy  = "objForm.id = '%s'\n" % objFrm.id 
		
		# parent
		if 'parent' in objFrm:
			strPy  += "objForm.parent = '%s'\n" % objFrm.parent
			
		
		# style
		if 'style' in objFrm:
			# px style
			arrStyle = ['left', 'right', 'top', 'bottom', 'width', 'height']
			for strStyle in arrStyle:
				if strStyle in objFrm.style:
					strPy += 'objForm.style.%s = "%s"\n' % (strStyle, widget.addPx(objFrm.style[strStyle]))
			
			# visibility
			if objFrm.style.visible == False:
				strPy += 'objForm.style.visibility = "hidden"\n'
			else:
				strPy += 'objForm.style.visibility = "inherit"\n'
				
		return strPy