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


Python wx.VERSION属性代码示例

本文整理汇总了Python中wx.VERSION属性的典型用法代码示例。如果您正苦于以下问题:Python wx.VERSION属性的具体用法?Python wx.VERSION怎么用?Python wx.VERSION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在wx的用法示例。


在下文中一共展示了wx.VERSION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GetPrerequisites

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def GetPrerequisites(info=False):
  try:
    import ldap
    if ldap.__version__ < "2.4":
      if info:
        print "ldap too old"
      return None
    import wx
    if wx.VERSION < (2,9):
      if info:
        print "wxPython too old"
      return None
    
    return "ldap"
  except:
    if info:
      print "ldap missing"
    pass
  return None 
开发者ID:andreas-p,项目名称:admin4,代码行数:21,代码来源:_requires.py

示例2: _init_ctrls

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def _init_ctrls(self, prnt):
        self.HeaderLabel = wx.StaticText(id=ID_SEARCHRESULTPANELHEADERLABEL,
                                         name='HeaderLabel', parent=self,
                                         pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)

        search_results_tree_style = CT.TR_HAS_BUTTONS | CT.TR_NO_LINES | CT.TR_HAS_VARIABLE_ROW_HEIGHT
        self.SearchResultsTree = CT.CustomTreeCtrl(id=ID_SEARCHRESULTPANELSEARCHRESULTSTREE,
                                                   name="SearchResultsTree", parent=self,
                                                   pos=wx.Point(0, 0), style=search_results_tree_style)
        if wx.VERSION >= (2, 8, 11):
            self.SearchResultsTree.SetAGWWindowStyleFlag(search_results_tree_style)
        self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnSearchResultsTreeItemActivated,
                  id=ID_SEARCHRESULTPANELSEARCHRESULTSTREE)

        self.ResetButton = wx.lib.buttons.GenBitmapButton(
            self, bitmap=GetBitmap("reset"),
            size=wx.Size(28, 28), style=wx.NO_BORDER)
        self.ResetButton.SetToolTipString(_("Reset search result"))
        self.Bind(wx.EVT_BUTTON, self.OnResetButton, self.ResetButton)

        self._init_sizers() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:23,代码来源:SearchResultPanel.py

示例3: on_resize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def on_resize(self, event):
        """Process the resize event."""

        if wx.VERSION >= (2, 9) or self.canvas.GetContext():
            self.canvas.SetCurrent(self.canvas.context)
            self.Show()
            size = self.canvas.GetClientSize()
            self.resize(size.width, size.height)
            self.canvas.Refresh(False)
        event.Skip() 
开发者ID:spectralpython,项目名称:spectral,代码行数:12,代码来源:hypercube.py

示例4: on_resize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def on_resize(self, event):
        '''Process the resize event.'''

        # For wx versions 2.9.x, GLCanvas.GetContext() always returns None,
        # whereas 2.8.x will return the context so test for both versions.

        if wx.VERSION >= (2, 9) or self.canvas.GetContext():
            self.canvas.SetCurrent(self.canvas.context)
            # Make sure the frame is shown before calling SetCurrent.
            self.Show()
            size = event.GetSize()
            self.resize(size.width, size.height)
            self.canvas.Refresh(False)
        event.Skip() 
开发者ID:spectralpython,项目名称:spectral,代码行数:16,代码来源:ndwindow.py

示例5: start_page

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def start_page(self, name):
        # create a ScrolledWindow and a Panel; with only ScrolledWindow, scrolling on gtk 3 does not work
        scrolled = wx.ScrolledWindow( self.notebook, name=name)
        panel = wx.Panel(scrolled, name="%s properties"%name)
        if wx.VERSION[0]<3:
            panel.SetBackgroundColour(scrolled.GetBackgroundColour())
        return panel 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:9,代码来源:main.py

示例6: check_wx_version_at_least

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def check_wx_version_at_least(major, minor=0, release=0, revision=0):
    "returns True if the current wxPython version is at least major.minor.release"
    return wx.VERSION[:-1] >= (major, minor, release, revision)



########################################################################################################################
# error/warning/info messages 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:10,代码来源:misc.py

示例7: check_accessibility

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def check_accessibility(self):
        # add a warning if not NVDA etc. compatible
        import sys, platform, compat
        if sys.platform!="win32" or not compat.IS_PHOENIX: return
        if platform.architecture()[0] != "32bit": return
        version = wx.VERSION[:3]
        if version < (4,0,4) or version > (4,0,7): return
        panel = self.sizer_accessibility.GetContainingWindow()
        text = wx.StaticText(panel, label="Please be warned that your version of wxPython\n"
                                          "probably does not support screen readers very well.\n"
                                          "This is a problem with wxPython versions\n"
                                          "4.0.4 to 4.0.7 on 32 bit Python on Windows.\n"
                                          "A workaround is to set the name argument of CheckBox.")
        self.sizer_accessibility.Insert(0, text, 0, wx.ALL, 10)
        self.sizer_accessibility.Layout() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:17,代码来源:preferencesdialog.py

