X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d6685e21c32c9a7ae18c5e3a4b39b5466614e46..d1bb3e121f109478099837e427a4636f156a9959:/wxPython/wx/lib/plot.py diff --git a/wxPython/wx/lib/plot.py b/wxPython/wx/lib/plot.py index 416fc559af..bab8d54762 100644 --- a/wxPython/wx/lib/plot.py +++ b/wxPython/wx/lib/plot.py @@ -16,6 +16,10 @@ # o Reworked test frame to work with wx demo framework. This saves a bit # of tedious cut and paste, and the test app is excellent. # +# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxScrolledMessageDialog -> ScrolledMessageDialog +# """ This is a simple light weight plotting module that can be used with @@ -388,9 +392,6 @@ class PlotCanvas(wx.Window): self.SetBackgroundColour("white") - self.Bind(wx.EVT_PAINT, self.OnPaint) - self.Bind(wx.EVT_SIZE, self.OnSize) - # Create some mouse events for zooming self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseLeftDown) self.Bind(wx.EVT_LEFT_UP, self.OnMouseLeftUp) @@ -435,10 +436,13 @@ class PlotCanvas(wx.Window): self._fontSizeTitle= 15 self._fontSizeLegend= 7 + self.Bind(wx.EVT_PAINT, self.OnPaint) + self.Bind(wx.EVT_SIZE, self.OnSize) # OnSize called to make sure the buffer is initialized. # This might result in OnSize getting called twice on some # platforms at initialization, but little harm done. - self.OnSize(None) # sets the initial size based on client size + if wx.Platform != "__WXMAC__": + self.OnSize(None) # sets the initial size based on client size # SaveFile @@ -974,7 +978,7 @@ class PlotCanvas(wx.Window): dc.SetPen(wx.Pen(wx.BLACK)) dc.SetBrush(wx.Brush( wx.WHITE, wx.TRANSPARENT ) ) dc.SetLogicalFunction(wx.INVERT) - dc.DrawRectangle( (ptx,pty), (rectWidth,rectHeight)) + dc.DrawRectangle( ptx,pty, rectWidth,rectHeight) dc.SetLogicalFunction(wx.COPY) dc.EndDrawing() @@ -1200,16 +1204,16 @@ class FloatDCWrapper: self.theDC = aDC def DrawLine(self, x1,y1,x2,y2): - self.theDC.DrawLine((int(x1),int(y1)),(int(x2),int(y2))) + self.theDC.DrawLine(int(x1),int(y1), int(x2),int(y2)) def DrawText(self, txt, x, y): - self.theDC.DrawText(txt, (int(x), int(y))) + self.theDC.DrawText(txt, int(x), int(y)) def DrawRotatedText(self, txt, x, y, angle): - self.theDC.DrawRotatedText(txt, (int(x), int(y)), angle) + self.theDC.DrawRotatedText(txt, int(x), int(y), angle) def SetClippingRegion(self, x, y, width, height): - self.theDC.SetClippingRegion((int(x), int(y)), (int(width), int(height))) + self.theDC.SetClippingRegion(int(x), int(y), int(width), int(height)) def SetDeviceOrigin(self, x, y): self.theDC.SetDeviceOrigin(int(x), int(y)) @@ -1455,8 +1459,8 @@ class TestFrame(wx.Frame): self.client.Reset() def OnHelpAbout(self, event): - from wx.lib.dialogs import wxScrolledMessageDialog - about = wxScrolledMessageDialog(self, __doc__, "About...") + from wx.lib.dialogs import ScrolledMessageDialog + about = ScrolledMessageDialog(self, __doc__, "About...") about.ShowModal() def resetDefaults(self):