mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Fixes in wx.aui to properly transfer ownership of the menubar, and also some tweaks in the AUI_MDI sample in the demo.
This commit is contained in:
15
CHANGES.rst
15
CHANGES.rst
@@ -8,6 +8,21 @@
|
|||||||
wxPython Changelog
|
wxPython Changelog
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
4.0.0rc1
|
||||||
|
--------
|
||||||
|
* (not yet released)
|
||||||
|
|
||||||
|
PyPI: https://pypi.python.org/pypi/wxPython/4.0.0rc1
|
||||||
|
Extras: https://extras.wxPython.org/wxPython4/extras/
|
||||||
|
Pip: ``pip install wxPython==4.0.0rc1``
|
||||||
|
|
||||||
|
Changes in this release include the following:
|
||||||
|
|
||||||
|
* Fixes in wx.aui to properly transfer ownership of the menubar, and also some
|
||||||
|
tweaks in the AUI_MDI sample in the demo. (#540)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
4.0.0b2 -- "Hurricanes, Floods, and Forest Fires! Oh My!"
|
4.0.0b2 -- "Hurricanes, Floods, and Forest Fires! Oh My!"
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import wx
|
import wx
|
||||||
try:
|
import wx.aui as aui
|
||||||
from agw import aui
|
|
||||||
except ImportError: # if it's not there locally, try the wxPython lib.
|
|
||||||
import wx.lib.agw.aui as aui
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
@@ -17,10 +15,10 @@ class ParentFrame(aui.AuiMDIParentFrame):
|
|||||||
size=(640,480),
|
size=(640,480),
|
||||||
style=wx.DEFAULT_FRAME_STYLE)
|
style=wx.DEFAULT_FRAME_STYLE)
|
||||||
self.count = 0
|
self.count = 0
|
||||||
mb = self.MakeMenuBar()
|
self.mb = self.MakeMenuBar()
|
||||||
self.SetMenuBar(mb)
|
self.SetMenuBar(self.mb)
|
||||||
self.CreateStatusBar()
|
self.CreateStatusBar()
|
||||||
self.Bind(wx.EVT_CLOSE, self.OnDoClose)
|
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
|
||||||
|
|
||||||
def MakeMenuBar(self):
|
def MakeMenuBar(self):
|
||||||
mb = wx.MenuBar()
|
mb = wx.MenuBar()
|
||||||
@@ -35,13 +33,16 @@ class ParentFrame(aui.AuiMDIParentFrame):
|
|||||||
def OnNewChild(self, evt):
|
def OnNewChild(self, evt):
|
||||||
self.count += 1
|
self.count += 1
|
||||||
child = ChildFrame(self, self.count)
|
child = ChildFrame(self, self.count)
|
||||||
child.Show()
|
#child.Show()
|
||||||
|
|
||||||
def OnDoClose(self, evt):
|
def OnDoClose(self, evt):
|
||||||
|
self.Close()
|
||||||
|
|
||||||
|
def OnCloseWindow(self, evt):
|
||||||
# Close all ChildFrames first else Python crashes
|
# Close all ChildFrames first else Python crashes
|
||||||
for m in self.GetChildren():
|
for m in self.GetChildren():
|
||||||
if isinstance(m, aui.AuiMDIClientWindow):
|
if isinstance(m, aui.AuiMDIClientWindow):
|
||||||
for k in m.GetChildren():
|
for k in list(m.GetChildren()):
|
||||||
if isinstance(k, ChildFrame):
|
if isinstance(k, ChildFrame):
|
||||||
k.Close()
|
k.Close()
|
||||||
evt.Skip()
|
evt.Skip()
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import wx
|
import wx
|
||||||
try:
|
import wx.aui as aui
|
||||||
from agw import aui
|
|
||||||
except ImportError: # if it's not there locally, try the wxPython lib.
|
|
||||||
import wx.lib.agw.aui as aui
|
|
||||||
|
|
||||||
|
|
||||||
text = """\
|
text = """\
|
||||||
|
|||||||
@@ -37,12 +37,15 @@ def run():
|
|||||||
c = module.find('wxAuiMDIParentFrame')
|
c = module.find('wxAuiMDIParentFrame')
|
||||||
assert isinstance(c, etgtools.ClassDef)
|
assert isinstance(c, etgtools.ClassDef)
|
||||||
tools.fixTopLevelWindowClass(c)
|
tools.fixTopLevelWindowClass(c)
|
||||||
|
c.find('SetMenuBar.menuBar').transfer = True
|
||||||
|
c.find('SetArtProvider.provider').transfer = True
|
||||||
|
|
||||||
|
|
||||||
c = module.find('wxAuiMDIChildFrame')
|
c = module.find('wxAuiMDIChildFrame')
|
||||||
tools.fixTopLevelWindowClass(c)
|
tools.fixTopLevelWindowClass(c)
|
||||||
tools.fixSetStatusWidths(c.find('SetStatusWidths'))
|
tools.fixSetStatusWidths(c.find('SetStatusWidths'))
|
||||||
|
c.find('SetMenuBar.menuBar').transfer = True
|
||||||
|
c.find('Show').isVirtual = True
|
||||||
|
|
||||||
c = module.find('wxAuiMDIClientWindow')
|
c = module.find('wxAuiMDIClientWindow')
|
||||||
tools.fixWindowClass(c)
|
tools.fixWindowClass(c)
|
||||||
|
|||||||
Reference in New Issue
Block a user