示例8: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def __init__(self, parent, rows, cols, vgap, hgap):
        wx.BoxSizer.__init__(self, wx.VERTICAL)
        self.parent = parent  # EditGridSizer or derived class
        self._create(rows, cols, vgap, hgap)
        wx.BoxSizer.Add(self, self.parent._btn, 0, wx.EXPAND)
        wx.BoxSizer.Add(self, self._grid, 1, wx.EXPAND)
        if wx.VERSION[:2] < (3,0):
            self._growable_rows = set()
            self._growable_cols = set() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:11,代码来源:edit_sizers.py

示例9: AppendMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def AppendMenu(parent, help, id, kind, text):
    if wx.VERSION >= (2, 6, 0):
        parent.Append(help=help, id=id, kind=kind, text=text)
    else:
        parent.Append(helpString=help, id=id, kind=kind, item=text) 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:7,代码来源:ConfigEditor.py

示例10: CreateApplication

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def CreateApplication(self):

        BeremizAppType = wx.App if wx.VERSION >= (3, 0, 0) else wx.PySimpleApp

        class BeremizApp(BeremizAppType):
            def OnInit(_self):  # pylint: disable=no-self-argument
                self.ShowSplashScreen()
                return True

        self.app = BeremizApp(redirect=self.debug)
        self.app.SetAppName('beremiz')
        if wx.VERSION < (3, 0, 0):
            wx.InitAllImageHandlers() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:15,代码来源:Beremiz.py

示例11: OnInit

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def OnInit(self):
        self.SetAppName('plcopeneditor')
        self.ParseCommandLine()
        InstallLocalRessources(beremiz_dir)
        if wx.VERSION < (3, 0, 0):
            wx.InitAllImageHandlers()
        util.ExceptionHandler.AddExceptHook(version.app_version)
        self.frame = PLCOpenEditor(None, fileOpen=self.fileOpen)
        return True 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:11,代码来源:PLCOpenEditor.py

