From: Kevin A. <al...@ya...> - 2005-04-01 17:11:57
|
I've come up with a potential solution to raising child windows when the main window is selected in the resourceEditor. This is actually a problem for any PythonCard application with child windows, but seems to be more of annoyance in the resourceEditor as the Property Editor window is always being lost behind other application windows. You can just drop the following code into resourceEditor.py and see whether this gives the behavior you would expect. I would like to get some feedback before I check it into cvs. If you have overlapping windows, most likely because you're working on a small screen, this solution of forcing a Raise could be very annoying, so I would likely add a menu item under Options that would allow you to disable the Raise. def on_activate(self, event): if not hasattr(self, 'inActivate') or not self.inActivate: self.inActivate = True for c in self.GetChildren(): c.Raise() self.Raise() self.inActivate = False #event.skip() On a related note, I never added lowercase aliases for Raise and Lower to the Background class because I wasn't sure if this would be legal since raise is a keyword and we need it for raising exceptions. If someone knows the correct syntax so that we can have a lowercase alias to Raise I'll add it to the class; perhaps I could just do a setattr or something?! raise = wx.Frame.Raise ka __________________________________ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs |
From: <bra...@om...> - 2005-04-05 18:12:59
|
Kevin Altis wrote on 04/01/2005 11:11:20 AM: > I've come up with a potential solution to raising > child windows when the main window is selected in the > resourceEditor. This is actually a problem for any > PythonCard application with child windows, but seems > to be more of annoyance in the resourceEditor as the > Property Editor window is always being lost behind > other application windows. > > You can just drop the following code into > resourceEditor.py and see whether this gives the > behavior you would expect. I would like to get some > feedback before I check it into cvs. If you have > overlapping windows, most likely because you're > working on a small screen, this solution of forcing a > Raise could be very annoying, so I would likely add a > menu item under Options that would allow you to > disable the Raise. > > def on_activate(self, event): > if not hasattr(self, 'inActivate') or not > self.inActivate: > self.inActivate = True > for c in self.GetChildren(): > c.Raise() > self.Raise() > self.inActivate = False > #event.skip() Thanks, I will try this. > On a related note, I never added lowercase aliases for > Raise and Lower to the Background class because I > wasn't sure if this would be legal since raise is a > keyword and we need it for raising exceptions. If > someone knows the correct syntax so that we can have a > lowercase alias to Raise I'll add it to the class; > perhaps I could just do a setattr or something?! > > raise = wx.Frame.Raise Are lowercase aliases used for a lot of other names in PythonCard or wx? |
From: Kevin A. <al...@se...> - 2005-04-05 18:27:00
|
On Apr 5, 2005, at 11:12 AM, bra...@om... wrote: > > Kevin Altis wrote on 04/01/2005 11:11:20 AM: > > > > On a related note, I never added lowercase aliases for > > Raise and Lower to the Background class because I > > wasn't sure if this would be legal since raise is a > > keyword and we need it for raising exceptions. If > > someone knows the correct syntax so that we can have a > > lowercase alias to Raise I'll add it to the class; > > perhaps I could just do a setattr or something?! > > > > raise = wx.Frame.Raise > > Are lowercase aliases used for a lot of other names in PythonCard or > wx? wxPython wraps wxWidgets, which is C++ and the naming convention there is CamelCase style. All methods and attributes in PythonCard are mixedCase style, even if they are simply aliases for wxPython methods. This makes it easy to see where you are using wxPython methods and where you're using PythonCard framework code. In the PythonCard shell, I added code that excludes CamelCase wxPython methods from showing up in the auto-complete list so that you wouldn't see 150+ extra confusing method names all the time, but if you type something like self.Show( you'll notice that the wxPython methods are still there and available if you want to use them. ka |
From: Bo G. <bo...@sy...> - 2005-04-05 19:07:14
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> <a class="moz-txt-link-abbreviated" href="mailto:bra...@om...">bra...@om...</a> wrote: <blockquote cite="mid...@om..." type="cite"><br> <font size="2"><tt>Kevin Altis wrote on 04/01/2005 11:11:20 AM:<br> <br> > I've come up with a potential solution to raising<br> > child windows when the main window is selected in the<br> > resourceEditor. This is actually a problem for any<br> > PythonCard application with child windows, but seems<br> > to be more of annoyance in the resourceEditor as the<br> > Property Editor window is always being lost behind<br> > other application windows.<br> > <br> > You can just drop the following code into<br> > resourceEditor.py and see whether this gives the<br> > behavior you would expect. I would like to get some<br> > feedback before I check it into cvs. If you have<br> > overlapping windows, most likely because you're<br> > working on a small screen, this solution of forcing a<br> > Raise could be very annoying, so I would likely add a<br> > menu item under Options that would allow you to<br> > disable the Raise.<br> > <br> > def on_activate(self, event):<br> > if not hasattr(self, 'inActivate') or not<br> > self.inActivate:<br> > self.inActivate = True<br> > for c in self.GetChildren():<br> > c.Raise()<br> > self.Raise()<br> > self.inActivate = False<br> > #event.skip()<br> </tt></font> <br> <br> <font size="2"><tt>Thanks, I will try this.</tt></font> <br> <br> <font size="2"><tt><br> > On a related note, I never added lowercase aliases for<br> > Raise and Lower to the Background class because I<br> > wasn't sure if this would be legal since raise is a<br> > keyword and we need it for raising exceptions. If<br> > someone knows the correct syntax so that we can have a<br> > lowercase alias to Raise I'll add it to the class;<br> > perhaps I could just do a setattr or something?!<br> > <br> > raise = wx.Frame.Raise<br> </tt></font> <br> <font size="2"><tt>Are lowercase aliases used for a lot of other names in PythonCard or wx? <br> </tt></font> </blockquote> <br> I tried plugging this into resourceEditor.py on my Windows install, it didn't work. Quite likely that I screwed up somehow, but the focus keeps reverting to the property editor on every attempt to select the resource editor. I tried to be extra careful with indentation, but still not working here. <br> Bo<br> </body> </html> |