def Draw(self, dc: wx.DC): dc.SetPen(self.__Pen) x = min([self.__X1, self.__X2]) y = min([self.__Y1, self.__Y2]) w = max([self.__X1, self.__X2]) - x h = max([self.__Y1, self.__Y2]) - y dc.DrawRectangle(x, y, w, h)
def Draw(self, dc: DC, withChildren=True): """ Draw the point on the dc. Args: dc: withChildren: """ if self._visible or (self._visibleWhenSelected and self._selected): self.__penSaveColor = dc.GetPen().GetColour() Shape.Draw(self, dc, False) self.__resetPenColor(dc) x, y = self.GetPosition() if not self._selected: dc.DrawRectangle(x - 1, y - 1, 3, 3) else: dc.DrawRectangle(x - 3, y - 3, 7, 7) if withChildren: self.DrawChildren(dc)
def Draw(self, dc: DC, withChildren: bool = False): """ Draw the rectangle on the dc. Args: dc: withChildren: Returns: """ if self._visible: Shape.Draw(self, dc, False) if self._drawFrame: sx, sy = self.GetPosition() sx, sy = sx - self._ox, sy - self._oy width, height = self.GetSize() dc.DrawRectangle(sx, sy, width, height) if withChildren: self.DrawChildren(dc) if self._topLeftSizer is not None: self._topLeftSizer.Draw(dc, False)
def Draw(self, dc: wx.DC): (x, y, w, h) = self.EnclosingRectangle() dc.SetPen(self.Pen()) dc.DrawRectangle(x, y, w, h)