Ticket #14684 (closed defect: fixed)
"Active" and "Selected" wxAuiMDIChildFrame inconsistency
| Reported by: | wsu | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | wxAui | Version: | 2.9-svn |
| Keywords: | wxAuiMDI active selected | Cc: | |
| Blocked By: | Patch: | yes | |
| Blocking: |
Description
Suppose a wxAuiMDIParentFrame has a wxAuiMDIChildFrame. If a second wxAuiMDIChildFrame is allocated, and Show(false) is called before Create(), then wxAuiMDIParentFrame has SetActiveChild() called for the second wxAuiMDIChildFrame, but the wxAuiMDIClientWindow::InsertPage() does not call wxAuiMDIChildFrame SetSelectionToWindow() for the second wxAuiMDIChildFrame. This results in the wxAuiMDIParentFrame treating the second wxAuiMDIChildFrame as active, but the wxAuiMDIClientWindow treating the first wxAuiMDIChildFrame as selected.
It would be easy to modify wxAuiMDIParentFrame::SetActiveChild() so that when Show(false) has been called, it skips SetActiveChild() so that the program is in a consistent state with the first wxAuiMDIChildFrame both active and selected. However, I think that is the wrong thing to do. I think the wxAuiMDIParentFrame should be modified so that SetActiveChild() and GetActiveChild() are convenience functions wrapping the wxAuiMDIClientWindow SetSelection() and GetSelection(). This would prevent any other situation where the active and selected children are different.
I have included a patch to make this change.
(This was originally discussed in http://groups.google.com/d/msg/wx-dev/kBBJChNYumA/oOjq0p8CeaMJ)

