本文整理汇总了Python中wx.TRANSPARENT_BRUSH属性的典型用法代码示例。如果您正苦于以下问题:Python wx.TRANSPARENT_BRUSH属性的具体用法?Python wx.TRANSPARENT_BRUSH怎么用?Python wx.TRANSPARENT_BRUSH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.TRANSPARENT_BRUSH属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SetBrush
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def SetBrush(self, FillColor, FillStyle):
"""
Set the brush for this DrawObject
:param `FillColor`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetColor`
for valid entries
:param `FillStyle`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetFillStyle`
for valid entries
"""
if FillColor is None or FillStyle is None:
self.Brush = wx.TRANSPARENT_BRUSH
##fixme: should I really re-set the style?
self.FillStyle = "Transparent"
else:
self.Brush = self.BrushList.setdefault(
(FillColor, FillStyle),
wx.Brush(FillColor, self.FillStyleList[FillStyle]))
#print("Setting Brush, BrushList length:", len(self.BrushList))
示例2: process_draw
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def process_draw(self, gc):
device = self.scene.device
if device.draw_mode & DRAW_MODE_RETICLE == 0:
# Draw Reticle
gc.SetPen(wx.RED_PEN)
gc.SetBrush(wx.TRANSPARENT_BRUSH)
try:
x = device.current_x
y = device.current_y
if x is None or y is None:
x = 0
y = 0
x, y = self.scene.convert_scene_to_window([x, y])
gc.DrawEllipse(x - 5, y - 5, 10, 10)
except AttributeError:
pass
示例3: DrawHighlightment
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def DrawHighlightment(self, dc):
scalex, scaley = dc.GetUserScale()
dc.SetUserScale(1, 1)
dc.SetPen(MiterPen(HIGHLIGHTCOLOR, (3 * scalex + 5), wx.SOLID))
dc.SetBrush(wx.TRANSPARENT_BRUSH)
dc.SetLogicalFunction(wx.AND)
# Draw a two circle arcs for representing the coil
dc.DrawEllipticArc(round(self.Pos.x * scalex),
round((self.Pos.y - int(self.Size[1] * (sqrt(2) - 1.) / 2.) + 1) * scaley),
round(self.Size[0] * scalex),
round((int(self.Size[1] * sqrt(2)) - 1) * scaley),
135, 225)
dc.DrawEllipticArc(round(self.Pos.x * scalex),
round((self.Pos.y - int(self.Size[1] * (sqrt(2) - 1.) / 2.) + 1) * scaley),
round(self.Size[0] * scalex),
round((int(self.Size[1] * sqrt(2)) - 1) * scaley),
-45, 45)
dc.SetLogicalFunction(wx.COPY)
dc.SetUserScale(scalex, scaley)
# Adds an highlight to the connection
示例4: PaintItem
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def PaintItem(self, item, dc, level, align):
CT.CustomTreeCtrl.PaintItem(self, item, dc, level, align)
rightimages = item.GetRightImages()
if len(rightimages) > 0:
images_bbx = self.GetItemRightImagesBBox(item)
r_image_w, _r_image_h = self._imageListRight.GetSize(rightimages[0])
dc.SetBrush(wx.TRANSPARENT_BRUSH)
dc.SetPen(wx.TRANSPARENT_PEN)
dc.DrawRectangle(images_bbx.x, images_bbx.y,
images_bbx.width, images_bbx.height)
x_pos = images_bbx.x + 4
for r_image in rightimages:
self._imageListRight.Draw(
r_image, dc, x_pos, images_bbx.y + 4,
wx.IMAGELIST_DRAW_TRANSPARENT)
x_pos += r_image_w + 4
示例5: DrawDecoration
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def DrawDecoration(self, dc, bounds, block):
"""
Draw this decoration
"""
if self.pen is None:
return
# We want to draw our decoration within the given bounds. Fat pens are drawn half
# either side of the coords, so we contract our coords so that fat pens don't
# cause drawing outside our bounds.
if self.pen.GetWidth() > 1:
rect = RectUtils.InsetBy(bounds, self.pen.GetWidth()/2)
else:
rect = bounds
dc.SetPen(self.pen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
if self.corner:
dc.DrawRoundedRectangle(rect[0], rect[1], rect[2], rect[3], self.corner)
else:
dc.DrawRectangle(*rect)
#----------------------------------------------------------------------------
示例6: DrawDecoration
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def DrawDecoration(self, dc, bounds, block):
"""
Draw this decoration
"""
rect = self._CalculateRect(bounds)
if self.color:
if self.toColor is None:
dc.SetPen(wx.TRANSPARENT_PEN)
dc.SetBrush(wx.Brush(self.color))
dc.DrawRectangle(*rect)
else:
dc.GradientFillLinear(wx.Rect(*rect), self.color, self.toColor)
if self.pen:
dc.SetPen(self.pen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
dc.DrawRectangle(*rect)
示例7: draw_rubberband
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def draw_rubberband(self, x0, y0, x1, y1):
dc = wx.ClientDC(self.canvas)
# this would be required if the Canvas is a ScrolledWindow,
# which is not the case for now
# self.PrepareDC(dc)
# delete old rubberband
if self._rect:
self.remove_rubberband(dc)
# draw new rubberband
dc.SetPen(wx.Pen(wx.BLACK, 1, wx.SOLID))
dc.SetBrush(wx.TRANSPARENT_BRUSH)
self._rect = (x0, self.canvas._height-y0, x1-x0, -y1+y0)
if wxc.is_phoenix:
dc.DrawRectangle(self._rect)
else:
dc.DrawRectangleRect(self._rect)
示例8: SetHitBrush
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def SetHitBrush(self, HitColor):
"""
Set the brush used for hit test, do not call directly.
:param `HitColor`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetColor`
"""
if not self.HitFill:
self.HitBrush = wx.TRANSPARENT_BRUSH
else:
self.HitBrush = self.BrushList.setdefault(
(HitColor,"solid"),
wx.Brush(HitColor, self.FillStyleList["Solid"]))
示例9: SetBrushes
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def SetBrushes(self):
"""Set the Brushes."""
self.Brushes = []
for FillColor, FillStyle in zip(self.FillColors, self.FillStyles):
if FillColor is None or FillStyle is None:
self.Brush = wx.TRANSPARENT_BRUSH
else:
self.Brushes.append(self.BrushList.setdefault( (FillColor, FillStyle),
wx.Brush( FillColor, self.FillStyleList[FillStyle] )
)
)
示例10: draw_rubberband
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def draw_rubberband(self, x0, y0, x1, y1):
dc = wx.ClientDC(self.canvas)
# this would be required if the Canvas is a ScrolledWindow,
# which is not the case for now
# self.PrepareDC(dc)
# delete old rubberband
if self._rect:
self.remove_rubberband(dc)
# draw new rubberband
dc.SetPen(wx.Pen(wx.BLACK, 1, wx.SOLID))
dc.SetBrush(wx.TRANSPARENT_BRUSH)
self._rect = (x0, self.canvas._height-y0, x1-x0, -y1+y0)
dc.DrawRectangle(self._rect)
示例11: OnPaint
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def OnPaint(self, event):
dc = wx.PaintDC(self)
rect = self.GetClientRect()
if self.border:
dc.SetPen(wx.Pen(self.border_color))
dc.SetBrush(wx.TRANSPARENT_BRUSH)
dc.DrawRectangle(0, 0, rect.width, rect.height)
rect = wx.Rect(rect.x + 1, rect.y + 1,
rect.width - 2, rect.height - 2)
_ScaleBlit(self.buffer, dc, rect)
示例12: draw
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def draw(self, dc, size):
srect = wx.Rect(0, 0, size.width, size.height)
self.draw_bar(dc, srect)
# dear god, I hope it's smooth
if self.gauge_theme["smooth"]:
dc.SetClippingRegion(srect.x, srect.y, srect.width, srect.height)
_ScaleBlit(self.smoother, dc,
wx.Rect(0, 0, srect.width, srect.height))
# top-line
if self.top_line and self.percent is not None:
dc.SetBrush(wx.TRANSPARENT_BRUSH)
dc.SetPen(wx.Pen(self.line_color))
line_width = 1
# top:
line_position = 0
# middle:
#line_position = (srect.height) // 2
# bottom:
#line_position = srect.height - line_width
dc.DrawRectangle(srect.x, line_position,
srect.width * self.percent, line_width)
dc.SetPen(wx.Pen(self.border_color))
dc.DrawRectangle(srect.x + srect.width * self.percent, line_position,
srect.width, line_width)
示例13: OnPaintButton
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def OnPaintButton(self, evt):
dc = wx.PaintDC(self.button)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
if self.IsEnabled(): dc.SetPen(wx.BLACK_PEN)
else: dc.SetPen(wx.GREY_PEN)
size = self.button.GetSize()
dc.DrawRectangle(0, 0, size.width, size.height)
示例14: Draw
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def Draw(
self,
dc,
aspectRatioIndex=0
):
dc.SetBackground(wx.Brush("black"))
dc.Clear()
w, h = dc.GetSizeTuple()
gc = wx.GraphicsContext.Create(dc)
gc.PushState()
gc.SetPen(wx.Pen("white", 3.0))
gc.SetBrush(wx.TRANSPARENT_BRUSH)
aspectRatio, isCCIR601 = ASPECT_RATIOS[aspectRatioIndex]
if aspectRatio is None:
gc.Scale(h / 1000.0, h / 1000.0)
gc.Translate(1000.0 * (w * 1.0 / h) / 2, 500)
elif w > h:
gc.Scale(w / (aspectRatio * 1000.0), h / 1000.0)
gc.Translate(500 * aspectRatio, 500)
gc.DrawEllipse(-450, -450, 900, 900)
gc.PopState()
dc.SetPen(wx.Pen("white", 2))
if isCCIR601:
offset = int(round(w * 8.0 / 720.0))
dc.SetBrush(wx.GREY_BRUSH)
dc.DrawRectangle(1, 1, offset-1, h-1)
dc.DrawRectangle(w-offset, 1, offset, h-1)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
dc.DrawRectangle(1, 1, w-1, h-1)
dc.DrawLine(0, h/2, w, h/2)
dc.DrawLine(w/2, 0, w/2, h)
示例15: set_brush
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TRANSPARENT_BRUSH [as 别名]
def set_brush(self, gc, fill):
c = fill
if c is not None and c != 'none':
swizzle_color = swizzlecolor(c)
self.color.SetRGB(swizzle_color) # wx has BBGGRR
self.brush.SetColour(self.color)
gc.SetBrush(self.brush)
else:
gc.SetBrush(wx.TRANSPARENT_BRUSH)