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


Python wx.EVT_TEXT属性代码示例

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


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

示例1: addMarginCtrl

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def addMarginCtrl(self, name, parent, sizer):
        sizer.Add(wx.StaticText(parent, -1, name + ":"), 0,
                  wx.ALIGN_CENTER_VERTICAL)

        entry = wx.TextCtrl(parent, -1)
        sizer.Add(entry, 0)
        label = wx.StaticText(parent, -1, "mm")
        sizer.Add(label, 0, wx.ALIGN_CENTER_VERTICAL)

        entry2 = wx.TextCtrl(parent, -1)
        sizer.Add(entry2, 0, wx.LEFT, 20)
        label2 = wx.StaticText(parent, -1, "inch")
        sizer.Add(label2, 0, wx.ALIGN_CENTER_VERTICAL)

        setattr(self, name.lower() + "EntryMm", entry)
        setattr(self, name.lower() + "EntryInch", entry2)

        wx.EVT_TEXT(self, entry.GetId(), self.OnMarginMm)
        wx.EVT_TEXT(self, entry2.GetId(), self.OnMarginInch) 
开发者ID:trelby,项目名称:trelby,代码行数:21,代码来源:cfgdlg.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def __init__(self, *args, **kwargs):
        wx.Panel.__init__(self, *args, **kwargs)

        # This is used to determine if a file dialog is open or not.
        self.prev_file_path = ''

        # Textbox for input file
        self.text_ctrl = wx.TextCtrl(self, wx.ID_ANY, '')
        self.text_ctrl.Bind(wx.EVT_TEXT, self.on_text_input)
        self.button = wx.Button(self, wx.ID_ANY, _('Browse'))
        self.button.Bind(wx.EVT_BUTTON, self.on_button_click)

        # Drag and drop
        drop_target = FileDropTarget(self)
        self.text_ctrl.SetDropTarget(drop_target)

        top_sizer = wx.BoxSizer(wx.HORIZONTAL)
        top_sizer.Add(self.text_ctrl, proportion=1)
        top_sizer.Add(self.button)

        self.SetSizer(top_sizer) 
开发者ID:hasegaw,项目名称:IkaLog,代码行数:23,代码来源:preview.py

示例3: BindModelProperties

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def BindModelProperties(self):
        self.btnCalibrateTilt.Bind(wx.EVT_BUTTON, self.scaniface.Calibrate)
        self.btnCalibrateExtent.Bind(wx.EVT_BUTTON, self.scaniface.CalibrateModelBBox)

        # model parameters
        self.elevInput.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.regionInput.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.zexag.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.rotate.Bind(wx.EVT_SPINCTRL, self.OnModelProperties)
        self.rotate.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.numscans.Bind(wx.EVT_SPINCTRL, self.OnModelProperties)
        self.numscans.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.interpolate.Bind(wx.EVT_CHECKBOX, self.OnModelProperties)
        self.smooth.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.resolution.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.trim_tolerance.Bind(wx.EVT_TEXT, self.OnModelProperties)
        for each in 'nsewtb':
            self.trim[each].Bind(wx.EVT_TEXT, self.OnModelProperties) 
开发者ID:tangible-landscape,项目名称:grass-tangible-landscape,代码行数:20,代码来源:g.gui.tangible.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [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) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:19,代码来源:DownloadManager.py

