本文整理汇总了Python中wx.TE_PROCESS_ENTER属性的典型用法代码示例。如果您正苦于以下问题:Python wx.TE_PROCESS_ENTER属性的具体用法?Python wx.TE_PROCESS_ENTER怎么用?Python wx.TE_PROCESS_ENTER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.TE_PROCESS_ENTER属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self):
wx.Frame.__init__(self, None,
pos=wx.DefaultPosition, size=wx.Size(450, 100),
style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION |
wx.CLOSE_BOX | wx.CLIP_CHILDREN,
title="BRUNO")
panel = wx.Panel(self)
ico = wx.Icon('boy.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(ico)
my_sizer = wx.BoxSizer(wx.VERTICAL)
lbl = wx.StaticText(panel,
label="Bienvenido Sir. How can I help you?")
my_sizer.Add(lbl, 0, wx.ALL, 5)
self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER,
size=(400, 30))
self.txt.SetFocus()
self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
my_sizer.Add(self.txt, 0, wx.ALL, 5)
panel.SetSizer(my_sizer)
self.Show()
speak.Speak('''Welcome back Sir, Broono at your service.''')
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, parent, label, param):
self.sliderLabel = wx.StaticText(parent, label=label)
self.sliderText = wx.TextCtrl(parent, -1, style=wx.TE_PROCESS_ENTER)
self.slider = wx.Slider(parent, -1)
# self.slider.SetMax(param.maximum*1000)
self.slider.SetRange(0, param.maximum * 1000)
self.setKnob(param.value)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.sliderLabel, 0,
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL,
border=2)
sizer.Add(self.sliderText, 0,
wx.EXPAND | wx.ALIGN_CENTER | wx.ALL,
border=2)
sizer.Add(self.slider, 1, wx.EXPAND)
self.sizer = sizer
self.slider.Bind(wx.EVT_SLIDER, self.sliderHandler)
self.sliderText.Bind(wx.EVT_TEXT_ENTER, self.sliderTextHandler)
self.param = param
self.param.attach(self)
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, parent, default_text, visit_url_func):
wx.TextCtrl.__init__(self, parent, size=(150,-1), style=wx.TE_PROCESS_ENTER|wx.TE_RICH)
self.default_text = default_text
self.visit_url_func = visit_url_func
self.reset_text(force=True)
self._task = TaskSingleton()
event = wx.SizeEvent((150, -1), self.GetId())
wx.PostEvent(self, event)
self.old = self.GetValue()
self.Bind(wx.EVT_TEXT, self.begin_edit)
self.Bind(wx.EVT_SET_FOCUS, self.begin_edit)
def focus_lost(event):
gui_wrap(self.reset_text)
self.Bind(wx.EVT_KILL_FOCUS, focus_lost)
self.Bind(wx.EVT_TEXT_ENTER, self.search)
示例4: create_text_ctrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def create_text_ctrl(self, panel, value):
style = 0
if self.readonly: style = wx.TE_READONLY
if self.multiline: style |= wx.TE_MULTILINE
else: style |= wx.TE_PROCESS_ENTER
if not self._HORIZONTAL_LAYOUT: style |= wx.HSCROLL
if self.multiline=="grow":
text = ExpandoTextCtrl( panel, -1, value or "", style=style )
#text.Bind(EVT_ETC_LAYOUT_NEEDED, self.on_layout_needed)
text.SetWindowStyle(wx.TE_MULTILINE | wx.TE_RICH2)
text.SetMaxHeight(200)
else:
text = wx.TextCtrl( panel, -1, value or "", style=style )
# bind KILL_FOCUS and Enter for non-multilines
text.Bind(wx.EVT_KILL_FOCUS, self.on_kill_focus)
text.Bind(wx.EVT_SET_FOCUS, self.on_focus)
# XXX
text.Bind(wx.EVT_CHAR, self.on_char)
text.Bind(wx.EVT_TEXT, self._on_text)
return text
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"控制台日志", pos=wx.DefaultPosition, size=wx.Size(500, 500),
style=wx.DEFAULT_DIALOG_STYLE)
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
sizer_global = wx.BoxSizer(wx.VERTICAL)
self.textctrl_log = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(427, 381),
wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB)
# self.listctrl_log = ListCtrl_DLLog(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_REPORT)
sizer_global.Add(self.textctrl_log, 1, wx.ALL | wx.EXPAND, 5)
self.SetSizer(sizer_global)
self.Layout()
self.Centre(wx.BOTH)
self.Bind(wx.EVT_CLOSE, self.onClose)
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: Terminal.__init__
kwds["style"] = kwds.get("style",
0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_NO_TASKBAR | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((915, 424))
self.text_main = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_BESTWRAP | wx.TE_MULTILINE | wx.TE_READONLY)
self.text_entry = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_TEXT_ENTER, self.on_entry, self.text_entry)
# end wxGlade
self.Bind(wx.EVT_CLOSE, self.on_close, self)
self.pipe = None
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: Terminal.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_NO_TASKBAR | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((581, 410))
self.text_main = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_BESTWRAP | wx.TE_MULTILINE | wx.TE_READONLY)
self.text_entry = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB)
self.__set_properties()
self.__do_layout()
# self.Bind(wx.EVT_TEXT, self.on_key_down, self.text_entry)
self.Bind(wx.EVT_CHAR_HOOK, self.on_key_down, self.text_entry)
self.Bind(wx.EVT_TEXT_ENTER, self.on_entry, self.text_entry)
# end wxGlade
self.Bind(wx.EVT_CLOSE, self.on_close, self)
self.pipe = None
self.command_log = []
self.command_position = 0
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, parent):
wx.PyControl.__init__(self, parent)
main_sizer = wx.FlexGridSizer(cols=2, hgap=0, rows=1, vgap=0)
main_sizer.AddGrowableCol(0)
main_sizer.AddGrowableRow(0)
# create location text control
self.Duration = wx.TextCtrl(self, size=wx.Size(0, -1),
style=wx.TE_PROCESS_ENTER)
self.Duration.Bind(wx.EVT_KEY_DOWN, self.OnDurationChar)
main_sizer.AddWindow(self.Duration, flag=wx.GROW)
# create browse button
self.EditButton = wx.Button(self, label='...', size=wx.Size(30, -1))
self.Bind(wx.EVT_BUTTON, self.OnEditButtonClick, self.EditButton)
main_sizer.AddWindow(self.EditButton, flag=wx.GROW)
self.Bind(wx.EVT_SIZE, self.OnSize)
self.SetSizer(main_sizer)
self.Default = None
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, olv, subItemIndex, **kwargs):
style = wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB
# Allow for odd case where parent isn't an ObjectListView
if hasattr(olv, "columns"):
if olv.HasFlag(wx.LC_ICON):
style |= (wx.TE_CENTRE | wx.TE_MULTILINE)
else:
style |= olv.columns[subItemIndex].GetAlignmentForText()
wx.TextCtrl.__init__(self, olv, style=style, size=(0,0), **kwargs)
# With the MULTILINE flag, the text control always has a vertical
# scrollbar, which looks stupid. I don't know how to get rid of it.
# This doesn't do it:
# self.ToggleWindowStyle(wx.VSCROLL)
#----------------------------------------------------------------------------
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [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()
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, parent, interpreter):
# begin wxGlade: MyFrame.__init__
wx.Panel.__init__(self, parent, -1)
self.history = []
self.index = 0
self.prompt = ">>"
self.textctrl = wx.TextCtrl(self, -1, '', style=wx.TE_PROCESS_ENTER | wx.TE_MULTILINE | wx.TE_RICH, size=(-1, 250))
self.textctrl.SetForegroundColour(wx.WHITE)
self.textctrl.SetBackgroundColour(wx.BLACK)
self.textctrl.AppendText(self.prompt)
self.textctrl.Bind(wx.EVT_CHAR, self.__bind_events)
sizer = wx.BoxSizer()
sizer.Add(self.textctrl, 1, wx.EXPAND)
self.SetSizer(sizer)
self._interp = interpreter
redir = RedirectText(self.textctrl)
import sys
# Create a replacement for stdin.
# self.reader = PseudoFileIn(self.readline, self.readlines)
# self.reader.input = ''
# self.reader.isreading = False
# sys.stdin=self.reader
sys.stdout = redir
sys.stderr = redir
示例12: create_spin_ctrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def create_spin_ctrl(self, panel):
style = wx.TE_PROCESS_ENTER | wx.SP_ARROW_KEYS
spin = wx.SpinCtrl( panel, -1, style=style, min=self.val_range[0], max=self.val_range[1] )
val = self.value
if not val: spin.SetValue(1) # needed for GTK to display a '0'
spin.SetValue(val)
spin.SetSelection(-1,-1)
return spin
示例13: _create_spin_ctrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def _create_spin_ctrl(self, panel):
style = wx.TE_PROCESS_ENTER | wx.SP_ARROW_KEYS
self.spin = wx.SpinCtrl( panel, -1, style=style, min=self.val_range[0], max=self.val_range[1] )
val = self.value
if not val: self.spin.SetValue(1) # needed for GTK to display a '0'
self.spin.SetValue(val)
示例14: create_editor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def create_editor(self, panel, sizer):
if not _is_gridbag(self.owner.parent): return
max_rows, max_cols = self.owner.parent.check_span_range(self.owner.index, *self.value)
hsizer = wx.BoxSizer(wx.HORIZONTAL)
# label
self.label_ctrl = label = self._get_label(self._find_label(), panel)
hsizer.Add(label, 0, wx.ALL | wx.ALIGN_CENTER, 3)
# checkbox, if applicable
self.enabler = None
style = wx.TE_PROCESS_ENTER | wx.SP_ARROW_KEYS
self.rowspin = wx.SpinCtrl( panel, -1, style=style, min=1, max=max_rows) # don't set size here as the
self.colspin = wx.SpinCtrl( panel, -1, style=style, min=1, max=max_cols) # combination withe SetSelection fails
val = self.value
self.rowspin.SetValue(val and val[0] or 1)
self.colspin.SetValue(val and val[1] or 1)
self.rowspin.Enable(max_rows!=1)
self.colspin.Enable(max_cols!=1)
self.rowspin.SetSelection(-1, -1)
self.colspin.SetSelection(-1, -1)
# layout of the controls / sizers; when adding the spins, set min size as well
hsizer.Add(wx.StaticText(panel, -1, _("Rows:")), 1, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 3)
si = hsizer.Add(self.rowspin, 5, wx.ALL | wx.ALIGN_CENTER, 3).SetMinSize( (30,-1) )
hsizer.Add(wx.StaticText(panel, -1, _("Cols:")), 1, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 3)
hsizer.Add(self.colspin, 5, wx.ALL | wx.ALIGN_CENTER, 3).SetMinSize( (30,-1) )
sizer.Add(hsizer, 0, wx.EXPAND)
self._set_tooltip(label, self.rowspin, self.colspin)
self.rowspin.Bind(wx.EVT_KILL_FOCUS, self.on_kill_focus) # by default, the value is only set when the focus is lost
self.colspin.Bind(wx.EVT_KILL_FOCUS, self.on_kill_focus)
self.rowspin.Bind(wx.EVT_SET_FOCUS, self.on_focus)
self.colspin.Bind(wx.EVT_SET_FOCUS, self.on_focus)
if self.immediate:
self.rowspin.Bind(wx.EVT_SPINCTRL, self.on_spin)
self.rowspin.Bind(wx.EVT_TEXT_ENTER, self.on_spin) # we want the enter key (see style above)
self.colspin.Bind(wx.EVT_SPINCTRL, self.on_spin)
self.colspin.Bind(wx.EVT_TEXT_ENTER, self.on_spin)
self.editing = True
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_PROCESS_ENTER [as 别名]
def __init__(self, parent, ID, label, initval):
wx.Panel.__init__(self, parent, ID)
self.value = initval
box = wx.StaticBox(self, -1, label)
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
self.radio_auto = wx.RadioButton(self, -1,
label="Auto", style=wx.RB_GROUP)
self.radio_manual = wx.RadioButton(self, -1,
label="Manual")
self.manual_text = wx.TextCtrl(self, -1,
size=(35,-1),
value=str(initval),
style=wx.TE_PROCESS_ENTER)
self.Bind(wx.EVT_UPDATE_UI, self.on_update_manual_text, self.manual_text)
self.Bind(wx.EVT_TEXT_ENTER, self.on_text_enter, self.manual_text)
manual_box = wx.BoxSizer(wx.HORIZONTAL)
manual_box.Add(self.radio_manual, flag=wx.ALIGN_CENTER_VERTICAL)
manual_box.Add(self.manual_text, flag=wx.ALIGN_CENTER_VERTICAL)
sizer.Add(self.radio_auto, 0, wx.ALL, 10)
sizer.Add(manual_box, 0, wx.ALL, 10)
self.SetSizer(sizer)
sizer.Fit(self)