本文整理汇总了Python中wx.lib方法的典型用法代码示例。如果您正苦于以下问题:Python wx.lib方法的具体用法?Python wx.lib怎么用?Python wx.lib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.lib方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SetBrush
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [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: SetPen
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def SetPen(self, LineColor, LineStyle, LineWidth):
"""
Set the Pen for this DrawObject
:param `LineColor`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetColor`
for valid entries
:param `LineStyle`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetLineStyle`
for valid entries
:param integer `LineWidth`: the width in pixels
"""
if (LineColor is None) or (LineStyle is None):
self.Pen = wx.TRANSPARENT_PEN
self.LineStyle = 'Transparent'
else:
self.Pen = self.PenList.setdefault(
(LineColor, LineStyle, LineWidth),
wx.Pen(LineColor, LineWidth, self.LineStyleList[LineStyle]))
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def __init__(self, Points, Color="Black", Diameter=1, InForeground=False):
"""
Default class constructor.
:param `Points`: takes a 2-tuple, or a (2,)
`NumPy <http://www.numpy.org/>`_ array of point coordinates
:param `Color`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetColor`
:param integer `Diameter`: the points diameter
:param boolean `InForeground`: should object be in foreground
"""
DrawObject.__init__(self, InForeground)
self.Points = N.array(Points,N.float)
self.Points.shape = (-1,2) # Make sure it is a NX2 array, even if there is only one point
self.CalcBoundingBox()
self.Diameter = Diameter
self.HitLineWidth = min(self.MinHitLineWidth, Diameter)
self.SetColor(Color)
示例4: AddOption
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def AddOption(self, size, lib, foot):
s = wx.SpinCtrlDouble(self.grid, value=str(size), inc=0.1)
self.gridSizer.Add(s)
print("lib {} foot {}".format(lib, foot))
l = wx.StaticText(self.grid, label=lib)
self.gridSizer.Add(l, proportion=1)
f = wx.StaticText(self.grid, label=foot)
self.gridSizer.Add(f, proportion=1)
b = wx.Button(self.grid, label="remove")
self.gridSizer.Add(b)
b.Bind(wx.EVT_BUTTON, self.OnRemove)
self.therows[b.GetId()] = (s,l,f,b)
示例5: OnOKCB
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def OnOKCB(self):
self.SetValue()
if (self.configname != None):
save_config.SaveConfigComplex(self.configname, self.value)
# dlg = MountingDialog(configname = "mountingmap")
# res = dlg.ShowModal()
# print("lib {} footprint {}".format(dlg.value))
# print("nets {}".format(dlg.nets.value))
# print("mods {}".format(dlg.mods.value))
# #print("file {}".format(dlg.file_picker.filename))
# #print("basic layer {}".format(dlg.basic_layer.value))
# if res == wx.ID_OK:
# print("ok")
# else:
# print("cancel")
示例6: SetHitBrush
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [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"]))
示例7: SetHitPen
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def SetHitPen(self, HitColor, LineWidth):
"""
Set the pen used for hit test, do not call directly.
:param `HitColor`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetColor`
:param integer `LineWidth`: the line width in pixels
"""
if not self.HitLine:
self.HitPen = wx.TRANSPARENT_PEN
else:
self.HitPen = self.PenList.setdefault( (HitColor, "solid", self.HitLineWidth), wx.Pen(HitColor, self.HitLineWidth, self.LineStyleList["Solid"]) )
## Just to make sure that they will always be there
## the appropriate ones should be overridden in the subclasses
示例8: SetLineColor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def SetLineColor(self, LineColor):
"""
Set the LineColor - this method is overridden in the subclasses
:param `LineColor`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetColor`
for valid values
"""
pass
示例9: SetColor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def SetColor(self, Color):
"""
Set the Color
:param `Color`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetColor`
for valid values
"""
self.SetPen(Color,"Solid",1)
self.SetBrush(Color,"Solid")
示例10: SetLineStyle
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def SetLineStyle(self, LineStyle):
"""
Set the LineStyle
:param `LineStyle`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetLineStyle`
for valid values
"""
self.LineStyle = LineStyle
self.SetPen(self.LineColor,LineStyle,self.LineWidth)
示例11: SetFillColor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def SetFillColor(self, FillColor):
"""
Set the FillColor
:param `FillColor`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetColor`
for valid values
"""
self.FillColor = FillColor
self.SetBrush(FillColor, self.FillStyle)
示例12: SetFillStyle
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def SetFillStyle(self, FillStyle):
"""
Set the FillStyle
:param `FillStyle`: see :meth:`~lib.floatcanvas.FloatCanvas.DrawObject.SetFillStyle`
for valid values
"""
self.FillStyle = FillStyle
self.SetBrush(self.FillColor,FillStyle)
示例13: SetValue
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def SetValue(self):
self.value = {}
for id in self.therows:
row = self.therows[id]
size = row[0].GetValue()
lib = row[1].GetLabel()
foot = row[2].GetLabel()
self.value[str(size)] = (lib, foot)
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import lib [as 别名]
def __init__(self, configname=None):
super(MountingDialog, self).__init__("mounting hole dialog", onok=self.OnOKCB)
homedir = os.path.expanduser("~")
self.file_picker = DialogUtils.FilePicker(self, homedir,
wildcard="DXF files (.dxf)|*.dxf",
configname="mountingdialog")
self.AddLabeled(item=self.file_picker, label="DXF file",
proportion=0, flag=wx.EXPAND|wx.ALL, border=2)
self.grid = wx.Panel(self)
self.gridSizer = wx.FlexGridSizer(cols=4, hgap=5, vgap=0)
self.grid.SetSizer(self.gridSizer)
self.configname = configname
self.therows = {}
self.mappings = []
if self.configname != None:
self.mappings = save_config.GetConfigComplex(self.configname, [])
for size in self.mappings:
lib,foot = self.mappings[size]
self.AddOption(size, lib, foot)
self.AddLabeled(self.grid, "diameter to footprint mappings",
proportion=1,
flag=wx.EXPAND|wx.ALL,
border=0)
w = wx.Window(self)
s = wx.BoxSizer(wx.HORIZONTAL)
w.SetSizer(s)
self.flip = wx.CheckBox(w, label="Flip to backside")
s.Add(self.flip)
self.add = wx.Button(w, label="Add Row")
self.add.Bind(wx.EVT_BUTTON, self.OnAdd)
s.Add(self.add, proportion=1)
self.Add(w, flag=wx.EXPAND|wx.ALL, border=0)
#self.IncSize(width=25, height=10)
self.Fit()