Exemplo n.º 1
0
	def __init__(self, id, parentSurface, upperLeftCorner = (0, 0), size = (0, 0), backgroundColor = (30, 30, 220)):
		BaseUIComponent.__init__(self, id, parentSurface, upperLeftCorner, size)
		self._InitSurface()
		self._backgroundColor = backgroundColor
		self.CloseButton()
		self.MinimizeButton()
		self.HeaderLabel()
Exemplo n.º 2
0
 def __init__(self, id, parentSurface, upperLeftCorner=(0, 0), size=(90, 30), config=None):
     BaseUIComponent.__init__(self, id, parentSurface, upperLeftCorner, size, config)
     self._InitSurface()
     self.BackgroundImage(
         id + "_backGroundImage", DEFAULT_IMAGE_PATH, DEFAULT_HOVERED_IMAGE_PATH, DEFAULT_CLICKED_IMAGE_PATH
     )
     self.Label(id + "_text", "Button", "arial", 18)
     x = (self._width - self._label._width) / 2
     y = (self._height - self._label._height) / 2
     self._label.SetPosition((x, y))
Exemplo n.º 3
0
	def __init__(self, id, parentSurface, upperLeftCorner = (0, 0), size = (0, 0), text = "No text currently", minimized = False):
		BaseUIComponent.__init__(self, id, parentSurface, upperLeftCorner, size)
		self._InitSurface()
		self._size = size
		self.Message(text, 'arial', 12, (0, 0, 0), (0, 0, 0))
		self._header = MessageBoxHeader(id + '_header', self._controlSurface, (0, 0), (self._width, 20))
		self._header.SetAbsPosition(upperLeftCorner)
		self._minimized = minimized
		self._header.SetMinimizeCallback(self.ToggleMinimized)
		self._header.SetCloseCallback(self.Destroy)
Exemplo n.º 4
0
	def __init__(self, id, parentSurface, upperLeftCorner = (0, 0), size = (0, 0), text = "", font = "arial", textSize = 0, color = (0, 0, 0), hoveredColor = (127, 127, 127)):
		BaseUIComponent.__init__(self, id, parentSurface, upperLeftCorner, size)
		self._text = text
		self._font = font
		self._textSize = textSize
		self._color = color
		self._hoveredColor = hoveredColor
		self._InitSurface()
		self._width = self._controlSurface.get_width()
		self._height = self._controlSurface.get_height()
Exemplo n.º 5
0
	def __init__(self, id, activeScreen, upperLeftCorner = (0, 0), size = (0, 0), imagePath = "", hoveredImagePath = "", clickedImagePath = ""):
		BaseUIComponent.__init__(self, id, activeScreen, upperLeftCorner, size)
		self._imagePath = imagePath
		self._LoadImage()
		
		if hoveredImagePath != "":
			self._hoveredImagePath = hoveredImagePath
			self._LoadHoveredImage()
		
		if clickedImagePath != "":
			self._clickedImagePath = clickedImagePath
			self._LoadClickedImage()