Implemented Ctrl+A to select all in important edit boxes
This commit is contained in:
@@ -16,11 +16,19 @@ class displayBasicPost(widgetUtils.BaseDialog):
|
||||
def create_post_view(self, label=_("Message")):
|
||||
lbl = wx.StaticText(self.panel, -1, label)
|
||||
self.post_view = wx.TextCtrl(self.panel, -1, size=(730, -1), style=wx.TE_READONLY|wx.TE_MULTILINE)
|
||||
selectId = wx.NewId()
|
||||
self.Bind(wx.EVT_MENU, self.onSelect, id=selectId)
|
||||
self.accel_tbl = wx.AcceleratorTable([
|
||||
(wx.ACCEL_CTRL, ord('A'), selectId),])
|
||||
self.SetAcceleratorTable(self.accel_tbl)
|
||||
box = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(lbl, 0, wx.ALL, 5)
|
||||
box.Add(self.post_view, 0, wx.ALL, 5)
|
||||
return box
|
||||
|
||||
def onSelect(self, event):
|
||||
self.post_view.SelectAll()
|
||||
|
||||
def create_views_control(self):
|
||||
lbl = wx.StaticText(self.panel, -1, _("Views"))
|
||||
self.views = wx.TextCtrl(self.panel, -1, style=wx.TE_READONLY|wx.TE_MULTILINE)
|
||||
|
@@ -164,11 +164,22 @@ class chatTab(wx.Panel):
|
||||
def create_controls(self):
|
||||
lbl1 = wx.StaticText(self, wx.NewId(), _("History"))
|
||||
self.history = wx.TextCtrl(self, wx.NewId(), style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, 300))
|
||||
selectId = wx.NewId()
|
||||
self.Bind(wx.EVT_MENU, self.onSelect, id=selectId)
|
||||
self.accel_tbl = wx.AcceleratorTable([(wx.ACCEL_CTRL, ord('A'), selectId)])
|
||||
self.SetAcceleratorTable(self.accel_tbl)
|
||||
box = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(lbl1, 0, wx.ALL, 5)
|
||||
box.Add(self.history, 0, wx.ALL, 5)
|
||||
return box
|
||||
|
||||
def onSelect(self, event, *args, **kwargs):
|
||||
if self.history.HasFocus():
|
||||
self.history.SelectAll()
|
||||
else:
|
||||
self.text.SelectAll()
|
||||
event.Skip()
|
||||
|
||||
def create_attachments(self):
|
||||
lbl = wx.StaticText(self, -1, _("Attachments"))
|
||||
self.attachments = widgetUtils.list(self, _("Type"), _("Title"), style=wx.LC_REPORT)
|
||||
|
Reference in New Issue
Block a user