示例5: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def __init__(self, parent, name):
        pre = wx.PrePanel()
        g.frame.res.LoadOnPanel(pre, parent, 'PANEL_BITMAP')
        self.PostCreate(pre)
        self.modified = self.freeze = False
        self.radio_std = xrc.XRCCTRL(self, 'RADIO_STD')
        self.radio_file = xrc.XRCCTRL(self, 'RADIO_FILE')
        self.combo = xrc.XRCCTRL(self, 'COMBO_STD')
        self.text = xrc.XRCCTRL(self, 'TEXT_FILE')
        self.button = xrc.XRCCTRL(self, 'BUTTON_BROWSE')
        self.textModified = False
        self.SetAutoLayout(True)
        self.GetSizer().SetMinSize((260, -1))
        self.GetSizer().Fit(self)
        wx.EVT_RADIOBUTTON(self, xrc.XRCID('RADIO_STD'), self.OnRadioStd)
        wx.EVT_RADIOBUTTON(self, xrc.XRCID('RADIO_FILE'), self.OnRadioFile)
        wx.EVT_BUTTON(self, xrc.XRCID('BUTTON_BROWSE'), self.OnButtonBrowse)
        wx.EVT_COMBOBOX(self, xrc.XRCID('COMBO_STD'), self.OnCombo)
        wx.EVT_TEXT(self, xrc.XRCID('COMBO_STD'), self.OnChange)
        wx.EVT_TEXT(self, xrc.XRCID('TEXT_FILE'), self.OnChange) 
开发者ID:andreas-p,项目名称:admin4,代码行数:22,代码来源:params.py

