From: Kevin A. <al...@se...> - 2005-12-24 02:16:28
|
See my "Re: ignore Raise/Lower comment for now" message at: http://news.gmane.org/gmane.comp.python.wxpython.devel What I'm still not sure about is why the resourceEditor widget reordering doesn't appear to work on Windows or the Mac. I'm going to dig further and see where we broke this since it should at least do the right thing on at least one of the platforms. So far it appears that fixComponentOrder is not actually being called when it should be which certainly is a problem, so I need to figure out when and why that was changed. ka |
From: Kevin A. <al...@se...> - 2005-12-24 04:57:03
|
On Dec 23, 2005, at 6:16 PM, Kevin Altis wrote: > See my "Re: ignore Raise/Lower comment for now" message at: > > http://news.gmane.org/gmane.comp.python.wxpython.devel > > What I'm still not sure about is why the resourceEditor widget > reordering doesn't appear to work on Windows or the Mac. I'm going to > dig further and see where we broke this since it should at least do > the right thing on at least one of the platforms. So far it appears > that fixComponentOrder is not actually being called when it should be > which certainly is a problem, so I need to figure out when and why > that was changed. > > ka I think I may have got it. As far as I can tell, Lower() doesn't always work, but Raise() does, so I simply changed the code to do a little extra work... def fixComponentOrder(self, name): # KEA 2005-12-23 # Lower() doesn't appear to always work correctly, # so use Raise instead with a reversed list r = self.components.order[:] r.reverse() for c in r: self.components[c].Raise() ... Since fixComponentOrder is always called this appears to work correctly on the Mac as well. I'm still tempted to call Lower() on the Mac when a component is created in model.py but that is a separate issue. Anyway, I'll let this sit for a bit, so let me know if you notice any behavior that seems wrong. I don't want to start changing code to reverse the Property Editor list or change the current Front/Back semantics until we know this works correctly. I'll assume the developers are still in favor of reversing the Front/Back semantics, so I'll look at that next. ka |
From: Kevin A. <al...@se...> - 2005-12-27 19:33:57
|
The bad news is that Robin replied to my thread on wxPython-dev, saying "Since the official policy is that overlapping widgets is not supported then I doubt anything will be done for fear of breaking something else. I expect that this behavior will be left as platform default or 'undefined' by wx." "Just FYI, on wx.GTK2 the last created is always on top, and Raise/Lower don't seem to do anything with the button widgets. :-(" The last created item always being on top is what the Mac does too, if GTK1 does the same thing, then it is Windows that is the oddball on creation order. I have no idea whether the resourceEditor in cvs behaves correctly with GTK1 or GTK2 builds of wxPython. I found that a bug report I had submitted is still open, which makes me think that we are sort of screwed on GTK2. http://sourceforge.net/tracker/? func=detail&aid=1024777&group_id=9863&atid=109863 If anyone can confirm one way or another that would be great. My simple wxPython test program for overlaps is included below along with my workaround for making the Mac behave like Windows when the widget is created. ka --- import wx print wx.VERSION class MyApp(wx.App): def OnInit(self): frame = wx.Frame(None, -1, "minimal", size=(200, 200)) panel = wx.Panel(frame, -1) self.panel = panel frame.Show(True) # creation order overlaps 'Three' on top of "Two' # on top of 'One' on Mac wxPython 2.6.1 # creation order overlaps 'One' on top of "Two' # on top of 'Three' on Win2K wxPython 2.6.2 # not tested under Linux self.btn1 = wx.Button(panel, -1, 'One', (5, 30)) if wx.Platform == '__WXMAC__': self.btn1.Lower() self.btn2 = wx.Button(panel, -1, 'Two', (35, 40)) if wx.Platform == '__WXMAC__': self.btn2.Lower() self.btn3 = wx.Button(panel, -1, 'Three', (65, 50)) if wx.Platform == '__WXMAC__': self.btn3.Lower() btnRaise = wx.Button(panel, -1, 'Reverse Overlap', (50, 100)) wx.EVT_BUTTON(self, btnRaise.GetId(), self.on_mouseClick) self.SetTopWindow(frame) return True def on_mouseClick(self, event): self.btn2.Raise() self.btn3.Raise() app = MyApp(0) app.MainLoop() |