Switched to using True/False in the wxPython lib and demo instead of

true/false or TRUE/FALSE to prepare for the new boolean type and
constants being added to Python.  Added code to wx.py to test for the
existence of the new constants and to create suitable values if not
present.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-02-26 18:38:37 +00:00
parent a57fa3cc36
commit 64dfb023eb
135 changed files with 953 additions and 946 deletions

View File

@@ -1,18 +1,18 @@
from wxPython.wx import *
try:
from wxPython.glcanvas import *
haveGLCanvas = true
haveGLCanvas = True
except ImportError:
haveGLCanvas = false
haveGLCanvas = False
try:
# The Python OpenGL package can be found at
# http://PyOpenGL.sourceforge.net/
from OpenGL.GL import *
from OpenGL.GLUT import *
haveOpenGL = true
haveOpenGL = True
except ImportError:
haveOpenGL = false
haveOpenGL = False
#----------------------------------------------------------------------
@@ -62,7 +62,7 @@ else:
c.SetSize((200, 200))
box.Add(c, 0, wxALIGN_CENTER|wxALL, 15)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(box)
@@ -71,7 +71,7 @@ else:
canvasClass = eval(canvasClassName)
frame = wxFrame(None, -1, canvasClassName, size=(400,400))
canvas = canvasClass(frame)
frame.Show(true)
frame.Show(True)
@@ -85,7 +85,7 @@ else:
class MyCanvasBase(wxGLCanvas):
def __init__(self, parent):
wxGLCanvas.__init__(self, parent, -1)
self.init = false
self.init = False
# initial mouse position
self.lastx = self.x = 30
self.lasty = self.y = 30
@@ -110,7 +110,7 @@ else:
self.SetCurrent()
if not self.init:
self.InitGL()
self.init = true
self.init = True
self.OnDraw()
def OnMouseDown(self, evt):
@@ -123,7 +123,7 @@ else:
if evt.Dragging() and evt.LeftIsDown():
self.x, self.y = self.lastx, self.lasty
self.x, self.y = evt.GetPosition()
self.Refresh(false)
self.Refresh(False)
@@ -268,9 +268,9 @@ def _test():
frame = wxFrame(None, -1, "GL Demos", wxDefaultPosition, wxSize(600,300))
#win = ConeCanvas(frame)
MySplitter(frame)
frame.Show(TRUE)
frame.Show(True)
self.SetTopWindow(frame)
return TRUE
return True
app = MyApp(0)
app.MainLoop()