当前位置: 首页>>代码示例>>Python>>正文


Python wx.lib方法代码示例

本文整理汇总了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)) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:20,代码来源:FCObjects.py

示例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])) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:19,代码来源:FCObjects.py

示例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) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:22,代码来源:FCObjects.py

示例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) 
开发者ID:mmccoo,项目名称:kicad_mmccoo,代码行数:19,代码来源:mounting.py

示例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") 
开发者ID:mmccoo,项目名称:kicad_mmccoo,代码行数:22,代码来源:mounting.py

示例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"])) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:15,代码来源:FCObjects.py

示例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 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:17,代码来源:FCObjects.py

示例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 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:11,代码来源:FCObjects.py

示例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") 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:12,代码来源:FCObjects.py

示例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) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:12,代码来源:FCObjects.py

示例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) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:12,代码来源:FCObjects.py

示例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) 
开发者ID:dougthor42,项目名称:wafer_map,代码行数:12,代码来源:FCObjects.py

示例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) 
开发者ID:mmccoo,项目名称:kicad_mmccoo,代码行数:10,代码来源:mounting.py

示例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() 
开发者ID:mmccoo,项目名称:kicad_mmccoo,代码行数:51,代码来源:mounting.py


注:本文中的wx.lib方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。