Fix handling of "Cancel" button in wxSearchCtrl under OS X.

Pressing it results in a control action with an empty, but not null, string.
Recognize it correctly.

Closes #16869.

(this is a backport of 7065e26fb3 from master)
This commit is contained in:
John Roberts
2015-07-18 01:19:18 +02:00
committed by Vadim Zeitlin
parent 76ee2fa0a0
commit 1b4a7cd671
2 changed files with 2 additions and 1 deletions

View File

@@ -637,6 +637,7 @@ wxOSX:
- Fix using wxHTTP and wxFTP from worker thread.
- Fix wxFileDialog::GetFilterIndex() for file open dialogs (phsilva).
- Fix wxSearchCtrl appearance under 10.10 (John Roberts).
- Fix handling of "Cancel" button in wxSearchCtrl (John Roberts).
- Generate correct events for WXK_NUMPAD_ENTER (John Roberts).
- Fix handling of WXK_NUMPAD_ENTER in wxTextCtrl (John Roberts).
- Send wxIconizeEvent when a window is iconized/restore (Rob Krakora).

View File

@@ -155,7 +155,7 @@ public :
if ( wxpeer )
{
NSString *searchString = [m_searchField stringValue];
if ( searchString == nil )
if ( searchString == nil || !searchString.length )
{
wxpeer->HandleSearchFieldCancelHit();
}