SF ticker text:
On windows (win 7) with wxWidgets >3.0 (confirmed with 3.1) it is no longer possible to set the cursor in the incrementalSearch toolbar text ctrl after removing its focus. Steps to reproduce:
1) Open a project
2) Enable the incrementalSearch toolbar with view->Toolbars->IncrementalSearch
3) Search for something non existent from the toolbars text control (see 2) down)
4) After the control gets red click in the editor outside the toolbar
5) You are no longer able to set the cursor back in the toolbar control to change the text. Every text you enter will be entered in the editor.
More observations:
1) You can regain the focus of the control if you click any button in the incremental search toolbar, and after that click in the text control.
2) This behaviour happens also if the searched text is found
I think i have found the reason:
http://docs.wxwidgets.org/trunk/classwx_focus_event.html
The focus event handlers should almost invariably call wxEvent::Skip() on their event argument to allow the default handling to take place. Failure to do this may result in incorrect behaviour of the native controls. Also note that wxEVT_KILL_FOCUS handler must not call wxWindow::SetFocus() as this, again, is not supported by all native controls. If you need to do this, consider using the Delayed Action Mechanism described in wxIdleEvent documentation.
in src\plugins\contrib\IncrementalSearch\IncrementalSearch.cpp:548
void IncrementalSearch::OnKillFocus(wxCommandEvent& event)
{
if(m_pTextCtrl)
{
m_LastInsertionPoint = m_pTextCtrl->GetInsertionPoint();
}
}
is no wxEvent::Skip() call.
if i add this call
void IncrementalSearch::OnKillFocus(wxCommandEvent& event)
{
event.Skip();
if(m_pTextCtrl)
{
m_LastInsertionPoint = m_pTextCtrl->GetInsertionPoint();
}
}
all works as expected.
i will post a patch on SF as soon as they are up again.
It would be great if someone can test this on windows...