本文整理汇总了Python中wx.WANTS_CHARS属性的典型用法代码示例。如果您正苦于以下问题:Python wx.WANTS_CHARS属性的具体用法?Python wx.WANTS_CHARS怎么用?Python wx.WANTS_CHARS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.WANTS_CHARS属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, parent, id):
wx.Panel.__init__(
self, parent, id,
# wxMSW/Windows does not seem to support
# wx.NO_BORDER, which sucks
style = wx.WANTS_CHARS | wx.NO_BORDER)
hsizer = wx.BoxSizer(wx.HORIZONTAL)
self.scrollBar = wx.ScrollBar(self, -1, style = wx.SB_VERTICAL)
self.ctrl = MyCtrl(self, -1)
hsizer.Add(self.ctrl, 1, wx.EXPAND)
hsizer.Add(self.scrollBar, 0, wx.EXPAND)
wx.EVT_COMMAND_SCROLL(self, self.scrollBar.GetId(),
self.ctrl.OnScroll)
wx.EVT_SET_FOCUS(self.scrollBar, self.OnScrollbarFocus)
self.SetSizer(hsizer)
# we never want the scrollbar to get the keyboard focus, pass it on to
# the main widget
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, parent, nodelist):
Grid.__init__(self, parent, style=wx.WANTS_CHARS)
self.CreateGrid( 0, 2, wx.grid.Grid.SelectRows)
self.SetColLabelValue(0, _("Host"))
self.SetColLabelValue(1, _("Port"))
self.SetColRenderer(1, wx.grid.GridCellNumberRenderer())
self.SetColEditor(1, wx.grid.GridCellNumberEditor(0, 65535))
self.SetColLabelSize(self.GetTextExtent("l")[1]+4)
self.SetRowLabelSize(1)
self.SetSize((1000,1000))
self.storing = False
self.Bind(wx.grid.EVT_GRID_CMD_CELL_CHANGE, self.store_value)
self.append_node(('router.bittorrent.com', '65536'))
for i, e in enumerate(nodelist.split(',')):
host, port = e.split(':')
self.append_node((host,port))
self.append_node(('',''))
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, parent, owner, items=None):
style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.WANTS_CHARS
wx.Dialog.__init__(self, parent, -1, _("Menu editor"), style=style)
self.create_gui()
self.bind_event_handlers()
self._set_tooltips()
self.owner = owner
import re
self.handler_re = self.name_re = re.compile(r'^[a-zA-Z_]+[\w-]*(\[\w*\])*$')
self.selected_index = -1 # index of the selected element in the wx.ListCtrl menu_items
self._ignore_events = False
if items:
self.add_items(items)
self._select_item(0)
else:
self._enable_fields(False)
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, parent, owner, items=None):
style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.WANTS_CHARS
wx.Dialog.__init__(self, parent, -1, _("Toolbar editor"), style=style)
self.create_gui()
self.bind_event_handlers()
self._set_tooltips()
self.owner = owner
self.handler_re = self.name_re = re.compile(r'^[a-zA-Z_]+[\w-]*(\[\w*\])*$')
self.selected_index = -1 # index of the selected element in the wx.ListCtrl menu_items
self._ignore_events = False
if items:
self.add_items(items)
self._select_item(0)
else:
self._enable_fields(False)
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, parent, text, title, validateFunc = None):
wx.Dialog.__init__(self, parent, -1, title,
style = wx.DEFAULT_DIALOG_STYLE | wx.WANTS_CHARS)
# function to call to validate the input string on OK. can be
# None, in which case it is not called. if it returns "", the
# input is valid, otherwise the string it returns is displayed in
# a message box and the dialog is not closed.
self.validateFunc = validateFunc
vsizer = wx.BoxSizer(wx.VERTICAL)
vsizer.Add(wx.StaticText(self, -1, text), 1, wx.EXPAND | wx.BOTTOM, 5)
self.tc = wx.TextCtrl(self, -1, style = wx.TE_PROCESS_ENTER)
vsizer.Add(self.tc, 1, wx.EXPAND);
vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
hsizer = wx.BoxSizer(wx.HORIZONTAL)
cancelBtn = gutil.createStockButton(self, "Cancel")
hsizer.Add(cancelBtn)
okBtn = gutil.createStockButton(self, "OK")
hsizer.Add(okBtn, 0, wx.LEFT, 10)
vsizer.Add(hsizer, 0, wx.EXPAND | wx.TOP, 5)
util.finishWindow(self, vsizer)
wx.EVT_BUTTON(self, cancelBtn.GetId(), self.OnCancel)
wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)
wx.EVT_TEXT_ENTER(self, self.tc.GetId(), self.OnOK)
wx.EVT_CHAR(self.tc, self.OnCharEntry)
wx.EVT_CHAR(cancelBtn, self.OnCharButton)
wx.EVT_CHAR(okBtn, self.OnCharButton)
self.tc.SetFocus()
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, torrent, parent, *a, **k):
self.torrent = torrent
k['style'] = k.get('style', wx.DEFAULT_FRAME_STYLE) | wx.WANTS_CHARS
BTFrameWithSizer.__init__(self, parent, *a, **k)
self.Bind(wx.EVT_CLOSE, self.close)
self.Bind(wx.EVT_CHAR, self.key)
self.panel.BindChildren(wx.EVT_CHAR, self.key)
if sys.platform == 'darwin':
self.sizer.AddSpacer((0, 14))
self.sizer.Layout()
self.Fit()
self.SetMinSize(self.GetSize())
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, main_window, config, setfunc):
BTDialog.__init__(self, main_window, style=wx.DEFAULT_DIALOG_STYLE|wx.CLIP_CHILDREN|wx.WANTS_CHARS)
self.Bind(wx.EVT_CLOSE, self.close)
self.Bind(wx.EVT_CHAR, self.key)
self.SetTitle(_("%s Settings")%app_name)
self.setfunc = setfunc
self.config = config
self.notebook = wx.Notebook(self)
self.notebook.Bind(wx.EVT_CHAR, self.key)
self.general_panel = GeneralSettingsPanel(self.notebook)
self.saving_panel = SavingSettingsPanel(self.notebook)
self.network_panel = NetworkSettingsPanel(self.notebook)
self.appearance_panel = AppearanceSettingsPanel(self.notebook)
self.language_panel = LanguageSettingsPanel(self.notebook)
self.vbox = VSizer()
self.vbox.AddFirst(self.notebook, proportion=1, flag=wx.GROW)
self.vbox.Layout()
self.SetSizerAndFit(self.vbox)
self.SetFocus()
示例8: _MakeDateEditor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def _MakeDateEditor(olv, rowIndex, subItemIndex):
dte = DateEditor(olv, style=wx.DP_DROPDOWN | wx.DP_SHOWCENTURY | wx.WANTS_CHARS)
#dte.SetValidator(MyValidator(olv))
return dte
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, parent, appstyle, clientpanel):
"""Constructor. Create a smartcard and reader tree control on the
left-hand side of the application main frame.
@param parent: the tree panel parent
@param appstyle: a combination of the following styles (bitwise or |)
- TR_SMARTCARD: display a smartcard tree panel
- TR_READER: display a reader tree panel
- default is TR_DEFAULT = TR_SMARTCARD
@param clientpanel: the client panel to notify of smartcard and reader events
"""
wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS)
sizer = wx.BoxSizer(wx.VERTICAL)
# create the smartcard tree
if appstyle & smartcard.wx.SimpleSCardApp.TR_SMARTCARD:
self.cardtreectrl = CardTreeCtrl(self, clientpanel=clientpanel)
# create the smartcard insertion observer
self.cardtreecardobserver = self._CardObserver(self.cardtreectrl)
# register as a CardObserver; we will ge
# notified of added/removed cards
self.cardmonitor = CardMonitor()
self.cardmonitor.addObserver(self.cardtreecardobserver)
sizer.Add(
self.cardtreectrl, flag=wx.EXPAND | wx.ALL, proportion=1)
# create the reader tree
if appstyle & smartcard.wx.SimpleSCardApp.TR_READER:
self.readertreectrl = ReaderTreeCtrl(
self, clientpanel=clientpanel)
# create the reader insertion observer
self.readertreereaderobserver = self._ReaderObserver(
self.readertreectrl)
# register as a ReaderObserver; we will ge
# notified of added/removed readers
self.readermonitor = ReaderMonitor()
self.readermonitor.addObserver(self.readertreereaderobserver)
# create the smartcard insertion observer
self.readertreecardobserver = self._CardObserver(
self.readertreectrl)
# register as a CardObserver; we will get
# notified of added/removed cards
self.cardmonitor = CardMonitor()
self.cardmonitor.addObserver(self.readertreecardobserver)
sizer.Add(
self.readertreectrl, flag=wx.EXPAND | wx.ALL, proportion=1)
self.SetSizer(sizer)
self.SetAutoLayout(True)
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WANTS_CHARS [as 别名]
def __init__(self, url, icon, title, size):
self.browser = None
# Must ignore X11 errors like 'BadWindow' and others by
# installing X11 error handlers. This must be done after
# wx was intialized.
if LINUX:
cef.WindowUtils.InstallX11ErrorHandlers()
global g_count_windows
g_count_windows += 1
if WINDOWS:
# noinspection PyUnresolvedReferences, PyArgumentList
logging.debug("[wxpython.py] System DPI settings: %s"
% str(cef.DpiAware.GetSystemDpi()))
if hasattr(wx, "GetDisplayPPI"):
logging.debug("[wxpython.py] wx.GetDisplayPPI = %s" % wx.GetDisplayPPI())
logging.debug("[wxpython.py] wx.GetDisplaySize = %s" % wx.GetDisplaySize())
logging.debug("[wxpython.py] MainFrame DPI scaled size: %s" % str(size))
wx.Frame.__init__(self, parent=None, id=wx.ID_ANY,
title=title)
# wxPython will set a smaller size when it is bigger
# than desktop size.
logging.debug("[wxpython.py] MainFrame actual size: %s" % self.GetSize())
ic = wx.Icon(icon, wx.BITMAP_TYPE_ICO)
self.SetIcon(ic)
self.Bind(wx.EVT_CLOSE, self.OnClose)
# Set wx.WANTS_CHARS style for the keyboard to work.
# This style also needs to be set for all parent controls.
self.browser_panel = wx.Panel(self, size=tuple(size))
self.browser_panel.Bind(wx.EVT_SIZE, self.OnSize)
wx.Window.Fit(self)
if MAC:
# Make the content view for the window have a layer.
# This will make all sub-views have layers. This is
# necessary to ensure correct layer ordering of all
# child views and their layers. This fixes Window
# glitchiness during initial loading on Mac (Issue #371).
NSApp.windows()[0].contentView().setWantsLayer_(True)
if LINUX:
self.Show()
self.embed_browser(url)
else:
self.embed_browser(url)
self.Show()