本文整理汇总了Python中wx.TE_MULTILINE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.TE_MULTILINE属性的具体用法?Python wx.TE_MULTILINE怎么用?Python wx.TE_MULTILINE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.TE_MULTILINE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [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: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [as 别名]
def __init__(self, *args, **kwargs):
self.app = kwargs.pop('app', None)
wx.Frame.__init__(self, *args, **kwargs)
# =============== Logging Text Control ================
self.log_ctrl = log_ctrl(self, style = wx.TE_MULTILINE, add_to_file = True)
sys.stdout = self.log_ctrl
sys.stderr = self.log_ctrl
self.log = wx.LogTextCtrl(self.log_ctrl)
self.log.SetLogLevel(wx.LOG_Error)
wx.Log_SetActiveTarget(self.log)
# =============== player Control ================
self.player = player_ctrl(self)
# =============== StatusBar ================
statusbar = self.CreateStatusBar(2)
statusbar.SetStatusWidths([-1, -1])
statusbar.SetStatusText(_('Welcome into application!'), 0)
# =============== AuiManager ================
self.aui_manager = AuiManager()
self.aui_manager.SetManagedWindow(self)
self.aui_manager.AddPane(self.player, AuiPaneInfo().Name('player').CenterPane())
self.aui_manager.AddPane(self.log_ctrl, AuiPaneInfo().Name('log_ctrl').Bottom().Layer(0).BestSize((100, 100)).Hide())
if self.log_ctrl.GetValue() != '':
self.aui_manager.GetPane('log_ctrl').Show()
self.aui_manager.Update()
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [as 别名]
def __init__(self, *args, **kwargs):
self.app = kwargs.pop('app', None)
wx.Frame.__init__(self, *args, **kwargs)
# =============== Logging Text Control ================
self.log_ctrl = log_ctrl(self, style = wx.TE_MULTILINE, add_to_file = True)
sys.stdout = self.log_ctrl
sys.stderr = self.log_ctrl
self.log = wx.LogTextCtrl(self.log_ctrl)
self.log.SetLogLevel(wx.LOG_Error)
#~ wx.Log_SetActiveTarget(self.log)
# =============== player Control ================
self.player = player_ctrl(self)
# =============== StatusBar ================
statusbar = self.CreateStatusBar(2)
statusbar.SetStatusWidths([-1, -1])
statusbar.SetStatusText(_('Welcome into application!'), 0)
# =============== AuiManager ================
self.aui_manager = AuiManager()
self.aui_manager.SetManagedWindow(self)
self.aui_manager.AddPane(self.player, AuiPaneInfo().Name('player').CenterPane())
self.aui_manager.AddPane(self.log_ctrl, AuiPaneInfo().Name('log_ctrl').Bottom().Layer(0).BestSize((100, 100)).Hide())
if self.log_ctrl.GetValue() != '':
self.aui_manager.GetPane('log_ctrl').Show()
self.aui_manager.Update()
示例4: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [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 TE_MULTILINE [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()
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [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
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [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
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [as 别名]
def __init__(self, parent, n_max_lines):
wx.Panel.__init__(self, parent, -1)
self.parent = parent
self.n_max_lines = n_max_lines
vbox = wx.BoxSizer(wx.VERTICAL)
style = wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL
self.text = wx.TextCtrl(self, -1, "", style=style)
vbox.Add(self.text, 1, wx.EXPAND)
self.SetSizer(vbox)
self.handler = logging.StreamHandler(self)
formatter = logging.Formatter("%(asctime)s: %(message)s",
"%Y-%m-%d %H:%M:%S")
self.handler.setFormatter(formatter)
logger.addHandler(self.handler)
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [as 别名]
def __init__(self, parent, frame):
self._frame = frame
wx.Panel.__init__(self, parent, -1)
# self.req_txt = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY)
self.req_txt = webview.WebView.New(self)
# self.resp_txt = webview.WebView.New(self)
self.resp_txt = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.req_txt, 1, wx.EXPAND)
sizer.Add(self.resp_txt, 1, wx.EXPAND)
self.SetSizer(sizer)
self.SetAutoLayout(True)
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [as 别名]
def __init__(self, parent, credits_file_name, style=0):
filename = os.path.join(doc_root, credits_file_name + u'.txt')
l = ''
if not os.access(filename, os.F_OK|os.R_OK):
l = _("Couldn't open %s") % filename
else:
credits_f = file(filename)
l = credits_f.read()
credits_f.close()
l = l.decode('utf-8', 'replace').strip()
wx.TextCtrl.__init__(self, parent, id=wx.ID_ANY, value=l,
style=wx.TE_MULTILINE|wx.TE_READONLY|style)
self.SetMinSize(wx.Size(-1, 140))
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [as 别名]
def __init__(self, parent, msg, caption, pos = wx.DefaultPosition, size = (500,300)):
from wx.lib.layoutf import Layoutf
wx.Dialog.__init__(self, parent, -1, caption, pos, size)
text = wx.TextCtrl(self, -1, msg, wx.DefaultPosition,
wx.DefaultSize, wx.TE_MULTILINE | wx.TE_READONLY)
text.SetFont(g.modernFont())
dc = wx.WindowDC(text)
# !!! possible bug - GetTextExtent without font returns sysfont dims
w, h = dc.GetFullTextExtent(' ', g.modernFont())[:2]
ok = wx.Button(self, wx.ID_OK, "OK")
text.SetConstraints(Layoutf('t=t5#1;b=t5#2;l=l5#1;r=r5#1', (self,ok)))
text.SetSize((w * 80 + 30, h * 40))
text.ShowPosition(1)
ok.SetConstraints(Layoutf('b=b5#1;x%w50#1;w!80;h!25', (self,)))
self.SetAutoLayout(True)
self.Fit()
self.CenterOnScreen(wx.BOTH)
################################################################################
# Event handler for using during location
示例12: create_text_ctrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [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
示例13: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: TemplateListDialog.__init__
kwds["style"] = wx.DEFAULT_DIALOG_STYLE
wx.Dialog.__init__(self, *args, **kwds)
self.template_names = wx.ListBox(self, wx.ID_ANY, choices=[])
self.template_name = wx.StaticText(self, wx.ID_ANY, _("wxGlade template:\n"))
self.author = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
self.description = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
self.instructions = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
self.btn_open = wx.Button(self, wx.ID_OPEN, "")
self.btn_edit = wx.Button(self, ID_EDIT, _("&Edit"))
self.btn_delete = wx.Button(self, wx.ID_DELETE, "")
self.btn_cancel = wx.Button(self, wx.ID_CANCEL, "")
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_open, self.template_names)
self.Bind(wx.EVT_LISTBOX, self.on_select_template, self.template_names)
self.Bind(wx.EVT_BUTTON, self.on_open, self.btn_open)
self.Bind(wx.EVT_BUTTON, self.on_edit, id=ID_EDIT)
self.Bind(wx.EVT_BUTTON, self.on_delete, self.btn_delete)
# end wxGlade
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: UIBugDialog.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
wx.Dialog.__init__(self, *args, **kwds)
self.SetSize((600, 400))
self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=wx.NB_BOTTOM)
self.nb1_pane_summary = wx.Panel(self.notebook_1, wx.ID_ANY)
self.st_header = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("An internal error occurred while %(action)s"))
self.st_summary = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("Error type: %(exc_type)s\nError summary: %(exc_msg)s"))
self.st_report = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("This is a bug - please report it."))
self.nb1_pane_details = wx.Panel(self.notebook_1, wx.ID_ANY)
self.st_details = wx.StaticText(self.nb1_pane_details, wx.ID_ANY, _("Error details:"))
self.tc_details = wx.TextCtrl(self.nb1_pane_details, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.notebook_1_pane_1 = wx.Panel(self.notebook_1, wx.ID_ANY)
self.tc_howto_report = wx.TextCtrl(self.notebook_1_pane_1, wx.ID_ANY, _("Writing a helpful bug report is easy if you follow some hints. The items below should help you to integrate useful information. They are not an absolute rule - it's more like a guideline.\n\n- What did you do? Maybe you want to include a screenshot.\n- What did you want to happen?\n- What did actually happen?\n- Provide a short example to reproduce the issue.\n- Include the internal error log file %(log_file)s if required.\n\nPlease open a new bug in the wxGlade bug tracker https://github.com/wxGlade/wxGlade/issues/ .\nAlternatively you can send the bug report to the wxGlade mailing list wxglade-general@lists.sourceforge.net. Keep in mind that you need a subscription for sending emails to this mailing list.\nThe subscription page is at https://sourceforge.net/projects/wxglade/lists/wxglade-general ."), style=wx.TE_MULTILINE | wx.TE_READONLY)
self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
self.btn_copy = wx.Button(self, wx.ID_COPY, "")
self.btn_ok = wx.Button(self, wx.ID_OK, "")
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_BUTTON, self.OnCopy, self.btn_copy)
# end wxGlade
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_MULTILINE [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)