當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。