X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b881fc787d2823bdd8a415080b82feee90804a17..f50de1504e002ba3afac3491c8b4817870c850d8:/wxPython/wx/lib/editor/editor.py diff --git a/wxPython/wx/lib/editor/editor.py b/wxPython/wx/lib/editor/editor.py index ef709333b0..d0a67cbeef 100644 --- a/wxPython/wx/lib/editor/editor.py +++ b/wxPython/wx/lib/editor/editor.py @@ -1,5 +1,5 @@ #---------------------------------------------------------------------- -# Name: wxPython.lib.editor.wxEditor +# Name: wxPython.lib.editor.Editor # Purpose: An intelligent text editor with colorization capabilities. # # Original @@ -24,6 +24,10 @@ # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxEditor -> Editor +# import os import time @@ -75,7 +79,7 @@ class Scroller: #---------------------------------------------------------------------- -class wxEditor(wx.ScrolledWindow): +class Editor(wx.ScrolledWindow): def __init__(self, parent, id, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0): @@ -127,9 +131,12 @@ class wxEditor(wx.ScrolledWindow): def NiceFontForPlatform(self): if wx.Platform == "__WXMSW__": - return wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL) + font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL) else: - return wx.Font(12, wx.MODERN, wx.NORMAL, wx.NORMAL, False) + font = wx.Font(12, wx.MODERN, wx.NORMAL, wx.NORMAL, False) + if wx.Platform == "__WXMAC__": + font.SetNoAntiAliasing() + return font def UnixKeyHack(self, key): # @@ -209,7 +216,7 @@ class wxEditor(wx.ScrolledWindow): pass def DrawEditText(self, t, x, y, dc): - dc.DrawText(t, (x * self.fw, y * self.fh)) + dc.DrawText(t, x * self.fw, y * self.fh) def DrawLine(self, line, dc): if self.IsLine(line): @@ -257,7 +264,7 @@ class wxEditor(wx.ScrolledWindow): x = 0 y = (len(self.lines) - self.sy) * self.fh hasTransparency = 1 - dc.DrawBitmap(self.eofMarker, (x, y), hasTransparency) + dc.DrawBitmap(self.eofMarker, x, y, hasTransparency) ##------------------ cursor-related functions @@ -286,7 +293,7 @@ class wxEditor(wx.ScrolledWindow): szy = self.fh x = xp * szx y = yp * szy - dc.Blit((x,y), (szx,szy), dc, (x,y), wx.SRC_INVERT) + dc.Blit(x,y, szx,szy, dc, x,y, wx.SRC_INVERT) self.sco_x = xp self.sco_y = yp @@ -767,7 +774,7 @@ class wxEditor(wx.ScrolledWindow): def MoveLeft(self, event): if self.cx == 0: if self.cy == 0: - wxBell() + wx.Bell() else: self.cVert(-1) self.cx = self.CurrentLineLength() @@ -778,7 +785,7 @@ class wxEditor(wx.ScrolledWindow): linelen = self.CurrentLineLength() if self.cx == linelen: if self.cy == len(self.lines) - 1: - wxBell() + wx.Bell() else: self.cx = 0 self.cVert(1)