mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Port some changes from Classic
This commit is contained in:
@@ -31,6 +31,9 @@ class SpeedMeterDemo(wx.Panel):
|
||||
|
||||
wx.Panel.__init__(self, parent, style=wx.TAB_TRAVERSAL|wx.NO_FULL_REPAINT_ON_RESIZE)
|
||||
|
||||
wx.CallLater(50, self.laterStuff)
|
||||
|
||||
def laterStuff(self):
|
||||
panel = wx.Panel(self, -1)
|
||||
sizer = wx.FlexGridSizer(rows=2, cols=3, vgap=2, hgap=5)
|
||||
|
||||
@@ -516,6 +519,8 @@ class SpeedMeterDemo(wx.Panel):
|
||||
self.SetSizer(mainSizer)
|
||||
mainSizer.Layout()
|
||||
|
||||
self.SendSizeEvent()
|
||||
|
||||
self.timer.Start(1000)
|
||||
self.timer3.Start(500)
|
||||
|
||||
|
||||
@@ -365,17 +365,11 @@ class BufferedWindow(wx.Window):
|
||||
# Make new off screen bitmap: this bitmap will always have the
|
||||
# current drawing in it, so it can be used to save the image to
|
||||
# a file, or whatever.
|
||||
|
||||
# This seems required on MacOS, it doesn't like wx.Bitmap with
|
||||
# size = (0, 0)
|
||||
# Thanks to Gerard Grazzini
|
||||
|
||||
if "__WXMAC__" in wx.Platform:
|
||||
if self.Width == 0:
|
||||
self.Width = 1
|
||||
if self.Height == 0:
|
||||
self.Height = 1
|
||||
|
||||
|
||||
# Some platforms object to creating bitmaps with size < (1,1)
|
||||
self.Width = max(self.Width, 1)
|
||||
self.Height = max(self.Height, 1)
|
||||
|
||||
self._Buffer = wx.Bitmap(self.Width, self.Height)
|
||||
self.UpdateDrawing()
|
||||
|
||||
|
||||
@@ -234,6 +234,7 @@ class Renderer:
|
||||
def renderCharacterData(self, data, x, y):
|
||||
raise NotImplementedError()
|
||||
|
||||
from wx.lib.six import PY3
|
||||
|
||||
def _addGreek():
|
||||
alpha = 0xE1
|
||||
@@ -243,7 +244,10 @@ def _addGreek():
|
||||
for i, name in enumerate(_greek_letters):
|
||||
def start(self, attrs, code=chr(alpha+i)):
|
||||
self.start_font({"encoding" : _greekEncoding})
|
||||
self.characterData(code)
|
||||
if not PY3:
|
||||
self.characterData(code.decode('iso8859-7'))
|
||||
else:
|
||||
self.characterData(code)
|
||||
self.end_font()
|
||||
setattr(Renderer, "start_%s" % name, start)
|
||||
setattr(Renderer, "end_%s" % name, end)
|
||||
@@ -251,7 +255,10 @@ def _addGreek():
|
||||
continue # There is no capital for altsigma
|
||||
def start(self, attrs, code=chr(Alpha+i)):
|
||||
self.start_font({"encoding" : _greekEncoding})
|
||||
self.characterData(code)
|
||||
if not PY3:
|
||||
self.characterData(code.decode('iso8859-7'))
|
||||
else:
|
||||
self.characterData(code)
|
||||
self.end_font()
|
||||
setattr(Renderer, "start_%s" % name.capitalize(), start)
|
||||
setattr(Renderer, "end_%s" % name.capitalize(), end)
|
||||
|
||||
Reference in New Issue
Block a user