示例6: create_text_ctrl

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [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 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:23,代码来源:new_properties.py

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def __init__(self):
        global _NUMBER
        wx.Dialog.__init__(self, None, -1, _('Select toolbar class'))
        
        if common.root.language.lower() == 'xrc':
            klass = 'wxToolBar'
        else:
            klass = 'MyToolBar%s' % (_NUMBER or "")
            _NUMBER += 1

        # class
        self.klass = wx.TextCtrl(self, -1, klass)
        self.klass.Bind(wx.EVT_TEXT, self.on_text)
        # layout
        szr = wx.BoxSizer(wx.VERTICAL)
        szr.Add(klass_prop.panel, 0, wx.EXPAND)
        sz2 = wx.BoxSizer(wx.HORIZONTAL)
        sz2.Add(wx.Button(self, wx.ID_OK, _('OK')), 0, wx.ALL, 3)
        sz2.Add(wx.Button(self, wx.ID_CANCEL, _('Cancel')), 0, wx.ALL, 3)
        szr.Add(sz2, 0, wx.ALL|wx.ALIGN_CENTER, 3)
        self.SetAutoLayout(True)
        self.SetSizer(szr)
        szr.Fit(self) 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:25,代码来源:statusbar.py

示例8: Configure

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def Configure(self, cmdLineArgs=""):
        vlcPath = GetVlcPath()
        panel = eg.ConfigPanel()
        cmdLineCtrl = panel.TextCtrl(cmdLineArgs)
        resultCtrl = eg.StaticTextBox(panel)
        def OnTextChange(event=None):
            cmdLineArgs = cmdLineCtrl.GetValue()
            cmdString = '"%s" %s' % (vlcPath, self.GetCmdLineArgs(cmdLineArgs))
            resultCtrl.SetValue(cmdString)
            if event:
                event.Skip()
        OnTextChange()
        cmdLineCtrl.Bind(wx.EVT_TEXT, OnTextChange)

        panel.sizer.AddMany([
            (panel.StaticText(self.text.additionalArgs), 0, wx.BOTTOM, 3),
            (cmdLineCtrl, 0, wx.EXPAND|wx.BOTTOM, 5),
            ((15, 15), ),
            (panel.StaticText(self.text.resultingCmdLine), 0, wx.BOTTOM, 3),
            (resultCtrl, 1, wx.EXPAND),
        ])
        while panel.Affirmed():
            panel.SetResult(cmdLineCtrl.GetValue()) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:25,代码来源:__init__.py

示例9: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [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 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:21,代码来源:Terminal.py

示例10: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def __init__(self, parent, id, cfg):
        wx.Panel.__init__(self, parent, id)
        self.cfg = cfg

        # list of names. each name is both the name of a wx.TextCtrl in
        # this class and the name of a string configuration variable in
        # cfg.
        self.items = []

        vsizer = wx.BoxSizer(wx.VERTICAL)

        gsizer = wx.FlexGridSizer(4, 2, 5, 0)

        self.addEntry("strContinuedPageEnd", "(CONTINUED)", self, gsizer)
        self.addEntry("strContinuedPageStart", "CONTINUED:", self, gsizer)
        self.addEntry("strMore", "(MORE)", self, gsizer)
        self.addEntry("strDialogueContinued", " (cont'd)", self, gsizer)

        gsizer.AddGrowableCol(1)
        vsizer.Add(gsizer, 0, wx.EXPAND)

        self.cfg2gui()

        util.finishWindow(self, vsizer, center = False)

        for it in self.items:
            wx.EVT_TEXT(self, getattr(self, it).GetId(), self.OnMisc) 
开发者ID:trelby,项目名称:trelby,代码行数:29,代码来源:cfgdlg.py

示例11: addEntry

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def addEntry(self, name, descr, parent, sizer):
        sizer.Add(wx.StaticText(parent, -1, descr), 0,
                  wx.ALIGN_CENTER_VERTICAL)

        entry = wx.TextCtrl(parent, -1)
        sizer.Add(entry, 1, wx.EXPAND)

        setattr(self, name, entry)

        wx.EVT_TEXT(self, entry.GetId(), self.OnMisc) 
开发者ID:trelby,项目名称:trelby,代码行数:12,代码来源:cfgdlg.py

示例12: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def __init__(self, parent, scDict, isGlobal):
        wx.Dialog.__init__(self, parent, -1, "Spell checker dictionary",
                           style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        self.scDict = scDict

        vsizer = wx.BoxSizer(wx.VERTICAL)

        if isGlobal:
            s = "Global words:"
        else:
            s = "Script-specific words:"

        vsizer.Add(wx.StaticText(self, -1, s))

        self.itemsEntry = wx.TextCtrl(self, -1, style = wx.TE_MULTILINE |
                                     wx.TE_DONTWRAP, size = (300, 300))
        vsizer.Add(self.itemsEntry, 1, wx.EXPAND)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        hsizer.Add((1, 1), 1)

        cancelBtn = gutil.createStockButton(self, "Cancel")
        hsizer.Add(cancelBtn, 0, wx.LEFT, 10)

        okBtn = gutil.createStockButton(self, "OK")
        hsizer.Add(okBtn, 0, wx.LEFT, 10)

        vsizer.Add(hsizer, 0, wx.EXPAND | wx.TOP, 10)

        self.cfg2gui()

        util.finishWindow(self, vsizer)

        wx.EVT_TEXT(self, self.itemsEntry.GetId(), self.OnMisc)
        wx.EVT_BUTTON(self, cancelBtn.GetId(), self.OnCancel)
        wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK) 
开发者ID:trelby,项目名称:trelby,代码行数:40,代码来源:spellcheckcfgdlg.py

示例13: _bindUI

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def _bindUI(self, field, key, section='chronolapse'):
        """
        Creates a two way binding for the UI element and the given
        section/key in the config.
        """
        logging.debug("Binding %s[%s] to %s" % (section, key, str(field)))
        if hasattr(field, 'SetValue'):


            # if field is a checkbox, treat it differently
            if hasattr(field, 'IsChecked'):
                # on checkbox events, update the config
                self.Bind(wx.EVT_CHECKBOX,
                        lambda event: self.updateConfig(
                                        {key: field.IsChecked()}, from_ui=True),
                        field)

            else:
                # on text events, update the config
                self.Bind(wx.EVT_TEXT,
                        lambda event: self.updateConfig(
                                        {key: field.GetValue()}, from_ui=True),
                        field)

            # on config changes, update the UI
            self.config.add_listener(
                section, key, lambda x: field.SetValue(x))

        elif hasattr(field, 'SetStringSelection'):

            # on Selection
            self.Bind(wx.EVT_COMBOBOX,
                    lambda event: self.updateConfig(
                            {key: field.GetStringSelection()}, from_ui=True),
                    field)

            # on config changes, update the UI
            self.config.add_listener(
                section, key, lambda x: field.SetStringSelection(str(x))) 
开发者ID:collingreen,项目名称:chronolapse,代码行数:41,代码来源:chronolapse.py

示例14: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def __init__(self, parent, terminalObj):
        self.t = terminalObj
    	
        wx.Dialog.__init__(self, parent, wx.ID_ANY, "Name Input", size= (650,300))
        self.panel = wx.Panel(self,wx.ID_ANY)

        self.lblName = wx.StaticText(self.panel, label="Name", pos=(20,20))
        self.name = wx.TextCtrl(self.panel, value="", pos=(110,20), size=(500,-1))
        
        self.lblPhone = wx.StaticText(self.panel, label="Phone", pos=(20,60))
        self.phone = wx.TextCtrl(self.panel, value="", pos=(110,60), size=(500,-1), validator=numOnlyValidator())
        
        self.lblAdd = wx.StaticText(self.panel, label="Address", pos=(20,100))
        self.address = wx.TextCtrl(self.panel, value="", pos=(110,100), size=(500,-1))
        
        '''
        self.lblPrevB = wx.StaticText(self.panel, label="Previous Balance\n(if any)", pos=(20,140))
        self.previousBal = wx.TextCtrl(self.panel, value="", pos=(110,140), size=(500,-1), validator=numOnlyValidator())
        '''
        
        self.saveButton =wx.Button(self.panel, label="Save", pos=(110,200))
        self.closeButton =wx.Button(self.panel, label="Close", pos=(250,200))
        
        self.saveButton.Bind(wx.EVT_BUTTON, self.SaveConnString)
        self.closeButton.Bind(wx.EVT_BUTTON, self.OnQuit)
        
        self.Bind(wx.EVT_CLOSE, self.OnQuit)
        self.phone.Bind(wx.EVT_TEXT, self.findInfo)
        
        self.phone.SetFocus()
        
        self.Show() 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:34,代码来源:newCust.py

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_TEXT [as 别名]
def __init__(self, parent, terminalObj):
        self.t = terminalObj
    	
        wx.Dialog.__init__(self, parent, wx.ID_ANY, "Name Input", size= (650,260))
        self.panel = wx.Panel(self,wx.ID_ANY)

        self.lblName = wx.StaticText(self.panel, label="Name", pos=(20,20))
        self.name = wx.TextCtrl(self.panel, value="", pos=(110,20), size=(500,-1))
        
        self.lblPhone = wx.StaticText(self.panel, label="Phone", pos=(20,60))
        self.phone = wx.TextCtrl(self.panel, value="", pos=(110,60), size=(500,-1), validator=numOnlyValidator())
        
        self.lblAdd = wx.StaticText(self.panel, label="Address", pos=(20,100))
        self.address = wx.TextCtrl(self.panel, value="", pos=(110,100), size=(500,-1))
        
        '''
        self.lblPrevB = wx.StaticText(self.panel, label="Previous Balance\n(if any)", pos=(20,140))
        self.previousBal = wx.TextCtrl(self.panel, value="", pos=(110,140), size=(500,-1), validator=numOnlyValidator())
        '''
        
        self.saveButton =wx.Button(self.panel, label="Save", pos=(110,200))
        self.closeButton =wx.Button(self.panel, label="Close", pos=(250,200))
        
        self.saveButton.Bind(wx.EVT_BUTTON, self.SaveConnString)
        self.closeButton.Bind(wx.EVT_BUTTON, self.OnQuit)
        
        self.Bind(wx.EVT_CLOSE, self.OnQuit)
        self.phone.Bind(wx.EVT_TEXT, self.findInfo)
        
        self.phone.SetFocus()
        
        self.Show() 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:34,代码来源:newCust.py


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