本文整理汇总了Python中wx.TextCtrl方法的典型用法代码示例。如果您正苦于以下问题:Python wx.TextCtrl方法的具体用法?Python wx.TextCtrl怎么用?Python wx.TextCtrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.TextCtrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def __init__(self, parent, text, title):
wx.Dialog.__init__(self, parent, -1, title,
style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
vsizer = wx.BoxSizer(wx.VERTICAL)
tc = wx.TextCtrl(self, -1, size = wx.Size(400, 200),
style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_LINEWRAP)
tc.SetValue(text)
vsizer.Add(tc, 1, wx.EXPAND);
vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
okBtn = gutil.createStockButton(self, "OK")
vsizer.Add(okBtn, 0, wx.ALIGN_CENTER)
util.finishWindow(self, vsizer)
wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)
okBtn.SetFocus()
示例2: build
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def build(self, parent, data, choices=None):
self.parent = parent
self.widget = wx.TextCtrl(self.parent)
self.widget.AppendText('')
self.widget.SetMinSize((0, -1))
dt = FileDrop(self.widget)
self.widget.SetDropTarget(dt)
self.button = wx.Button(self.parent, label=self.button_text, size=(73, 23))
widget_sizer = wx.BoxSizer(wx.HORIZONTAL)
widget_sizer.Add(self.widget, 1, wx.EXPAND)
widget_sizer.AddSpacer(10)
widget_sizer.Add(self.button, 0, wx.ALIGN_CENTER_VERTICAL)
parent.Bind(wx.EVT_BUTTON, self.on_button, self.button)
return widget_sizer
示例3: addMarginCtrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [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)
示例4: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def createControls(self):
self.DrawAuxButton = wx.Button(self,-1,"Draw/Recalc")
self.SaveAuxButton = wx.Button(self,-1,"Save data")
self.AppendAuxButton = wx.Button(self,-1,"Append")
self.OpenAuxButton = wx.Button(self,-1,"Open Aux file")
self.AuxDataLabel = wx.StaticText(self, label="Auxiliary data")
self.AuxDataTextCtrl = wx.TextCtrl(self, style=wx.TE_MULTILINE) # get this value from obsini
self.AuxDataTextCtrl.Disable()
self.AuxResolutionLabel = wx.StaticText(self, label="Time resolution")
self.AuxResolutionTextCtrl = wx.TextCtrl(self, value="NaN")
self.AuxResolutionTextCtrl.Disable()
self.AuxStartDateTextCtrl = wx.TextCtrl(self, value="--")
self.AuxStartDateTextCtrl.Disable()
self.AuxEndDateTextCtrl = wx.TextCtrl(self, value="--")
self.AuxEndDateTextCtrl.Disable()
self.funcLabel = wx.StaticText(self, label="Apply fuctions:")
self.removeOutliersCheckBox = wx.CheckBox(self,
label="Remove Outliers")
self.recoveryCheckBox = wx.CheckBox(self,
label="Show data coverage")
self.interpolateCheckBox = wx.CheckBox(self,
label="Interpolate data")
self.fitCheckBox = wx.CheckBox(self,
label="Fit function")
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [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.''')
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def __init__(self, parent=None, id=wx.ID_ANY):
super().__init__(parent, id)
sizer = wx.BoxSizer(wx.HORIZONTAL)
# Translators: The label of an edit field in connect dialog to enter name or address of the remote computer.
sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Host:")))
self.host = wx.TextCtrl(self, wx.ID_ANY)
sizer.Add(self.host)
# Translators: Label of the edit field to enter key (password) to secure the remote connection.
sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Key:")))
self.key = wx.TextCtrl(self, wx.ID_ANY)
sizer.Add(self.key)
# Translators: The button used to generate a random key/password.
self.generate_key = wx.Button(parent=self, label=_("&Generate Key"))
self.generate_key.Bind(wx.EVT_BUTTON, self.on_generate_key)
sizer.Add(self.generate_key)
self.SetSizerAndFit(sizer)
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def __init__(self, parent, content='', *args, **kwargs):
GUI.ChildWindow.__init__(self, parent, *args, **kwargs)
tc = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_READONLY)
def tc_OnChar(e):
keyInput = e.GetKeyCode()
if keyInput == 1: # Ctrl+A
tc.SelectAll()
else:
e.Skip()
tc.Bind(wx.EVT_CHAR, tc_OnChar)
def tc_OnFocus(e):
tc.ShowNativeCaret(False)
e.Skip()
tc.Bind(wx.EVT_SET_FOCUS, tc_OnFocus)
tc.SetValue(content)
#self.Center()
self.CenterOnScreen()
self.Show()
示例8: addFileWidgets
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def addFileWidgets(self):
boxSizerH = wx.BoxSizer(wx.HORIZONTAL)
boxSizerH.Add(wx.Button(self.panel, label='Browse to File...'))
boxSizerH.Add(wx.TextCtrl( self.panel, size=(174, -1), value= "Z:\\" ))
boxSizerH1 = wx.BoxSizer(wx.HORIZONTAL)
boxSizerH1.Add(wx.Button(self.panel, label='Copy File To: '))
boxSizerH1.Add(wx.TextCtrl( self.panel, size=(174, -1), value= "Z:\\Backup" ))
boxSizerV = wx.BoxSizer(wx.VERTICAL)
boxSizerV.Add(boxSizerH)
boxSizerV.Add(boxSizerH1)
self.statBoxSizerMgrV.Add( boxSizerV, 1, wx.ALL )
#====================================================================
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:18,代码来源:GUI_wxPython.py
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def __init__(self, parent):
wx.Panel.__init__(self, parent)
imageFile = 'Tile.bmp'
self.bmp = wx.Bitmap(imageFile)
# react to a resize event and redraw image
parent.Bind(wx.EVT_SIZE, self.canvasCallback)
menu = wx.Menu()
menu.Append(wx.ID_ABOUT, "About", "wxPython GUI")
menu.AppendSeparator()
menu.Append(wx.ID_EXIT, "Exit", " Exit the GUI")
menuBar = wx.MenuBar()
menuBar.Append(menu, "File")
parent.SetMenuBar(menuBar)
self.textWidget = wx.TextCtrl(self, size=(280, 80), style=wx.TE_MULTILINE)
button = wx.Button(self, label="Create OpenGL 3D Cube", pos=(60, 100))
self.Bind(wx.EVT_BUTTON, self.buttonCallback, button)
parent.CreateStatusBar()
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:24,代码来源:wxPython_Wallpaper.py
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def __init__(self, parent):
wx.Panel.__init__(self, parent)
menu = wx.Menu()
menu.Append(wx.ID_ABOUT, "About", "wxPython GUI")
menu.AppendSeparator()
menu.Append(wx.ID_EXIT, "Exit", " Exit the GUI")
menuBar = wx.MenuBar()
menuBar.Append(menu, "File")
parent.SetMenuBar(menuBar)
self.textWidget = wx.TextCtrl(self, size=(280, 80), style=wx.TE_MULTILINE)
button = wx.Button(self, label="Create OpenGL 3D Cube", pos=(60, 100))
self.Bind(wx.EVT_BUTTON, self.buttonCallback, button)
parent.CreateStatusBar()
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:19,代码来源:wxPython_OpenGL_GUI.py
示例11: on_option_tab_create
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def on_option_tab_create(self, notebook):
self.panel = wx.Panel(notebook, wx.ID_ANY)
self.panel_name = _('WebSocket Server')
self.layout = wx.BoxSizer(wx.VERTICAL)
self.check_enable = wx.CheckBox(
self.panel, wx.ID_ANY, _('Enable WebSocket Server'))
self.edit_port = wx.TextCtrl(self.panel, wx.ID_ANY, 'port')
layout = wx.GridSizer(2)
layout.Add(wx.StaticText(self.panel, wx.ID_ANY, _('Listen port')))
layout.Add(self.edit_port)
self.layout.Add(self.check_enable)
self.layout.Add(wx.StaticText(
self.panel, wx.ID_ANY,
_('WARNING: The server is accessible by anyone.'),
))
self.layout.Add(layout, flag=wx.EXPAND)
self.panel.SetSizer(self.layout)
示例12: on_option_tab_create
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def on_option_tab_create(self, notebook):
self.panel = wx.Panel(notebook, wx.ID_ANY, size=(640, 360))
self.panel_name = 'Hue'
self.layout = wx.BoxSizer(wx.VERTICAL)
self.panel.SetSizer(self.layout)
self.checkEnable = wx.CheckBox(self.panel, wx.ID_ANY, u'Hue と連携')
self.editHueHost = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
self.editHueUsername = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
try:
layout = wx.GridSizer(2, 2)
except:
layout = wx.GridSizer(2)
layout.Add(wx.StaticText(self.panel, wx.ID_ANY, u'ホスト'))
layout.Add(self.editHueHost)
layout.Add(wx.StaticText(self.panel, wx.ID_ANY, u'ユーザ'))
layout.Add(self.editHueUsername)
self.layout.Add(self.checkEnable)
self.layout.Add(layout)
# enhance_color and rgb2xy is imported from:
# https://gist.githubusercontent.com/error454/6b94c46d1f7512ffe5ee/raw/73b190ce256c3d8dd540cc34e6dae43848cbce4c/gistfile1.py
# All the rights belongs to the author.
示例13: on_option_tab_create
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def on_option_tab_create(self, notebook):
self.panel = wx.Panel(notebook, wx.ID_ANY)
self.panel_name = _('CSV')
self.layout = wx.BoxSizer(wx.VERTICAL)
self.panel.SetSizer(self.layout)
self.checkEnable = wx.CheckBox(
self.panel, wx.ID_ANY, _('Enable CSV Log'))
self.editCsvFilename = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
self.layout.Add(wx.StaticText(self.panel, wx.ID_ANY, _('Log Filename')))
self.layout.Add(self.editCsvFilename, flag=wx.EXPAND)
self.layout.Add(self.checkEnable)
##
# Write a line to text file.
# @param self The Object Pointer.
# @param record Record (text)
#
示例14: on_option_tab_create
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [as 别名]
def on_option_tab_create(self, notebook):
self.panel = wx.Panel(notebook, wx.ID_ANY)
self.panel_name = _('Screenshot')
self.layout = wx.BoxSizer(wx.VERTICAL)
self.panel.SetSizer(self.layout)
self.checkResultDetailEnable = wx.CheckBox(
self.panel, wx.ID_ANY, _('Save screenshots of game results'))
self.editDir = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
self.layout.Add(wx.StaticText(
self.panel, wx.ID_ANY, _('Folder to save screenshots')))
self.layout.Add(self.editDir, flag=wx.EXPAND)
self.layout.Add(self.checkResultDetailEnable)
self.panel.SetSizer(self.layout)
##
# on_result_detail_still Hook
# @param self The Object Pointer
# @param context IkaLog context
#
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextCtrl [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)