Can't use NameError to check for NotIMplemented anymore. Just
explicitly check platforms until I figure out a better way to do it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
# Author: Jeff Grimmett (grimmtoo@softhome.net), adapted from original
|
# Author: Jeff Grimmett (grimmtoo@softhome.net), adapted from original
|
||||||
# .wdr-derived demo
|
# .wdr-derived demo
|
||||||
#
|
#
|
||||||
# Created: 01/02/04
|
# Created: 02-Jan-2004
|
||||||
# RCS-ID: $Id$
|
# RCS-ID: $Id$
|
||||||
# Copyright:
|
# Copyright:
|
||||||
# Licence: wxWindows license
|
# Licence: wxWindows license
|
||||||
@@ -15,6 +15,10 @@
|
|||||||
import math
|
import math
|
||||||
import wx
|
import wx
|
||||||
|
|
||||||
|
haveJoystick = True
|
||||||
|
if wx.Platform == "__WXMAC__":
|
||||||
|
haveJoystick = False
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
# Once all supported versions of Python support 32-bit integers on all
|
# Once all supported versions of Python support 32-bit integers on all
|
||||||
@@ -963,8 +967,17 @@ class JoystickDemoPanel(wx.Panel):
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
def runTest(frame, nb, log):
|
def runTest(frame, nb, log):
|
||||||
win = JoystickDemoPanel(nb, log)
|
if haveJoystick:
|
||||||
return win
|
win = JoystickDemoPanel(nb, log)
|
||||||
|
return win
|
||||||
|
else:
|
||||||
|
dlg = wx.MessageDialog(
|
||||||
|
frame, 'wx.Joystick is not available on this platform.',
|
||||||
|
'Sorry', wx.OK | wx.ICON_INFORMATION
|
||||||
|
)
|
||||||
|
dlg.ShowModal()
|
||||||
|
dlg.Destroy()
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -9,9 +9,7 @@
|
|||||||
import wx
|
import wx
|
||||||
|
|
||||||
havePopupWindow = 1
|
havePopupWindow = 1
|
||||||
try:
|
if wx.Platform == '__WXMAC__':
|
||||||
wx.PopupWindow
|
|
||||||
except NameError:
|
|
||||||
havePopupWindow = 0
|
havePopupWindow = 0
|
||||||
wx.PopupWindow = wx.PopupTransientWindow = wx.Window
|
wx.PopupWindow = wx.PopupTransientWindow = wx.Window
|
||||||
|
|
||||||
@@ -199,7 +197,6 @@ def runTest(frame, nb, log):
|
|||||||
frame, 'wx.PopupWindow is not available on this platform.',
|
frame, 'wx.PopupWindow is not available on this platform.',
|
||||||
'Sorry', wx.OK | wx.ICON_INFORMATION
|
'Sorry', wx.OK | wx.ICON_INFORMATION
|
||||||
)
|
)
|
||||||
|
|
||||||
dlg.ShowModal()
|
dlg.ShowModal()
|
||||||
dlg.Destroy()
|
dlg.Destroy()
|
||||||
|
|
||||||
|
@@ -2,10 +2,7 @@
|
|||||||
import wx
|
import wx
|
||||||
|
|
||||||
haveToggleBtn = 1
|
haveToggleBtn = 1
|
||||||
|
if wx.Platform == "__WXX11__":
|
||||||
try:
|
|
||||||
wx.ToggleButton
|
|
||||||
except NameError:
|
|
||||||
haveToggleBtn = 0
|
haveToggleBtn = 0
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user