本文整理汇总了Python中wx.CAP_BUTT属性的典型用法代码示例。如果您正苦于以下问题:Python wx.CAP_BUTT属性的具体用法?Python wx.CAP_BUTT怎么用?Python wx.CAP_BUTT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.CAP_BUTT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DrawHighlightment
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CAP_BUTT [as 别名]
def DrawHighlightment(self, dc):
scalex, scaley = dc.GetUserScale()
dc.SetUserScale(1, 1)
pen = MiterPen(HIGHLIGHTCOLOR, 2 * scalex + 5)
pen.SetCap(wx.CAP_BUTT)
dc.SetPen(pen)
dc.SetBrush(wx.Brush(HIGHLIGHTCOLOR))
dc.SetLogicalFunction(wx.AND)
parent_pos = self.ParentBlock.GetPosition()
xstart = parent_pos[0] + self.Pos.x
ystart = parent_pos[1] + self.Pos.y
if self.Direction[0] < 0:
xstart += 1
if self.Direction[1] < 0:
ystart += 1
xend = xstart + CONNECTOR_SIZE * self.Direction[0]
yend = ystart + CONNECTOR_SIZE * self.Direction[1]
dc.DrawLine(round((xstart + self.Direction[0]) * scalex), round((ystart + self.Direction[1]) * scaley),
round(xend * scalex), round(yend * scaley))
dc.SetLogicalFunction(wx.COPY)
dc.SetUserScale(scalex, scaley)
# Adds an highlight to the connector
示例2: SetGridPen
# 需要导入模块: import wx [as 别名]
# 或者: from wx import CAP_BUTT [as 别名]
def SetGridPen(self, pen):
"""
Set the pen used to draw a grid in this format
"""
self.gridPen = pen
if self.gridPen:
# Other styles don't produce nice joins
self.gridPen.SetCap(wx.CAP_BUTT)
self.gridPen.SetJoin(wx.JOIN_MITER)