Hi All,
I ran into this very weird, but reproducible issue with wxSTC control not getting focus inside an AuiNotebook tab (doesn't work on OSX, works on Windows running the same 2.9.5 code from trunk; also works correctly on all platforms with 2.8.12).
Steps to reproduce. (1) Take the aui sample and add OnNotebookPageChanged linked to EVT_AUINOTEBOOK_PAGE_CHANGED event:
void MyFrame::OnNotebookPageChanged(wxAuiNotebookEvent& evt) {
wxAuiNotebook* ctrl = (wxAuiNotebook*)evt.GetEventObject();
ctrl->GetPage(ctrl->GetSelection())->SetFocus();
evt.Skip();
}
Now when the tab is clicked, the focus is on the wxTextCtrl in that tab and you can start typing text right away.
(2) Modify two of the tabs to use wxStyledTextCtrl instead of wxTextCtrl. Now when *these* tabs are clicked, the focus is still on the tab itself (you can see this because arrow keys will move control between tabs) and the text cannot be typed into the editor control (you can click on the editor window, but I need to set the focus programmatically).
I tried various workarounds with dynamic casting, but nothing helps. wxNotebook doesn't seem to have this issue. Can someone tell me what is going on? Is there a workaround I can use? Or is this a known issue that can be fixed (my search didn't find anything relevant)? This issue is very noticeable to the users and I'd like this to work correctly. Thank you.
Paul.