本文整理匯總了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)