本文整理汇总了Python中wx.EVT_TEXT_ENTER属性的典型用法代码示例。如果您正苦于以下问题:Python wx.EVT_TEXT_ENTER属性的具体用法?Python wx.EVT_TEXT_ENTER怎么用?Python wx.EVT_TEXT_ENTER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.EVT_TEXT_ENTER属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_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 EVT_TEXT_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 EVT_TEXT_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: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_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
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_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
示例6: AddSizerParams
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_ENTER [as 别名]
def AddSizerParams(self, parent, sizer, params):
for idx, (name, label) in enumerate(params):
border = 0
if idx == 0:
border |= wx.TOP
elif idx == len(params) - 1:
border |= wx.BOTTOM
st = wx.StaticText(parent, label=label)
sizer.AddWindow(st, border=10,
flag=wx.ALIGN_CENTER_VERTICAL | border | wx.LEFT)
tc = wx.TextCtrl(parent, style=wx.TE_PROCESS_ENTER)
setattr(self, name, tc)
callback = self.GetTextCtrlChangedFunction(tc, name)
self.Bind(wx.EVT_TEXT_ENTER, callback, tc)
tc.Bind(wx.EVT_KILL_FOCUS, callback)
sizer.AddWindow(tc, border=10,
flag=wx.GROW | border | wx.RIGHT)
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_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()
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_ENTER [as 别名]
def __init__(self, parent, style):
wx.PopupTransientWindow.__init__(self, parent, style)
self.preview = parent
pnl = wx.Panel(self)
# pnl.SetBackgroundColour("CADET BLUE")
st = wx.StaticText(pnl, -1,
"Enter the size of adjacent bezels and gap\n"
"in millimeters:")
# self.tc_bez = wx.TextCtrl(pnl, -1, size=(100, -1))
self.tc_bez = wx.TextCtrl(pnl, -1, style=wx.TE_RIGHT|wx.TE_PROCESS_ENTER)
self.tc_bez.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
self.current_bez_val = None
butt_save = wx.Button(pnl, label="Apply")
butt_canc = wx.Button(pnl, label="Cancel")
butt_save.Bind(wx.EVT_BUTTON, self.onApply)
butt_canc.Bind(wx.EVT_BUTTON, self.onCancel)
butt_sizer = wx.BoxSizer(wx.HORIZONTAL)
# butt_sizer.AddStretchSpacer()
butt_sizer.Add(self.tc_bez, 0, wx.ALL, 5)
butt_sizer.Add(butt_save, 0, wx.ALL, 5)
butt_sizer.Add(butt_canc, 0, wx.ALL, 5)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(st, 0, wx.ALL, 5)
# sizer.Add(self.tc_bez, 0, wx.ALL, 5)
sizer.Add(butt_sizer, 0, wx.ALL|wx.EXPAND, 0)
pnl.SetSizer(sizer)
sizer.Fit(pnl)
sizer.Fit(self)
self.Layout()
示例9: create_editor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_ENTER [as 别名]
def create_editor(self, panel, sizer):
if self.val_range is None:
self.val_range = (0, 1000)
hsizer = wx.BoxSizer(wx.HORIZONTAL)
# label
label_text = self._find_label()
label = self.label_ctrl = self._get_label(label_text, panel)
hsizer.Add(label, 0, wx.ALL | wx.ALIGN_CENTER, 3)
# checkbox, if applicable
self.enabler = None
if self.deactivated is not None:
self.enabler = wx.CheckBox(panel, -1, '')
if config.preferences.use_checkboxes_workaround:
size = self.enabler.GetSize()
self.enabler.SetLabel("Enable %s"%label_text)
self.enabler.SetMaxSize(size)
self.enabler.SetValue(not self.deactivated)
self.enabler.Bind( wx.EVT_CHECKBOX, lambda event: self.toggle_active(event.IsChecked()) )
hsizer.Add(self.enabler, 0, wx.ALIGN_CENTER_VERTICAL|wx.LEFT, 3)
self.spin = self.create_spin_ctrl(panel)
if self.deactivated is not None:
self.spin.Enable(not self.deactivated)
elif self.blocked or self.readonly:
self.spin.Enable(False)
# layout of the controls / sizers
hsizer.Add(self.spin, 5, wx.ALL | wx.ALIGN_CENTER, 3)
sizer.Add(hsizer, 0, wx.EXPAND)
self._set_tooltip(label, self.spin, self.enabler)
self.spin.Bind(wx.EVT_KILL_FOCUS, self.on_kill_focus) # by default, the value is only set when the focus is lost
self.spin.Bind(wx.EVT_SET_FOCUS, self.on_focus)
if wx.Platform == '__WXMAC__' or self.immediate:
self.spin.Bind(wx.EVT_SPINCTRL, self.on_spin)
self.spin.Bind(wx.EVT_TEXT_ENTER, self.on_spin) # we want the enter key (see style above)
self.editing = True
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_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)
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_ENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: ImageProperty.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((276, 218))
self.spin_step_size = wx.SpinCtrl(self, wx.ID_ANY, "1", min=1, max=63)
self.combo_dpi = wx.ComboBox(self, wx.ID_ANY,
choices=["1000", "500", "333", "250", "200", "166", "142", "125", "111", "100"],
style=wx.CB_DROPDOWN)
self.text_x = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_y = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_width = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_height = wx.TextCtrl(self, wx.ID_ANY, "")
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_SPINCTRL, self.on_spin_step, self.spin_step_size)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_step, self.spin_step_size)
self.Bind(wx.EVT_COMBOBOX, self.on_combo_dpi, self.combo_dpi)
self.Bind(wx.EVT_TEXT, self.on_text_x, self.text_x)
self.Bind(wx.EVT_TEXT_ENTER, self.on_text_x, self.text_x)
self.Bind(wx.EVT_TEXT, self.on_text_y, self.text_y)
self.Bind(wx.EVT_TEXT_ENTER, self.on_text_y, self.text_y)
self.Bind(wx.EVT_TEXT, self.on_text_width, self.text_width)
self.Bind(wx.EVT_TEXT_ENTER, self.on_text_width, self.text_width)
self.Bind(wx.EVT_TEXT, self.on_text_height, self.text_height)
self.Bind(wx.EVT_TEXT_ENTER, self.on_text_height, self.text_height)
# end wxGlade
self.image_element = None
self.Bind(wx.EVT_CLOSE, self.on_close, self)
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_ENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: EngraveProperty.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((305, 216))
self.spin_speed_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "20.0", min=0.0, max=240.0)
self.spin_power_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "1000.0", min=0.0, max=1000.0)
self.checkbox_custom_d_ratio = wx.CheckBox(self, wx.ID_ANY, _("Custom D-Ratio"))
self.spin_speed_dratio = wx.SpinCtrlDouble(self, wx.ID_ANY, "0.261", min=0.0, max=1.0)
self.checkbox_custom_accel = wx.CheckBox(self, wx.ID_ANY, _("Acceleration Override"))
self.slider_accel = wx.Slider(self, wx.ID_ANY, 1, 1, 4, style=wx.SL_AUTOTICKS | wx.SL_LABELS)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_CHECKBOX, self.on_check_custom_d_ratio, self.checkbox_custom_d_ratio)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_TEXT, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_CHECKBOX, self.on_check_custom_accel, self.checkbox_custom_accel)
self.Bind(wx.EVT_COMMAND_SCROLL, self.on_slider_accel, self.slider_accel)
self.operation = None
self.Bind(wx.EVT_CLOSE, self.on_close, self)
示例13: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_ENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: RasterProperty.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((359, 355))
self.spin_speed_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "200.0", min=0.0, max=500.0)
self.spin_power_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "1000.0", min=0.0, max=1000.0)
self.spin_step_size = wx.SpinCtrl(self, wx.ID_ANY, "1", min=0, max=63)
self.combo_raster_direction = wx.ComboBox(self, wx.ID_ANY, choices=[_("Top To Bottom"), _("Bottom To Top"), _("Right To Left"), _("Left To Right")], style=wx.CB_DROPDOWN)
self.spin_overscan_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "20.0", min=0.0, max=1000.0)
self.radio_directional_raster = wx.RadioBox(self, wx.ID_ANY, _("Directional Raster"), choices=[_("Bidirectional"), _("Unidirectional")], majorDimension=2, style=wx.RA_SPECIFY_ROWS)
self.radio_corner = wx.RadioBox(self, wx.ID_ANY, _("Start Corner"), choices=[" ", " ", " ", " "], majorDimension=2, style=wx.RA_SPECIFY_ROWS)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_SPINCTRL, self.on_spin_step, self.spin_step_size)
self.Bind(wx.EVT_TEXT, self.on_spin_step, self.spin_step_size)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_step, self.spin_step_size)
self.Bind(wx.EVT_COMBOBOX, self.on_combo_raster_direction, self.combo_raster_direction)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_overscan, self.spin_overscan_set)
self.Bind(wx.EVT_TEXT, self.on_spin_overscan, self.spin_overscan_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_overscan, self.spin_overscan_set)
self.Bind(wx.EVT_RADIOBOX, self.on_radio_directional, self.radio_directional_raster)
self.Bind(wx.EVT_RADIOBOX, self.on_radio_corner, self.radio_corner)
# end wxGlade
self.operation = None
self.Bind(wx.EVT_CLOSE, self.on_close, self)
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_ENTER [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: CutProperty.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((305, 216))
self.spin_speed_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "10.0", min=0.0, max=240.0)
self.spin_power_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "1000.0", min=0.0, max=1000.0)
self.checkbox_custom_d_ratio = wx.CheckBox(self, wx.ID_ANY, _("Custom D-Ratio"))
self.spin_speed_dratio = wx.SpinCtrlDouble(self, wx.ID_ANY, "0.261", min=0.0, max=1.0)
self.checkbox_custom_accel = wx.CheckBox(self, wx.ID_ANY, _("Acceleration Override"))
self.slider_accel = wx.Slider(self, wx.ID_ANY, 1, 1, 4, style=wx.SL_AUTOTICKS | wx.SL_LABELS)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_TEXT, self.on_spin_speed, self.spin_speed_set)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_TEXT, self.on_spin_power, self.spin_power_set)
self.Bind(wx.EVT_CHECKBOX, self.on_check_custom_d_ratio, self.checkbox_custom_d_ratio)
self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_TEXT, self.on_spin_speed_dratio, self.spin_speed_dratio)
self.Bind(wx.EVT_CHECKBOX, self.on_check_custom_accel, self.checkbox_custom_accel)
self.Bind(wx.EVT_COMMAND_SCROLL, self.on_slider_accel, self.slider_accel)
self.operation = None
self.Bind(wx.EVT_CLOSE, self.on_close, self)
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT_ENTER [as 别名]
def __init__(self, parent, choices=None, dropDownClick=True,
element_path=None, **therest):
"""
Constructor works just like wx.TextCtrl except you can pass in a
list of choices. You can also change the choice list at any time
by calling setChoices.
"""
therest['style'] = wx.TE_PROCESS_ENTER | therest.get('style', 0)
wx.TextCtrl.__init__(self, parent, **therest)
# Some variables
self._dropDownClick = dropDownClick
self._lastinsertionpoint = None
self._hasfocus = False
self._screenheight = wx.SystemSettings.GetMetric(wx.SYS_SCREEN_Y)
self.element_path = element_path
self.listbox = None
self.SetChoices(choices)
# gp = self
# while ( gp != None ) :
# gp.Bind ( wx.EVT_MOVE , self.onControlChanged, gp )
# gp.Bind ( wx.EVT_SIZE , self.onControlChanged, gp )
# gp = gp.GetParent()
self.Bind(wx.EVT_KILL_FOCUS, self.OnControlChanged)
self.Bind(wx.EVT_TEXT_ENTER, self.OnControlChanged)
self.Bind(wx.EVT_TEXT, self.OnEnteredText)
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
# If need drop down on left click
if dropDownClick:
self.Bind(wx.EVT_LEFT_DOWN, self.OnClickToggleDown)
self.Bind(wx.EVT_LEFT_UP, self.OnClickToggleUp)