AGW on Phoenix (3): Avoid DeprecationWarning for obsolete classes/methods.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Andrea Gavana
2012-12-18 21:49:49 +00:00
parent 52fe4ee5eb
commit 772c323322
5 changed files with 35 additions and 23 deletions

View File

@@ -151,7 +151,7 @@ class AquaButtonEvent(wx.PyCommandEvent):
return self.theButton
class AquaButton(wx.PyControl):
class AquaButton(wx.wx.Control):
""" This is the main class implementation of :class:`AquaButton`. """
def __init__(self, parent, id=wx.ID_ANY, bitmap=None, label="", pos=wx.DefaultPosition,
@@ -175,7 +175,7 @@ class AquaButton(wx.PyControl):
:param string `name`: the button name.
"""
wx.PyControl.__init__(self, parent, id, pos, size, style, validator, name)
wx.wx.Control.__init__(self, parent, id, pos, size, style, validator, name)
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
@@ -349,7 +349,7 @@ class AquaButton(wx.PyControl):
# Save the bitmap using wx.MemoryDC for later use
self._saveBitmap = False
memory = wx.MemoryDC()
self._storedBitmap = wx.EmptyBitmapRGBA(max(width, 1), max(height, 1))
self._storedBitmap = wx.Bitmap.FromRGBA(max(width, 1), max(height, 1))
memory.SelectObject(self._storedBitmap)
gcMemory = wx.GraphicsContext.Create(memory)
@@ -565,7 +565,7 @@ class AquaButton(wx.PyControl):
if size is None:
size = wx.DefaultSize
wx.PyControl.SetInitialSize(self, size)
wx.wx.Control.SetInitialSize(self, size)
SetBestSize = SetInitialSize
@@ -574,7 +574,7 @@ class AquaButton(wx.PyControl):
"""
Can this window be given focus by mouse click?
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
return self.IsShown() and self.IsEnabled()
@@ -587,7 +587,7 @@ class AquaButton(wx.PyControl):
:return: an instance of :class:`VisualAttributes`.
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
return wx.Button.GetClassDefaultAttributes()
@@ -598,7 +598,7 @@ class AquaButton(wx.PyControl):
Overridden base class virtual. Buttons usually don't inherit
the parent's colours.
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
return False
@@ -610,10 +610,10 @@ class AquaButton(wx.PyControl):
:param bool `enable`: ``True`` to enable the button, ``False`` to disable it.
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
wx.PyControl.Enable(self, enable)
wx.wx.Control.Enable(self, enable)
self.Refresh()
@@ -649,7 +649,7 @@ class AquaButton(wx.PyControl):
:return: An instance of :class:`Size`.
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
label = self.GetLabel()
@@ -677,10 +677,10 @@ class AquaButton(wx.PyControl):
:param `colour`: a valid :class:`Colour` object.
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
wx.PyControl.SetBackgroundColour(self, colour)
wx.wx.Control.SetBackgroundColour(self, colour)
self._backColour = colour
self.Invalidate()
@@ -691,7 +691,7 @@ class AquaButton(wx.PyControl):
:return: An instance of :class:`Colour`.
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
return self._backColour
@@ -806,10 +806,10 @@ class AquaButton(wx.PyControl):
:param `colour`: a valid :class:`Colour` object.
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
wx.PyControl.SetForegroundColour(self, colour)
wx.wx.Control.SetForegroundColour(self, colour)
self._textColour = colour
self.Invalidate()
@@ -820,7 +820,7 @@ class AquaButton(wx.PyControl):
:return: An instance of :class:`Colour`.
:note: Overridden from :class:`PyControl`.
:note: Overridden from :class:`wx.Control`.
"""
return self._textColour
@@ -1061,7 +1061,7 @@ class __ToggleMixin(object):
# Save the bitmap using wx.MemoryDC for later use
self._saveBitmap = False
memory = wx.MemoryDC()
self._storedBitmap = wx.EmptyBitmapRGBA(max(width, 1), max(height, 1))
self._storedBitmap = wx.Bitmap.FromRGBA(max(width, 1), max(height, 1))
memory.SelectObject(self._storedBitmap)
gcMemory = wx.GraphicsContext.Create(memory)

View File

@@ -2497,7 +2497,7 @@ ID_RESTORE_FRAME = wx.ID_HIGHEST + 10000
BUTTON_DROPDOWN_WIDTH = 10
""" Width of the drop-down button in AuiToolBar. """
DISABLED_TEXT_GREY_HUE = 153.0
DISABLED_TEXT_GREY_HUE = 153
""" Hue text colour for the disabled text in AuiToolBar. """
DISABLED_TEXT_COLOUR = wx.Colour(DISABLED_TEXT_GREY_HUE,
DISABLED_TEXT_GREY_HUE,

View File

@@ -797,7 +797,7 @@ class BPArt(object):
for coord in range(start, start + size):
currCol = wx.Colour(col1.Red() + rf, col1.Green() + gf, col1.Blue() + bf)
currCol = wx.Colour(col1.Red() + int(rf), col1.Green() + int(gf), col1.Blue() + int(bf))
dc.SetBrush(wx.Brush(currCol, wx.SOLID))
dc.SetPen(wx.Pen(currCol))
if isVertical:

View File

@@ -165,7 +165,12 @@ import wx
# These two are needed only to check if the InfoBar parent
# is managed by PyAUI or wx.aui, in which case the handling
# of the showing/dismissing is done a bit differently
import wx.aui
CPP_AUI = True
try:
import wx.aui
except ImportError:
CPP_AUI = False
from aui import framemanager as framemanager
# These are for the AutoWrapStaticText class
@@ -556,7 +561,10 @@ class InfoBar(wx.Control):
self.HideWithEffect(self.GetHideEffect(), self.GetEffectDuration())
handler = self.GetParent().GetEventHandler()
managers = (framemanager.AuiManager, wx.aui.AuiManager)
if CPP_AUI:
managers = (framemanager.AuiManager, wx.aui.AuiManager)
else:
managers = (framemanager.AuiManager, )
if not isinstance(handler, managers):
self.UpdateParent()
@@ -593,7 +601,11 @@ class InfoBar(wx.Control):
self.ShowWithEffect(self.GetShowEffect(), self.GetEffectDuration())
handler = self.GetParent().GetEventHandler()
managers = (framemanager.AuiManager, wx.aui.AuiManager)
if CPP_AUI:
managers = (framemanager.AuiManager, wx.aui.AuiManager)
else:
managers = (framemanager.AuiManager, )
if isinstance(handler, managers):
pane = handler.GetPane(self)

View File

@@ -55,7 +55,7 @@ class PyEmbeddedImage(object):
return data
def GetIcon(self):
icon = wx.EmptyIcon()
icon = wx.Icon()
icon.CopyFromBitmap(self.GetBitmap())
return icon