Skip to content

Commit

Permalink
Merge pull request #8 from nothingworksright/updates
Browse files Browse the repository at this point in the history
Replaced bad if statement
  • Loading branch information
jmg1138 authored Nov 10, 2017
2 parents 0bad293 + bf03036 commit 13ab524
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions tmpNote.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import wx
Expand Down Expand Up @@ -276,25 +276,27 @@ def menu_bar(self):
editmenu.AppendSeparator()
editmenu.Append(wx.ID_CUT, 'Cut\tCtrl+X', 'Cut selection from file.')
self.Bind(wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_CUT)
editmenu.Append(wx.ID_COPY, '&Copy\tCtrl+C',
'Copy selection from file.')
editmenu.Append(
wx.ID_COPY, '&Copy\tCtrl+C', 'Copy selection from file.'
)
self.Bind(
wx.EVT_MENU,
self.cut_copy_paste_del_sel_event,
id=wx.ID_COPY
wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_COPY
)
editmenu.Append(
wx.ID_PASTE, '&Paste\tCtrl+V', 'Paste clipboard into file.'
)
editmenu.Append(wx.ID_PASTE, '&Paste\tCtrl+V',
'Paste clipboard into file.')
self.Bind(
wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_PASTE
)
editmenu.Append(wx.ID_DELETE, 'Delete', 'Delete the selected text.')
self.Bind(wx.EVT_MENU, self.cut_copy_paste_del_sel_event,
id=wx.ID_DELETE)
self.Bind(
wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_DELETE
)
editmenu.AppendSeparator()
editmenu.Append(wx.ID_SELECTALL, 'Select All', 'Select all text.')
self.Bind(wx.EVT_MENU, self.cut_copy_paste_del_sel_event,
id=wx.ID_SELECTALL)
self.Bind(
wx.EVT_MENU, self.cut_copy_paste_del_sel_event, id=wx.ID_SELECTALL
)

# findmenu = wx.Menu()
# menubar.Append(findmenu, 'F&ind')
Expand Down Expand Up @@ -1072,10 +1074,10 @@ def close_all_action(self):
def cut_copy_paste_del_sel_event(self, event):
"""Event requesting cut, copy, paste, delete, or select all text."""

if event.GetId() == (
wx.ID_CUT or wx.ID_COPY or wx.ID_PASTE or wx.ID_DELETE or
wx.ID_SELECTALL
):
ids = set((
wx.ID_CUT, wx.ID_COPY, wx.ID_PASTE, wx.ID_DELETE, wx.ID_SELECTALL
))
if event.GetId() in ids:
self.cut_copy_paste_del_sel_action(event)
else:
event.Skip()
Expand All @@ -1084,7 +1086,6 @@ def cut_copy_paste_del_sel_action(self, event):
"""Cut, copy, paste, delete, or select all text."""

self.show_notebook_if_not_shown()

text = self.FindFocus()
if text is not None:
if event.GetId() == wx.ID_CUT:
Expand Down

0 comments on commit 13ab524

Please sign in to comment.