"Active" and "Selected" wxAuiMDIChildFrame inconsistency
|Reported by:||wsu||Owned by:|
|Keywords:||wxAuiMDI active selected||Cc:|
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)
Change History (10)
Changed 5 years ago by wsu
Changed 4 years ago by wsu
comment:5 Changed 4 years ago by wsu
- Resolution fixed deleted
- Status changed from closed to reopened