def DrawText(self, x, y, text, width=None): x = utilities.numericize(x) y = utilities.numericize(y) weight = "bold" if self.FontBold else "normal" slant = "italic" if self.FontItalic else "roman" font = tk.font.Font(root=self.root, family=self.FontName, size=self.FontSize, weight=weight,slant=slant) if self.__pen_alpha > 0: self.canvas.create_text(x, y, text=text, justify=tk.LEFT, anchor=tk.NW, width=width, font=font, fill=self.PenColor, stipple=self.get_stipple(self.__pen_alpha))
def ReadNumber(self): self.Show() # TODO: make the text box reject invalid input as it is entered instead of rejecting entire lines of input while True: self.current_input_mode = TextWindow.NUMERICAL user_input = self.Read() converted = py_msb_utils.numericize(user_input, False) if isinstance(converted, str): # wasn't a numeric input continue return str(converted)
def DrawText(self, x, y, text, width=None): x = utilities.numericize(x) y = utilities.numericize(y) weight = "bold" if self.FontBold else "normal" slant = "italic" if self.FontItalic else "roman" font = tk.font.Font(root=self.root, family=self.FontName, size=self.FontSize, weight=weight, slant=slant) if self.__pen_alpha > 0: self.canvas.create_text(x, y, text=text, justify=tk.LEFT, anchor=tk.NW, width=width, font=font, fill=self.PenColor, stipple=self.get_stipple(self.__pen_alpha))
def PenWidth(self, p): self.__pen_width = utilities.numericize(p, True)
def Height(self, height): self.set_geometry(height=utilities.numericize(height, True))
def Width(self, width): self.set_geometry(width=utilities.numericize(width, True))
def Top(self, top): self.set_geometry(top=utilities.numericize(top, True))
def MouseY(self, y): self.__pymouse.move(self.__pymouse.position()[0], utilities.numericize(y, force_numeric=True))
def MouseX(self, x): self.__pymouse.move(utilities.numericize(x, force_numeric=True), self.__pymouse.position()[1])
def Left(self, left): self.set_geometry(left=utilities.numericize(left, True))