Python wx.TE_MULTILINE Examples
The following are 30
code examples of wx.TE_MULTILINE().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: misc.py From trelby with GNU General Public License v2.0 | 7 votes |
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()
Example #2
Source File: CellEditor.py From bookhub with MIT License | 6 votes |
def __init__(self, olv, subItemIndex, **kwargs): style = wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB # Allow for odd case where parent isn't an ObjectListView if hasattr(olv, "columns"): if olv.HasFlag(wx.LC_ICON): style |= (wx.TE_CENTRE | wx.TE_MULTILINE) else: style |= olv.columns[subItemIndex].GetAlignmentForText() wx.TextCtrl.__init__(self, olv, style=style, size=(0,0), **kwargs) # With the MULTILINE flag, the text control always has a vertical # scrollbar, which looks stupid. I don't know how to get rid of it. # This doesn't do it: # self.ToggleWindowStyle(wx.VSCROLL) #----------------------------------------------------------------------------
Example #3
Source File: developpage.py From magpy with BSD 3-Clause "New" or "Revised" License | 6 votes |
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")
Example #4
Source File: gui.py From report-ng with GNU General Public License v2.0 | 6 votes |
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()
Example #5
Source File: wx_bass_control.py From pybass with Apache License 2.0 | 6 votes |
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()
Example #6
Source File: wxPython_Wallpaper.py From Python-GUI-Programming-Cookbook-Second-Edition with MIT License | 6 votes |
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()
Example #7
Source File: wxPython_OpenGL_GUI.py From Python-GUI-Programming-Cookbook-Second-Edition with MIT License | 6 votes |
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()
Example #8
Source File: guiminer.py From poclbm with GNU General Public License v3.0 | 6 votes |
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)
Example #9
Source File: guicontrols.py From wfuzz with GNU General Public License v2.0 | 6 votes |
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)
Example #10
Source File: DownloadManager.py From BitTorrent with GNU General Public License v3.0 | 6 votes |
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))
Example #11
Source File: DownloadManager.py From BitTorrent with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent, torrent, *a, **k): BTPanel.__init__(self, parent, *a, **k) self.log = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH2) self.log.Bind(wx.EVT_TEXT, self.OnText) self.Add(self.log, flag=wx.GROW, proportion=1) class MyTorrentLogger(logging.Handler): def set_log_func(self, func): self.log_func = func def emit(self, record): gui_wrap(self.log_func, self.format(record) + '\n') l = MyTorrentLogger() l.setFormatter(bt_log_fmt) l.set_log_func(self.log.AppendText) torrent.handler.setTarget(l) torrent.handler.flush()
Example #12
Source File: xrced.py From admin4 with Apache License 2.0 | 6 votes |
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
Example #13
Source File: templates_ui.py From wxGlade with MIT License | 6 votes |
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
Example #14
Source File: wx_ctrl_phoenix.py From pybass with Apache License 2.0 | 6 votes |
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()
Example #15
Source File: AboutDialog.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent, info): wx.Dialog.__init__(self, parent, title=_("License"), size=(500, 400), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) if parent and parent.GetIcon(): self.SetIcon(parent.GetIcon()) self.SetMinSize((400, 300)) close = wx.Button(self, id=wx.ID_CLOSE, label=_("&Close")) ctrl = wx.TextCtrl(self, style=wx.TE_READONLY | wx.TE_MULTILINE) ctrl.SetValue(info.License) btnSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer.Add(close) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(ctrl, 1, wx.EXPAND | wx.ALL, 10) sizer.Add(btnSizer, flag=wx.ALIGN_RIGHT | wx.RIGHT | wx.BOTTOM, border=10) self.SetSizer(sizer) self.Layout() self.Show() self.SetEscapeId(close.GetId()) close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
Example #16
Source File: Terminal.py From meerk40t with MIT License | 6 votes |
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
Example #17
Source File: UsbConnect.py From meerk40t with MIT License | 6 votes |
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
Example #18
Source File: GuiAbsBase.py From Crypter with GNU General Public License v3.0 | 6 votes |
def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Encrypted Files", pos = wx.DefaultPosition, size = wx.Size( 600,400 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) BodySizer = wx.BoxSizer( wx.VERTICAL ) self.m_panel4 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) TextCtrlSizer = wx.BoxSizer( wx.VERTICAL ) self.EncryptedFilesTextCtrl = wx.TextCtrl( self.m_panel4, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_DONTWRAP|wx.TE_MULTILINE|wx.TE_READONLY ) TextCtrlSizer.Add( self.EncryptedFilesTextCtrl, 1, wx.ALL|wx.EXPAND, 5 ) self.m_panel4.SetSizer( TextCtrlSizer ) self.m_panel4.Layout() TextCtrlSizer.Fit( self.m_panel4 ) BodySizer.Add( self.m_panel4, 1, wx.EXPAND |wx.ALL, 5 ) self.SetSizer( BodySizer ) self.Layout() self.Centre( wx.BOTH )
Example #19
Source File: rule_editor.py From Rule-based_Expert_System with GNU General Public License v2.0 | 6 votes |
def __init__(self, parent, id, title, size): wx.Frame.__init__(self, parent, id, title, style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX)) self.SetSize(size) self.Center() self.ps = wx.StaticText(self, label='IF part using \'AND\' to combine antecedent. Please ONE antecedent per line', pos=(10, 5), size=(40 ,100)) self.ifLabel = wx.StaticText(self, label='IF: ', pos=(10, 30), size=(40, 50)) self.thenLabel = wx.StaticText(self, label='THEN: ', pos=(10, 250), size=(40, 50)) self.descriptionLabel = wx.StaticText(self, label='Description: ', pos=(10, 280), size=(40, 50)) self.ifText = wx.TextCtrl(self, pos=(100, 30), size=(490, 210), style=wx.TE_MULTILINE) self.thenText = wx.TextCtrl(self, pos=(100, 250), size=(490, 25)) self.descriptionText = wx.TextCtrl(self, pos=(100, 280), size=(490, 25)) self.createButton = wx.Button(self, label='Create', pos=(85, 320), size=(130, 30)) self.createButton.Bind(wx.EVT_BUTTON, self.create_rule) self.cancelButton = wx.Button(self, label='Cancel', pos=(385, 320), size=(130, 30)) self.cancelButton.Bind(wx.EVT_BUTTON, self.cancel_creation)
Example #20
Source File: dialog_dllog.py From iqiyi-parser with MIT License | 6 votes |
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)
Example #21
Source File: bugdialog_ui.py From wxGlade with MIT License | 6 votes |
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
Example #22
Source File: new_properties.py From wxGlade with MIT License | 6 votes |
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
Example #23
Source File: add_class_inplace_extended.py From wxGlade with MIT License | 5 votes |
def __init__(self, *args, **kwds): # begin wxGlade: MyDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE) self.static_line_1 = wx.StaticLine(self, wx.ID_ANY) self.button_2 = wx.Button(self, wx.ID_OK, "") self.button_1 = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() # end wxGlade
Example #24
Source File: GUI_utils.py From topoflow with MIT License | 5 votes |
def Labeled_Text_Box(frame, panel, sizer, label, text='', \ MULTI=False, \ button=None, function=None, \ border=5, box_width=300, box_height=-1): L1 = wx.StaticText(panel, -1, label) sizer.Add(L1, 0, wx.ALL, border) if (MULTI): T1 = wx.TextCtrl(panel, -1, text, \ size=(box_width, box_height), \ style=wx.TE_MULTILINE) else: T1 = wx.TextCtrl(panel, -1, text, \ size=(box_width, box_height)) sizer.Add(T1, 0, wx.ALL, border) #------------------------- # Option to add a button #------------------------- if (button is None): null_item = wx.StaticText(panel, -1, "") sizer.Add(null_item, 0, wx.ALL, border) else: B1 = wx.Button(panel, -1, button) ### B1.Disable() ### (this works) sizer.Add(B1, 0, wx.ALL, border) frame.Bind(wx.EVT_BUTTON, function, B1) #### return T1 # (text box object) # Labeled_Text_Box #----------------------------------------------------------------
Example #25
Source File: Notebook2.py From topoflow with MIT License | 5 votes |
def __init__(self, parent): title = "Resize the dialog and see how controls adapt!" wx.Dialog.__init__(self, parent, -1, title, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) notebook = wx.Notebook(self, -1, size=(450,300)) panel1 = wx.Panel(notebook) panel2 = wx.Panel(notebook) notebook.AddPage(panel1, "Panel 1") notebook.AddPage(panel2, "Panel 2") dialog_sizer = wx.BoxSizer(wx.VERTICAL) dialog_sizer.Add(notebook, 1, wx.EXPAND|wx.ALL, 5) panel1_sizer = wx.BoxSizer(wx.VERTICAL) text = wx.TextCtrl(panel1, -1, "Hi!", size=(400,90), style=wx.TE_MULTILINE) button1 = wx.Button(panel1, -1, "I only resize horizontally...") panel1_sizer.Add(text, 1, wx.EXPAND|wx.ALL, 10) panel1_sizer.Add(button1, 0, wx.EXPAND|wx.ALL, 10) panel1.SetSizer(panel1_sizer) panel2_sizer = wx.BoxSizer(wx.HORIZONTAL) button2 = wx.Button(panel2, -1, "I resize vertically") button3 = wx.Button(panel2, -1, "I don't like resizing!") panel2_sizer.Add(button2, 0, wx.EXPAND|wx.ALL, 20) panel2_sizer.Add(button3, 0, wx.ALL, 100) panel2.SetSizer(panel2_sizer) if "__WXMAC__" in wx.PlatformInfo: self.SetSizer(dialog_sizer) else: self.SetSizerAndFit(dialog_sizer) self.Centre() self.Bind(wx.EVT_BUTTON, self.OnButton)
Example #26
Source File: metapage.py From magpy with BSD 3-Clause "New" or "Revised" License | 5 votes |
def createControls(self): self.head1Label = wx.StaticText(self, label="Basic Information:") self.head2Label = wx.StaticText(self, label="Database:") self.head3Label = wx.StaticText(self, label="Modify/Review:") # 1. Section self.samplingrateLabel = wx.StaticText(self, label="Samp. period (sec):") self.samplingrateTextCtrl = wx.TextCtrl(self, value="--",size=(160,30)) self.amountLabel = wx.StaticText(self, label="N of data point:") self.amountTextCtrl = wx.TextCtrl(self, value="--",size=(160,30)) self.typeLabel = wx.StaticText(self, label="Datatype:") self.typeTextCtrl = wx.TextCtrl(self, value="--",size=(160,30)) self.keysLabel = wx.StaticText(self, label="Used keys:") self.keysTextCtrl = wx.TextCtrl(self, value="--",size=(160,30)) self.samplingrateTextCtrl.Disable() self.amountTextCtrl.Disable() self.typeTextCtrl.Disable() self.keysTextCtrl.Disable() self.getDBButton = wx.Button(self,-1,"Get from DB",size=(160,30)) self.putDBButton = wx.Button(self,-1,"Write to DB",size=(160,30)) self.MetaDataButton = wx.Button(self,-1,"Data related",size=(160,30)) self.dataTextCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(330,80), style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL) self.MetaSensorButton = wx.Button(self,-1,"Sensor related",size=(160,30)) self.sensorTextCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(330,80), style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL) self.MetaStationButton = wx.Button(self,-1,"Station related",size=(160,30)) self.stationTextCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(330,80), style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL)
Example #27
Source File: absolutespage.py From magpy with BSD 3-Clause "New" or "Revised" License | 5 votes |
def createControls(self): self.sourceLabel = wx.StaticText(self, label="Data source:") self.diLabel = wx.StaticText(self, label="Actions:") self.loadDIButton = wx.Button(self,-1,"DI data",size=(160,30)) self.diSourceLabel = wx.StaticText(self, label="Source: None") self.diTextCtrl = wx.TextCtrl(self, value="None",size=(160,40), style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL) self.defineVarioScalarButton = wx.Button(self,-1,"Vario/Scalar",size=(160,30)) self.VarioSourceLabel = wx.StaticText(self, label="Vario: None") self.ScalarSourceLabel = wx.StaticText(self, label="Scalar: None") self.varioTextCtrl = wx.TextCtrl(self, value="None",size=(160,40), style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL) self.defineParameterButton = wx.Button(self,-1,"Analysis parameter",size=(160,30)) self.parameterRadioBox = wx.RadioBox(self,label="parameter source",choices=self.choices, majorDimension=2, style=wx.RA_SPECIFY_COLS,size=(160,50)) #self.parameterTextCtrl = wx.TextCtrl(self, value="Default",size=(160,30), # style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL) self.scalarTextCtrl = wx.TextCtrl(self, value="None",size=(160,40), style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL) self.AnalyzeButton = wx.Button(self,-1,"Analyze",size=(160,30)) self.logLabel = wx.StaticText(self, label="Logging:") #self.exportButton = wx.Button(self,-1,"Export...",size=(160,30)) self.ClearLogButton = wx.Button(self,-1,"Clear Log",size=(160,30)) self.SaveLogButton = wx.Button(self,-1,"Save Log",size=(160,30)) self.dilogTextCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(330,200), style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL) #self.varioExtComboBox = wx.ComboBox(self, choices=self.varioext, # style=wx.CB_DROPDOWN, value=self.varioext[0],size=(160,-1)) #self.scalarExtComboBox = wx.ComboBox(self, choices=self.scalarext, # style=wx.CB_DROPDOWN, value=self.scalarext[0],size=(160,-1))
Example #28
Source File: add_class_inplace_orig.py From wxGlade with MIT License | 5 votes |
def __init__(self, *args, **kwds): # begin wxGlade: MyDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE) self.static_line_1 = wx.StaticLine(self, wx.ID_ANY) self.button_2 = wx.Button(self, wx.ID_OK, "") self.button_1 = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() # end wxGlade
Example #29
Source File: templates_ui.py From wxGlade with MIT License | 5 votes |
def __init__(self, *args, **kwds): # begin wxGlade: TemplateInfoDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER wx.Dialog.__init__(self, *args, **kwds) self.template_name = wx.TextCtrl(self, wx.ID_ANY, "") self.author = wx.TextCtrl(self, wx.ID_ANY, "") self.description = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE) self.instructions = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE) self.button_1 = wx.Button(self, wx.ID_OK, "") self.button_2 = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() # end wxGlade
Example #30
Source File: statisticspage.py From magpy with BSD 3-Clause "New" or "Revised" License | 5 votes |
def createControls(self): self.statisticsLabel = wx.StaticText(self, label="Statistics:") self.timeLabel = wx.StaticText(self, label="") self.statisticsTextCtrl = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL) self.valuesLabel = wx.StaticText(self, label="Individual Values (For ten or less data points):") self.valuesTextCtrl = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL)