From 1c8e5a10acae7672f4b1895e23336e3b1ce0d53d Mon Sep 17 00:00:00 2001 From: John Roberts Date: Sat, 3 Oct 2015 18:05:48 +0200 Subject: [PATCH] Fix scrolling behaviour of wxSearchCtrl under OS X Make it behave in the same way as single line wxTextCtrls do. Closes #17178. --- docs/changes.txt | 1 + src/osx/cocoa/srchctrl.mm | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 80b4a01b36..ed5591ac83 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -654,6 +654,7 @@ wxOSX: - Fix printing all pages non-interactively (John Roberts). - Fix custom paper support (tijsv). - Return false from wxSound::Create()/IsOk() if the file doesn't exist. +- Fix scrolling behaviour of wxSearchCtrl (John Roberts). 3.0.2: (released 2014-10-06) diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index 8549d8d944..82313aa40c 100644 --- a/src/osx/cocoa/srchctrl.mm +++ b/src/osx/cocoa/srchctrl.mm @@ -204,6 +204,10 @@ wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxSearchCtrl* wxpeer, { NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSSearchField* v = [[wxNSSearchField alloc] initWithFrame:r]; + + // Make it behave consistently with the single line wxTextCtrl + [[v cell] setScrollable:YES]; + [[v cell] setSendsWholeSearchString:YES]; // per wx default cancel is not shown [[v cell] setCancelButtonCell:nil];