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


Python wx.TE_READONLY属性代码示例

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


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

示例1: __init__

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

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_READONLY [as 别名]
def __init__(self, parent=None, id=wx.ID_ANY):
		super().__init__(parent, id)
		sizer = wx.BoxSizer(wx.HORIZONTAL)
		# Translators: Used in server mode to obtain the external IP address for the server (controlled computer) for direct connection.
		self.get_IP = wx.Button(parent=self, label=_("Get External &IP"))
		self.get_IP.Bind(wx.EVT_BUTTON, self.on_get_IP)
		sizer.Add(self.get_IP)
		# Translators: Label of the field displaying the external IP address if using direct (client to server) connection.
		sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&External IP:")))
		self.external_IP = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_READONLY|wx.TE_MULTILINE)
		sizer.Add(self.external_IP)
		# Translators: The label of an edit field in connect dialog to enter the port the server will listen on.
		sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Port:")))
		self.port = wx.TextCtrl(self, wx.ID_ANY, value=str(socket_utils.SERVER_PORT))
		sizer.Add(self.port)
		sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Key:")))
		self.key = wx.TextCtrl(self, wx.ID_ANY)
		sizer.Add(self.key)
		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) 
开发者ID:NVDARemote,项目名称:NVDARemote,代码行数:24,代码来源:dialogs.py

示例3: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_READONLY [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() 
开发者ID:hvqzao,项目名称:report-ng,代码行数:25,代码来源:gui.py

示例4: __init__

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

示例5: __init__

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

示例6: __init__

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

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_READONLY [as 别名]
def __init__(self, parent):
        wx.Panel.__init__( self, parent, -1, name='PropertyPanel' )
        self.SetBackgroundColour( compat.wx_SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE) )

        self.current_widget = None        # instance currently being edited
        self.next_widget = None           # the next one, will only be edited after a small delay

        self.pagenames = None

        sizer = wx.BoxSizer(wx.VERTICAL)
        self.heading = wx.TextCtrl(self, style=wx.TE_READONLY)
        sizer.Add(self.heading, 0, wx.EXPAND, 0)
        self.notebook = wx.Notebook(self)
        self.notebook.Bind(wx.EVT_SIZE, self.on_notebook_size)

        sizer.Add(self.notebook, 1, wx.EXPAND, 0)

        # for GTK3: add a panel to determine page size
        p = wx.Panel(self.notebook)
        self.notebook.AddPage(p, "panel")
        self._notebook_decoration_size = None
        p.Bind(wx.EVT_SIZE, self.on_panel_size)

        self.SetSizer(sizer)
        self.Layout() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:27,代码来源:main.py

示例8: create_text_ctrl

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_READONLY [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

示例9: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_READONLY [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrame.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetTitle(_("frame_1"))

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

        self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, _("Some Input"), style=wx.TE_READONLY)
        self.text_ctrl_1.SetBackgroundColour(wx.Colour(0, 255, 127))
        self.text_ctrl_1.SetForegroundColour(wx.Colour(255, 0, 0))
        self.text_ctrl_1.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
        self.text_ctrl_1.SetFocus()
        sizer_1.Add(self.text_ctrl_1, 1, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(sizer_1)
        sizer_1.Fit(self)

        self.Layout()
        # end wxGlade

# end of class MyFrame 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:24,代码来源:FontColour.py

示例10: __init__

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

示例11: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_READONLY [as 别名]
def __init__(self):
        text=self.text
        self.listCtrl=(
            "wx.TextCtrl(panel, -1, value)",
            (
                "eg.SpinNumCtrl(panel,-1,value,max=100.0,min=0.0,"
                "fractionWidth=1,increment=10,style=wx.TE_READONLY)"
            )
        )
        self.propertiesList=(
            ("Tempo",0,False),
            ("Mood",0,False),
            ("Occasion",0,False),
            ("Quality",0,False),
            ("Custom1",0,False),
            ("Custom2",0,False),
            ("Custom3",0,False),
            ("Custom4",0,False),
            ("Custom5",0,False),
            ("Comment",0,True),
            ("Genre",0,True),
            ("Rating",1,True),
        ) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:25,代码来源:__init__.py

示例12: __init__

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

示例13: __init__

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

示例14: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_READONLY [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

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TE_READONLY [as 别名]
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()) 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:27,代码来源:AboutDialog.py


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