--- a/controls/CustomStyledTextCtrl.py Mon Aug 21 20:17:19 2017 +0000
+++ b/controls/CustomStyledTextCtrl.py Mon Aug 21 23:22:58 2017 +0300
@@ -26,19 +26,21 @@
import wx.stc
if wx.Platform == '__WXMSW__':
- faces = { 'times': 'Times New Roman',
- 'mono' : 'Courier New',
- 'helv' : 'Arial',
- 'other': 'Comic Sans MS',
- 'size' : 10,
- }
+ faces = {
+ 'times': 'Times New Roman',
+ 'mono': 'Courier New',
+ 'helv': 'Arial',
+ 'other': 'Comic Sans MS',
+ 'size': 10,
+ }
else:
- faces = { 'times': 'Times',
- 'mono' : 'Courier',
- 'helv' : 'Helvetica',
- 'other': 'new century schoolbook',
- 'size' : 12,
- }
+ faces = {
+ 'times': 'Times',
+ 'mono': 'Courier',
+ 'helv': 'Helvetica',
+ 'other': 'new century schoolbook',
+ 'size': 12,
+ }
NAVIGATION_KEYS = [
wx.WXK_END,
@@ -58,6 +60,7 @@
wx.WXK_NUMPAD_PAGEDOWN,
wx.WXK_NUMPAD_END]
+
def GetCursorPos(old, new):
if old == "":
return 0
@@ -81,13 +84,14 @@
else:
return None
+
class CustomStyledTextCtrl(wx.stc.StyledTextCtrl):
-
+
def __init__(self, *args, **kwargs):
wx.stc.StyledTextCtrl.__init__(self, *args, **kwargs)
-
+
self.Bind(wx.EVT_MOTION, self.OnMotion)
-
+
def OnMotion(self, event):
if wx.Platform == '__WXMSW__':
if not event.Dragging():