From 3028fd40a07cbb6da694ee76f9090e79c9aaf929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Mon, 3 Oct 2016 18:15:53 +0200 Subject: [PATCH] Re-enable automatic substitutions in wxTextCtrl on OS X This reverts ill-advised commits c07523734f2d93a8c9042d80fdd458954b0e1d41 and 8d42890df49564d6d81e413bcd4428bf6a8b10e6 that disabled native OS X behavior of substituting dashes and quotes with typographically correct characters if the user has this feature enabled. This was a bad idea for two reasons: 1. It made wx applications behave non-natively, and thus be worse, in a highly noticeable area. 2. It made it impossible for applications that want to behave correctly to restore the native behavior, because once setAutomaticDashSubstitutionEnabled or setAutomaticQuoteSubstitutionEnabled is called (as wxTextCtrl constructor does), it's no longer possible to obtain its original, default setting. It's not better to disable native functionality by default, it's better to be native and make customizations possible. wxWindow API exposes access to the native control and if an application desires to disable substitution behavior, it can easily do so from user code. See also #186 and #241. --- docs/changes.txt | 1 - src/osx/cocoa/textctrl.mm | 2 -- 2 files changed, 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index ebe8bda1de..ab7e9edf94 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -152,7 +152,6 @@ wxOSX: - Implement wxGetDisplaySizeMM() and fix printing DPI (David Vanderson). - Remove extra borders around wxFilePickerCtrl (John Roberts). - Set up extensions filter correctly in wxFileDialog (nick863). -- Turn off automatic quotes substitutions in wxTextCtrl (Xlord2). - Implement wxDataViewChoiceByIndexRenderer (wanup). - Fix unnecessary indentation in list-like wxDataViewCtrl (Andreas Falkenhahn). - Recognize macOS 10.12 Sierra in wxGetOsDescription() (Tobias Taschner). diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index d1a99496c7..bde2b3c07c 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -620,8 +620,6 @@ wxNSTextViewControl::wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w, long s [tv setVerticallyResizable:YES]; [tv setHorizontallyResizable:hasHScroll]; [tv setAutoresizingMask:NSViewWidthSizable]; - [tv setAutomaticDashSubstitutionEnabled:false]; - [tv setAutomaticQuoteSubstitutionEnabled:false]; if ( hasHScroll ) {