X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7bf854050fd5c04469d4334524433a31d4ba997a..d9f39e09e82e99c422619f4e3df536d0a9e87987:/utils/wxPython/tests/test2.py diff --git a/utils/wxPython/tests/test2.py b/utils/wxPython/tests/test2.py index 72810d7e73..aacfba61e7 100644 --- a/utils/wxPython/tests/test2.py +++ b/utils/wxPython/tests/test2.py @@ -12,33 +12,35 @@ #---------------------------------------------------------------------------- -from wxPython import * +from wxPython.wx import * #--------------------------------------------------------------------------- -class MyCanvas(wxWindow): +class MyCanvas(wxScrolledWindow): def __init__(self, parent): - wxWindow.__init__(self, parent, -1, wxPoint(0, 0), wxPyDefaultSize, wxSUNKEN_BORDER) + wxScrolledWindow.__init__(self, parent, -1, wxPoint(0, 0), wxPyDefaultSize, wxSUNKEN_BORDER) + self.SetBackgroundColour(wxNamedColor("WHITE")) self.Connect(-1, -1, wxEVT_LEFT_DOWN, self.OnLeftButtonEvent) self.Connect(-1, -1, wxEVT_LEFT_UP, self.OnLeftButtonEvent) self.Connect(-1, -1, wxEVT_MOTION, self.OnLeftButtonEvent) self.SetCursor(wxStockCursor(wxCURSOR_PENCIL)) bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP) - print 'bmp OK:', bmp.Ok() - print 'bmp: (%dx%dx%d)' % (bmp.GetWidth(), bmp.GetHeight(), bmp.GetDepth()) self.bmp = bmp + self.SetScrollbars(20, 20, 50, 50) + self.lines = [] def OnPaint(self, event): dc = wxPaintDC(self) + self.PrepareDC(dc) self.DoDrawing(dc) @@ -118,9 +120,8 @@ class MyFrame(wxFrame): self.Destroy() def OnSize(self, event): - w,h = self.GetClientSize() - #self.canvas.SetSize(5, 5, w-10, h-10) - self.canvas.SetDimensions(0, 0, w, h) + size = self.GetClientSize() + self.canvas.SetDimensions(5, 5, size.width-10, size.height-10) #--------------------------------------------------------------------------- @@ -133,6 +134,7 @@ class MyApp(wxApp): self.SetTopWindow(frame) return true + #--------------------------------------------------------------------------- @@ -152,6 +154,36 @@ if __name__ == '__main__': #---------------------------------------------------------------------------- # # $Log$ +# Revision 1.3 1999/04/30 03:29:53 RD +# wxPython 2.0b9, first phase (win32) +# Added gobs of stuff, see wxPython/README.txt for details +# +# Revision 1.2.4.1 1999/03/27 23:30:00 RD +# +# wxPython 2.0b8 +# Python thread support +# various minor additions +# various minor fixes +# +# Revision 1.2 1998/12/15 20:44:34 RD +# Changed the import semantics from "from wxPython import *" to "from +# wxPython.wx import *" This is for people who are worried about +# namespace pollution, they can use "from wxPython import wx" and then +# prefix all the wxPython identifiers with "wx." +# +# Added wxTaskbarIcon for wxMSW. +# +# Made the events work for wxGrid. +# +# Added wxConfig. +# +# Added wxMiniFrame for wxGTK, (untested.) +# +# Changed many of the args and return values that were pointers to gdi +# objects to references to reflect changes in the wxWindows API. +# +# Other assorted fixes and additions. +# # Revision 1.1 1998/08/09 08:28:05 RD # Initial version #