示例12: add_goniometer_controls

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def add_goniometer_controls(self, goniometer):
        from wx.lib.agw import floatspin

        self.distance_ctrl = floatspin.FloatSpin(parent=self, increment=1, digits=2)
        self.distance_ctrl.SetValue(self.settings.detector_distance)
        self.distance_ctrl.Bind(wx.EVT_SET_FOCUS, lambda evt: None)
        if wx.VERSION >= (2, 9):  # XXX FloatSpin bug in 2.9.2/wxOSX_Cocoa
            self.distance_ctrl.SetBackgroundColour(self.GetBackgroundColour())
        box = wx.BoxSizer(wx.HORIZONTAL)
        self.panel_sizer.Add(box)
        label = wx.StaticText(self, -1, "Detector distance")
        box.Add(self.distance_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        box.Add(label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        self.Bind(floatspin.EVT_FLOATSPIN, self.OnChangeSettings, self.distance_ctrl)

        self.rotation_angle_ctrls = []
        if isinstance(goniometer, MultiAxisGoniometer):
            names = goniometer.get_names()
            axes = goniometer.get_axes()
            angles = goniometer.get_angles()
            for name, axis, angle in zip(names, axes, angles):
                ctrl = floatspin.FloatSpin(parent=self, increment=1, digits=3)
                ctrl.SetValue(angle)
                ctrl.Bind(wx.EVT_SET_FOCUS, lambda evt: None)
                if wx.VERSION >= (2, 9):  # XXX FloatSpin bug in 2.9.2/wxOSX_Cocoa
                    ctrl.SetBackgroundColour(self.GetBackgroundColour())
                box = wx.BoxSizer(wx.HORIZONTAL)
                self.panel_sizer.Add(box)
                label = wx.StaticText(self, -1, "%s angle" % name)
                box.Add(ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
                box.Add(label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
                self.Bind(floatspin.EVT_FLOATSPIN, self.OnChangeSettings, ctrl)
                self.rotation_angle_ctrls.append(ctrl) 
开发者ID:dials,项目名称:dials,代码行数:35,代码来源:geometry_viewer.py

示例13: OnSize

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def OnSize(self, event=None):
        self.w, self.h = self.GetClientSize()
        if self.IsShownOnScreen():
            if self.context is not None:
                if wx.VERSION[0] != 3:
                    self.SetCurrent(self.context)
                else:
                    self.SetCurrent()
            gl.glViewport(0, 0, self.w, self.h) 
开发者ID:dials,项目名称:dials,代码行数:11,代码来源:wx_viewer.py

示例14: _init_ctrls

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def _init_ctrls(self, prnt):
        wx.Dialog.__init__(self, id=ID_DCFENTRYVALUESDIALOG,
              name='DCFEntryValuesDialog', parent=prnt, pos=wx.Point(376, 223),
              size=wx.Size(400, 300), style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER,
              title=_('Edit DCF Entry Values'))
        self.SetClientSize(wx.Size(400, 300))

        self.staticText1 = wx.StaticText(id=ID_VARIABLEEDITORPANELSTATICTEXT1,
              label=_('Entry Values:'), name='staticText1', parent=self,
              pos=wx.Point(0, 0), size=wx.Size(95, 17), style=0)

        self.ValuesGrid = wx.grid.Grid(id=ID_DCFENTRYVALUESDIALOGVALUESGRID,
              name='ValuesGrid', parent=self, pos=wx.Point(0, 0), 
              size=wx.Size(0, 150), style=wx.VSCROLL)
        self.ValuesGrid.SetFont(wx.Font(12, 77, wx.NORMAL, wx.NORMAL, False,
              'Sans'))
        self.ValuesGrid.SetLabelFont(wx.Font(10, 77, wx.NORMAL, wx.NORMAL,
              False, 'Sans'))
        self.ValuesGrid.SetRowLabelSize(0)
        self.ValuesGrid.SetSelectionBackground(wx.WHITE)
        self.ValuesGrid.SetSelectionForeground(wx.BLACK)
        if wx.VERSION >= (2, 6, 0):
            self.ValuesGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnValuesGridCellChange)
            self.ValuesGrid.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.OnValuesGridSelectCell)
        else:
            wx.grid.EVT_GRID_CELL_CHANGE(self.ValuesGrid, self.OnValuesGridCellChange)
            wx.grid.EVT_GRID_SELECT_CELL(self.ValuesGrid, self.OnValuesGridSelectCell)
        
        self.AddButton = wx.Button(id=ID_DCFENTRYVALUESDIALOGADDBUTTON, label=_('Add'),
              name='AddButton', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(72, 32), style=0)
        self.Bind(wx.EVT_BUTTON, self.OnAddButton, id=ID_DCFENTRYVALUESDIALOGADDBUTTON)

        self.DeleteButton = wx.Button(id=ID_DCFENTRYVALUESDIALOGDELETEBUTTON, label=_('Delete'),
              name='DeleteButton', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(72, 32), style=0)
        self.Bind(wx.EVT_BUTTON, self.OnDeleteButton, id=ID_DCFENTRYVALUESDIALOGDELETEBUTTON)

        self.UpButton = wx.Button(id=ID_DCFENTRYVALUESDIALOGUPBUTTON, label='^',
              name='UpButton', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(32, 32), style=0)
        self.Bind(wx.EVT_BUTTON, self.OnUpButton, id=ID_DCFENTRYVALUESDIALOGUPBUTTON)

        self.DownButton = wx.Button(id=ID_DCFENTRYVALUESDIALOGDOWNBUTTON, label='v',
              name='DownButton', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(32, 32), style=0)
        self.Bind(wx.EVT_BUTTON, self.OnDownButton, id=ID_DCFENTRYVALUESDIALOGDOWNBUTTON)

        self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTRE)
        
        self._init_sizers() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:53,代码来源:commondialogs.py

示例15: main

# 需要导入模块: import wx [as 别名]
# 或者: from wx import VERSION [as 别名]
def main(argv):
  adm.app = app
  adm.loaddir=os.path.dirname(os.path.abspath(argv[0]))
  SetLoaddir(adm.loaddir)


  _dn, an=os.path.split(argv[0])
  dot=an.rfind('.')
  if dot > 0:
    adm.appname=an[0:dot]
  else:
    adm.appname=an

  sys.excepthook=LoggerExceptionHook
  if wx.VERSION < (2,9):
    logger.debug("Using old wxPython version %s", wx.version())
  modules=[]

  if sys.platform == "darwin":    macOpt="p"
  else:                           macOpt=""
  opts, args = getopt.getopt(argv[1:], "m:n:%s" % macOpt, ["modules=", "name="])
  for opt in opts:
    if opt[0] in ['-m', '--modules']:
      modules = map(lambda x: "mod%s" % x.capitalize(), opt[1].split(','))
    elif opt[0] in ['-n', '--name']:
      adm.appname=opt[1]
    elif opt[0] == '-p':
      pass
  
  app.SetAppName(adm.appname)
  adm.config=config.Config(adm.appname)
  frame.LoggingDialog.Init()

  adm.appTitle=adm.config.Read("Title", adm.appname.title())
  if wx.VERSION > (2,9):
    app.SetAppDisplayName(adm.appTitle)
    from version import vendor, vendorDisplay
    app.SetVendorName(vendor)
    app.SetVendorDisplayName(vendorDisplay)

  
#  if not modules:
#    modules=adm.config.Read("Modules", [])
  if not modules:
    dot=adm.appname.find('-')
    if dot>0:
      modules=["mod" + adm.appname[:dot].capitalize()]

  loadModules(modules)
  xmlres.init(adm.loaddir)

  adm.mainframe=frame.DetailFrame(None, adm.appTitle, args)
  app.SetTopWindow(adm.mainframe)

  for panelclass in adm.getAllPreferencePanelClasses():
    if hasattr(panelclass, "Init"):
      panelclass.Init()

  adm.mainframe.Show()

  app.MainLoop() 
开发者ID:andreas-p,项目名称:admin4,代码行数:63,代码来源:main.py


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