From 6df870588070fec31fc2d5b2e0b808254b9882f7 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Tue, 21 Nov 2006 07:08:40 +0000 Subject: [PATCH] Allow spell-checking to be turned off with the MLTE implementation of wxTextCtrl. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/textctrl.h | 1 + src/mac/carbon/textctrl.cpp | 12 ++++++++++++ wxPython/src/_textctrl.i | 2 ++ 3 files changed, 15 insertions(+) diff --git a/include/wx/mac/carbon/textctrl.h b/include/wx/mac/carbon/textctrl.h index 1818f2d602..457b4f98f2 100644 --- a/include/wx/mac/carbon/textctrl.h +++ b/include/wx/mac/carbon/textctrl.h @@ -170,6 +170,7 @@ public: virtual void MacVisibilityChanged(); virtual void MacEnabledStateChanged(); virtual void MacSuperChangedPosition(); + virtual void MacCheckSpelling(bool check); #ifndef __WXMAC_OSX__ virtual void MacControlUserPaneDrawProc(wxInt16 part); diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index 1e50c81412..66d4b0eec0 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -206,6 +206,7 @@ public : virtual void ShowPosition(long WXUNUSED(pos)) ; virtual int GetLineLength(long lineNo) const ; virtual wxString GetLineText(long lineNo) const ; + virtual void CheckSpelling(bool check) { } #ifndef __WXMAC_OSX__ virtual void MacControlUserPaneDrawProc(wxInt16 part) = 0 ; @@ -263,6 +264,12 @@ public : return false ; } + virtual void CheckSpelling(bool check) + { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + TXNSetSpellCheckAsYouType( m_txn, (Boolean) check ); +#endif + } virtual void Clear() ; virtual bool CanUndo() const ; @@ -540,6 +547,11 @@ void wxTextCtrl::MacEnabledStateChanged() { } +void wxTextCtrl::MacCheckSpelling(bool check) +{ + GetPeer()->CheckSpelling(check); +} + wxString wxTextCtrl::GetValue() const { return GetPeer()->GetStringValue() ; diff --git a/wxPython/src/_textctrl.i b/wxPython/src/_textctrl.i index 630ba209ba..e012776b25 100644 --- a/wxPython/src/_textctrl.i +++ b/wxPython/src/_textctrl.i @@ -343,6 +343,8 @@ the client area origin nor scrolling. ", "", virtual void SetSelection(long from, long to); virtual void SelectAll(); virtual void SetEditable(bool editable); + + virtual void MacCheckSpelling(bool check); // generate the wxEVT_COMMAND_TEXT_UPDATED event, like SetValue() does void SendTextUpdatedEvent(); -- 2.45.2