The UseAntiAliasing is off by default on wxMac. Add a menu item to
the Py* Apps for experimenting with it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -174,6 +174,7 @@ def runTest(frame, nb, log):
|
|||||||
#ed.StyleClearAll()
|
#ed.StyleClearAll()
|
||||||
#ed.SetScrollWidth(800)
|
#ed.SetScrollWidth(800)
|
||||||
#ed.SetWrapMode(True)
|
#ed.SetWrapMode(True)
|
||||||
|
#ed.SetUseAntiAliasing(False)
|
||||||
|
|
||||||
ed.SetText(demoText)
|
ed.SetText(demoText)
|
||||||
|
|
||||||
|
@@ -59,7 +59,8 @@ class PythonSTC(stc.StyledTextCtrl):
|
|||||||
self.SetViewWhiteSpace(False)
|
self.SetViewWhiteSpace(False)
|
||||||
#self.SetBufferedDraw(False)
|
#self.SetBufferedDraw(False)
|
||||||
#self.SetViewEOL(True)
|
#self.SetViewEOL(True)
|
||||||
|
#self.SetUseAntiAliasing(True)
|
||||||
|
|
||||||
self.SetEdgeMode(stc.STC_EDGE_BACKGROUND)
|
self.SetEdgeMode(stc.STC_EDGE_BACKGROUND)
|
||||||
self.SetEdgeColumn(78)
|
self.SetEdgeColumn(78)
|
||||||
|
|
||||||
|
@@ -55,6 +55,16 @@ Updated the AnalogClockWindow with many enhancements from E. A. Tac
|
|||||||
|
|
||||||
wxMac now has wx.ToggleButton!
|
wxMac now has wx.ToggleButton!
|
||||||
|
|
||||||
|
wx.stc.StyledTextCtrl has been update to version 1.58 of Scintilla.
|
||||||
|
|
||||||
|
To help with the wx.stc.StyledTextCtrl performance issues on wxMac
|
||||||
|
I've added a SetUseAntiAliasing method (and GetUseAntiAliasing) too
|
||||||
|
that will turn off the use of antialiased fonts in the wxSTC, allowing
|
||||||
|
it to bypass the slow text measuring routines and use the fast and
|
||||||
|
simple one instead. By default the setting is turned off. When run
|
||||||
|
on OSX The Py* apps have a new item on the Options menu for
|
||||||
|
controlling this setting if you would like to experiment with it.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -607,15 +607,18 @@ class Editor:
|
|||||||
|
|
||||||
def getStatus(self):
|
def getStatus(self):
|
||||||
"""Return (filepath, line, column) status tuple."""
|
"""Return (filepath, line, column) status tuple."""
|
||||||
pos = self.window.GetCurrentPos()
|
if self.window:
|
||||||
line = self.window.LineFromPosition(pos) + 1
|
pos = self.window.GetCurrentPos()
|
||||||
col = self.window.GetColumn(pos)
|
line = self.window.LineFromPosition(pos) + 1
|
||||||
if self.buffer:
|
col = self.window.GetColumn(pos)
|
||||||
name = self.buffer.doc.filepath or self.buffer.name
|
if self.buffer:
|
||||||
|
name = self.buffer.doc.filepath or self.buffer.name
|
||||||
|
else:
|
||||||
|
name = ''
|
||||||
|
status = (name, line, col)
|
||||||
|
return status
|
||||||
else:
|
else:
|
||||||
name = ''
|
return ('', 0, 0)
|
||||||
status = (name, line, col)
|
|
||||||
return status
|
|
||||||
|
|
||||||
def getText(self):
|
def getText(self):
|
||||||
"""Return contents of editor."""
|
"""Return contents of editor."""
|
||||||
|
@@ -35,6 +35,7 @@ ID_COPY_PLUS = wx.NewId()
|
|||||||
ID_NAMESPACE = wx.NewId()
|
ID_NAMESPACE = wx.NewId()
|
||||||
ID_PASTE_PLUS = wx.NewId()
|
ID_PASTE_PLUS = wx.NewId()
|
||||||
ID_WRAP = wx.NewId()
|
ID_WRAP = wx.NewId()
|
||||||
|
ID_USEAA = wx.NewId()
|
||||||
|
|
||||||
|
|
||||||
class Frame(wx.Frame):
|
class Frame(wx.Frame):
|
||||||
@@ -106,18 +107,18 @@ class Frame(wx.Frame):
|
|||||||
|
|
||||||
m = self.autocompMenu = wx.Menu()
|
m = self.autocompMenu = wx.Menu()
|
||||||
m.Append(ID_AUTOCOMP_SHOW, 'Show Auto Completion',
|
m.Append(ID_AUTOCOMP_SHOW, 'Show Auto Completion',
|
||||||
'Show auto completion list', 1)
|
'Show auto completion list', wx.ITEM_CHECK)
|
||||||
m.Append(ID_AUTOCOMP_MAGIC, 'Include Magic Attributes',
|
m.Append(ID_AUTOCOMP_MAGIC, 'Include Magic Attributes',
|
||||||
'Include attributes visible to __getattr__ and __setattr__',
|
'Include attributes visible to __getattr__ and __setattr__',
|
||||||
1)
|
wx.ITEM_CHECK)
|
||||||
m.Append(ID_AUTOCOMP_SINGLE, 'Include Single Underscores',
|
m.Append(ID_AUTOCOMP_SINGLE, 'Include Single Underscores',
|
||||||
'Include attibutes prefixed by a single underscore', 1)
|
'Include attibutes prefixed by a single underscore', wx.ITEM_CHECK)
|
||||||
m.Append(ID_AUTOCOMP_DOUBLE, 'Include Double Underscores',
|
m.Append(ID_AUTOCOMP_DOUBLE, 'Include Double Underscores',
|
||||||
'Include attibutes prefixed by a double underscore', 1)
|
'Include attibutes prefixed by a double underscore', wx.ITEM_CHECK)
|
||||||
|
|
||||||
m = self.calltipsMenu = wx.Menu()
|
m = self.calltipsMenu = wx.Menu()
|
||||||
m.Append(ID_CALLTIPS_SHOW, 'Show Call Tips',
|
m.Append(ID_CALLTIPS_SHOW, 'Show Call Tips',
|
||||||
'Show call tips with argument signature and docstring', 1)
|
'Show call tips with argument signature and docstring', wx.ITEM_CHECK)
|
||||||
|
|
||||||
m = self.optionsMenu = wx.Menu()
|
m = self.optionsMenu = wx.Menu()
|
||||||
m.AppendMenu(ID_AUTOCOMP, '&Auto Completion', self.autocompMenu,
|
m.AppendMenu(ID_AUTOCOMP, '&Auto Completion', self.autocompMenu,
|
||||||
@@ -125,7 +126,10 @@ class Frame(wx.Frame):
|
|||||||
m.AppendMenu(ID_CALLTIPS, '&Call Tips', self.calltipsMenu,
|
m.AppendMenu(ID_CALLTIPS, '&Call Tips', self.calltipsMenu,
|
||||||
'Call Tip Options')
|
'Call Tip Options')
|
||||||
m.Append(ID_WRAP, '&Wrap Lines',
|
m.Append(ID_WRAP, '&Wrap Lines',
|
||||||
'Wrap lines at right edge', 1)
|
'Wrap lines at right edge', wx.ITEM_CHECK)
|
||||||
|
if wx.Platform == "__WXMAC__":
|
||||||
|
m.Append(ID_USEAA, '&Use AntiAliasing',
|
||||||
|
'Use anti-aliased fonts', wx.ITEM_CHECK)
|
||||||
|
|
||||||
m = self.helpMenu = wx.Menu()
|
m = self.helpMenu = wx.Menu()
|
||||||
m.AppendSeparator()
|
m.AppendSeparator()
|
||||||
@@ -163,6 +167,7 @@ class Frame(wx.Frame):
|
|||||||
wx.EVT_MENU(self, ID_AUTOCOMP_DOUBLE, self.OnAutoCompleteDouble)
|
wx.EVT_MENU(self, ID_AUTOCOMP_DOUBLE, self.OnAutoCompleteDouble)
|
||||||
wx.EVT_MENU(self, ID_CALLTIPS_SHOW, self.OnCallTipsShow)
|
wx.EVT_MENU(self, ID_CALLTIPS_SHOW, self.OnCallTipsShow)
|
||||||
wx.EVT_MENU(self, ID_WRAP, self.OnWrap)
|
wx.EVT_MENU(self, ID_WRAP, self.OnWrap)
|
||||||
|
wx.EVT_MENU(self, ID_USEAA, self.OnUseAA)
|
||||||
|
|
||||||
wx.EVT_UPDATE_UI(self, ID_NEW, self.OnUpdateMenu)
|
wx.EVT_UPDATE_UI(self, ID_NEW, self.OnUpdateMenu)
|
||||||
wx.EVT_UPDATE_UI(self, ID_OPEN, self.OnUpdateMenu)
|
wx.EVT_UPDATE_UI(self, ID_OPEN, self.OnUpdateMenu)
|
||||||
@@ -187,6 +192,7 @@ class Frame(wx.Frame):
|
|||||||
wx.EVT_UPDATE_UI(self, ID_AUTOCOMP_DOUBLE, self.OnUpdateMenu)
|
wx.EVT_UPDATE_UI(self, ID_AUTOCOMP_DOUBLE, self.OnUpdateMenu)
|
||||||
wx.EVT_UPDATE_UI(self, ID_CALLTIPS_SHOW, self.OnUpdateMenu)
|
wx.EVT_UPDATE_UI(self, ID_CALLTIPS_SHOW, self.OnUpdateMenu)
|
||||||
wx.EVT_UPDATE_UI(self, ID_WRAP, self.OnUpdateMenu)
|
wx.EVT_UPDATE_UI(self, ID_WRAP, self.OnUpdateMenu)
|
||||||
|
wx.EVT_UPDATE_UI(self, ID_USEAA, self.OnUpdateMenu)
|
||||||
|
|
||||||
def OnFileNew(self, event):
|
def OnFileNew(self, event):
|
||||||
self.bufferNew()
|
self.bufferNew()
|
||||||
@@ -284,6 +290,11 @@ class Frame(wx.Frame):
|
|||||||
win = wx.Window_FindFocus()
|
win = wx.Window_FindFocus()
|
||||||
win.SetWrapMode(event.IsChecked())
|
win.SetWrapMode(event.IsChecked())
|
||||||
|
|
||||||
|
def OnUseAA(self, event):
|
||||||
|
win = wx.Window_FindFocus()
|
||||||
|
win.SetUseAntiAliasing(event.IsChecked())
|
||||||
|
|
||||||
|
|
||||||
def OnUpdateMenu(self, event):
|
def OnUpdateMenu(self, event):
|
||||||
"""Update menu items based on current status and context."""
|
"""Update menu items based on current status and context."""
|
||||||
win = wx.Window_FindFocus()
|
win = wx.Window_FindFocus()
|
||||||
@@ -342,6 +353,8 @@ class Frame(wx.Frame):
|
|||||||
event.Check(win.autoCallTip)
|
event.Check(win.autoCallTip)
|
||||||
elif id == ID_WRAP:
|
elif id == ID_WRAP:
|
||||||
event.Check(win.GetWrapMode())
|
event.Check(win.GetWrapMode())
|
||||||
|
elif id == ID_USEAA:
|
||||||
|
event.Check(win.GetUseAntiAliasing())
|
||||||
else:
|
else:
|
||||||
event.Enable(False)
|
event.Enable(False)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
Reference in New Issue
Block a user