graphics/GraphicCommons.py
branchpython3
changeset 3774 5a3c5dc888cc
parent 3765 88fe6fc9fd38
child 3792 365f866ee120
equal deleted inserted replaced
3773:ab11852616b8 3774:5a3c5dc888cc
  1470                 if self.Forced:
  1470                 if self.Forced:
  1471                     dc.SetPen(MiterPen(wx.CYAN))
  1471                     dc.SetPen(MiterPen(wx.CYAN))
  1472                 else:
  1472                 else:
  1473                     dc.SetPen(MiterPen(wx.GREEN))
  1473                     dc.SetPen(MiterPen(wx.GREEN))
  1474             elif self.Value == "undefined":
  1474             elif self.Value == "undefined":
  1475                 dc.SetPen(MiterPen(wx.NamedColour("orange")))
  1475                 dc.SetPen(MiterPen(wx.Colour("orange")))
  1476             elif self.Forced:
  1476             elif self.Forced:
  1477                 dc.SetPen(MiterPen(wx.BLUE))
  1477                 dc.SetPen(MiterPen(wx.BLUE))
  1478             else:
  1478             else:
  1479                 dc.SetPen(MiterPen(wx.BLACK))
  1479                 dc.SetPen(MiterPen(wx.BLACK))
  1480             dc.SetBrush(wx.WHITE_BRUSH)
  1480             dc.SetBrush(wx.WHITE_BRUSH)
  1530         if not getattr(dc, "printing", False):
  1530         if not getattr(dc, "printing", False):
  1531             DrawHighlightedText(dc, self.Name, self.Highlights, xtext, ytext)
  1531             DrawHighlightedText(dc, self.Name, self.Highlights, xtext, ytext)
  1532 
  1532 
  1533         if self.Value is not None and not isinstance(self.Value, bool) and self.Value != "undefined":
  1533         if self.Value is not None and not isinstance(self.Value, bool) and self.Value != "undefined":
  1534             dc.SetFont(self.ParentBlock.Parent.GetMiniFont())
  1534             dc.SetFont(self.ParentBlock.Parent.GetMiniFont())
  1535             dc.SetTextForeground(wx.NamedColour("purple"))
  1535             dc.SetTextForeground(wx.Colour("purple"))
  1536             if self.ValueSize is None and isinstance(self.ComputedValue, str):
  1536             if self.ValueSize is None and isinstance(self.ComputedValue, str):
  1537                 self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
  1537                 self.ValueSize = self.ParentBlock.Parent.GetMiniTextExtent(self.ComputedValue)
  1538             if self.ValueSize is not None:
  1538             if self.ValueSize is not None:
  1539                 width, height = self.ValueSize
  1539                 width, height = self.ValueSize
  1540                 dc.DrawText(self.ComputedValue,
  1540                 dc.DrawText(self.ComputedValue,
  2706                 dc.SetBrush(wx.CYAN_BRUSH)
  2706                 dc.SetBrush(wx.CYAN_BRUSH)
  2707             else:
  2707             else:
  2708                 dc.SetPen(MiterPen(wx.GREEN))
  2708                 dc.SetPen(MiterPen(wx.GREEN))
  2709                 dc.SetBrush(wx.GREEN_BRUSH)
  2709                 dc.SetBrush(wx.GREEN_BRUSH)
  2710         elif self.Value == "undefined":
  2710         elif self.Value == "undefined":
  2711             dc.SetPen(MiterPen(wx.NamedColour("orange")))
  2711             dc.SetPen(MiterPen(wx.Colour("orange")))
  2712             dc.SetBrush(wx.Brush(wx.NamedColour("orange")))
  2712             dc.SetBrush(wx.Brush(wx.Colour("orange")))
  2713         elif self.Forced:
  2713         elif self.Forced:
  2714             dc.SetPen(MiterPen(wx.BLUE))
  2714             dc.SetPen(MiterPen(wx.BLUE))
  2715             dc.SetBrush(wx.BLUE_BRUSH)
  2715             dc.SetBrush(wx.BLUE_BRUSH)
  2716         else:
  2716         else:
  2717             dc.SetPen(MiterPen(wx.BLACK))
  2717             dc.SetPen(MiterPen(wx.BLACK))
  2738                 end = 1
  2738                 end = 1
  2739             dc.DrawLine(self.Points[self.SelectedSegment].x - 1, self.Points[self.SelectedSegment].y,
  2739             dc.DrawLine(self.Points[self.SelectedSegment].x - 1, self.Points[self.SelectedSegment].y,
  2740                         self.Points[self.SelectedSegment + 1].x + end, self.Points[self.SelectedSegment + 1].y)
  2740                         self.Points[self.SelectedSegment + 1].x + end, self.Points[self.SelectedSegment + 1].y)
  2741         if self.Value is not None and not isinstance(self.Value, bool) and self.Value != "undefined":
  2741         if self.Value is not None and not isinstance(self.Value, bool) and self.Value != "undefined":
  2742             dc.SetFont(self.Parent.GetMiniFont())
  2742             dc.SetFont(self.Parent.GetMiniFont())
  2743             dc.SetTextForeground(wx.NamedColour("purple"))
  2743             dc.SetTextForeground(wx.Colour("purple"))
  2744             if self.ValueSize is None and isinstance(self.ComputedValue, str):
  2744             if self.ValueSize is None and isinstance(self.ComputedValue, str):
  2745                 self.ValueSize = self.Parent.GetMiniTextExtent(self.ComputedValue)
  2745                 self.ValueSize = self.Parent.GetMiniTextExtent(self.ComputedValue)
  2746             if self.ValueSize is not None:
  2746             if self.ValueSize is not None:
  2747                 width, height = self.ValueSize
  2747                 width, height = self.ValueSize
  2748                 if self.BoundingBox[2] > width * 4 or self.BoundingBox[3] > height * 4:
  2748                 if self.BoundingBox[2] > width * 4 or self.BoundingBox[3] > height * 4: