- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 python-3 中做了一个项目,我用 wxpython 创建了一个 gui。在 gui 中,我使用 wx.stc.StyledTextCtrl 并且我不想用户无法撤消(Ctrl + Z)。有没有办法做到这一点?如果有人知道如何不允许(Ctrl + V),这也很棒。
感谢回答的人!
下面是创建 wx.stc.StyledTextCtrl 的基本代码:
import wx
from wx.stc import StyledTextCtrl
app = wx.App()
frame = wx.Frame(None, -1, title='2', pos=(0, 0), size=(500, 500))
frame.Show(True)
messageTxt = StyledTextCtrl(frame, id=wx.ID_ANY, pos=(0, 0), size=(100 * 3, 100),
style=wx.TE_MULTILINE, name="File")
app.SetTopWindow(frame)
app.MainLoop()
最佳答案
另一种选择是使用 stc
的 CmdKeyClear
函数,允许 stc
为你做这项工作。
import wx
from wx.stc import StyledTextCtrl
app = wx.App()
frame = wx.Frame(None, -1, title='2', pos=(0, 0), size=(500, 500))
frame.Show(True)
messageTxt = StyledTextCtrl(frame, id=wx.ID_ANY, pos=(0, 0), size=(100 * 3, 100),
style=wx.TE_MULTILINE, name="File")
messageTxt.CmdKeyClear(ord('V'), wx.stc.STC_SCMOD_CTRL)
messageTxt.CmdKeyClear(ord('Z'), wx.stc.STC_SCMOD_CTRL)
app.SetTopWindow(frame)
app.MainLoop()
关于python-3.x - 如何在 Wx.Stc.StyledTextCtrl 中不允许撤消 (Ctrl+Z),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59022183/
关于此主题存在一个现有问题:Find text dialog with wxpython ,但它在 TextCtrl 中。所以我将TextCtrl更改为StyledTextCtrl,并进行了测试。但我
我稍微减小了 StyledTextCtrl 的字体大小,但不影响文本控件页边距的字体大小,即行号字体: 有什么方法可以控制页边距中的字体大小吗? 对于那些感兴趣的人,这是我的子类: class Cus
我仍在开发我的文本编辑器,现在我想让它运行得更快。所以我想我可以以某种方式获取当前可见的文本,并根据需要解析它。那么有没有办法获取当前可见的线条呢? P.S. 或者也许还有另一种方法可以提高 Styl
在我的项目中,我使用wx.stc.StyledTextCtrl()。我绑定(bind)了按键按下和按键按下的事件。当我想在 TextCtrl 中添加一个字母时,我不会跳过该事件,由于某些原因,我使用方
我试过了(但没有任何反应) self.txt.SetBackgroundColour ((255,0,0)) 如标题中所述,我正在尝试更改 StyledTextCtrl 的背景颜色。有谁知道可
如何在 StyledTextCtrl 中设置文本颜色,但只能设置某些单词?我的意思是假设我有 露西是蓝色的 我希望仅将“蓝色”一词着色为蓝色 最佳答案 请参阅 StyledTextCtrl 的 wxP
有没有人成功地将词法分析器添加到 scintilla? 我一直在遵循 http://www.scintilla.org/SciTELexer.html 上的简短说明。 - 甚至在 http://www
我在 python-3 中做了一个项目,我用 wxpython 创建了一个 gui。在 gui 中,我使用 wx.stc.StyledTextCtrl 并且我不想用户无法撤消(Ctrl + Z)。有没
我正在尝试确定启用自动换行的 wxPython styledtextctrl 中屏幕上显示的行数。 我在这里看到了几个可见线的答案: wxPython - StyledTextCtrl get cur
我是一名优秀的程序员,十分优秀!