Le 30 août 09 à 10:26, Frank Niessink a écrit :

> 2009/8/30 Jérôme Laheurte <[email protected]>:
>

> > There is a problem I'm working on: the  
> AuiManagedFrameWithNotebookAPI
> > does not have a pageChanged/pageClosed event. Is that normal ? It
> > seems to produce strange bugs regarding the filter menu (and  
> probably
> > others). The container's getActiveViewer() method does not always
> > return the currently active viewer...
>
> There's an issue with the original AUI: it allows for 'active' panes,
> but there's no event sent when the active pane changes. So if the user
> clicks on a pane header, the pane visually changes to indicate it is
> now active, but Task Coach doesn't get notified about it and the focus
> isn't really changed. However, if the user changes the active pane by
> clicking on an item in another pane, than it does work, because then
> the focus is changed. You can test this by clicking on a pane header
> and then doing File->Print preview; you'll see that the old pane is
> being used.
>

A solution that is a bit hackish:

     def activeViewer(self):
         if not self._settings.getboolean('view', 'tabbedmainwindow'):
             for viewer in self.viewers:
                 info = self.containerWidget.manager.GetPane(viewer)
                 if info.HasFlag(info.optionActive):
                     return viewer

It works both with agw.aui and wx.aui. What do you think ?

Then, the other branch of the 'if' would just fallback to  
self.viewers[self.__currentPageNumber], and we can get rid of the  
windowWithFocus stuff.
>
> BTW, pageClosed event should work I think?
>

Yes, it works.

Reply via email to