Implemented Ctrl+A to select all in important edit boxes

This commit is contained in:
Manuel Cortez 2019-01-24 16:07:02 -06:00
parent 9230bd8115
commit 56424cf0d1
3 changed files with 20 additions and 0 deletions

View File

@ -14,6 +14,7 @@
* control+Shift+P: Play all.
* Fixed an error in the audio player that was skipping the first track if you were in the last song and pressed "play next" in the menu bar or via the keystroke.
* Chats with unread messages will be placed at the top of the chats section. When a chat buffer receives a new message, socializer will move the buffer to the first position in the chats list. This should make easier for everyone to determine which chats contain unread items. ([#24,](https://code.manuelcortez.net/manuelcortez/socializer/issues/24))
* In dialogs for displaying posts and comments, and also in the two edit boxes present in chat buffers, it is possible to select all by pressing Control+A.
## Changes in version 0.18 (21.01.2019)

View File

@ -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)

View File

@ -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)