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
This commit is contained in:
Kevin Ollivier
2006-11-21 07:08:40 +00:00
parent 38c6df6e11
commit 6df8705880
3 changed files with 15 additions and 0 deletions

View File

@@ -170,6 +170,7 @@ public:
virtual void MacVisibilityChanged(); virtual void MacVisibilityChanged();
virtual void MacEnabledStateChanged(); virtual void MacEnabledStateChanged();
virtual void MacSuperChangedPosition(); virtual void MacSuperChangedPosition();
virtual void MacCheckSpelling(bool check);
#ifndef __WXMAC_OSX__ #ifndef __WXMAC_OSX__
virtual void MacControlUserPaneDrawProc(wxInt16 part); virtual void MacControlUserPaneDrawProc(wxInt16 part);

View File

@@ -206,6 +206,7 @@ public :
virtual void ShowPosition(long WXUNUSED(pos)) ; virtual void ShowPosition(long WXUNUSED(pos)) ;
virtual int GetLineLength(long lineNo) const ; virtual int GetLineLength(long lineNo) const ;
virtual wxString GetLineText(long lineNo) const ; virtual wxString GetLineText(long lineNo) const ;
virtual void CheckSpelling(bool check) { }
#ifndef __WXMAC_OSX__ #ifndef __WXMAC_OSX__
virtual void MacControlUserPaneDrawProc(wxInt16 part) = 0 ; virtual void MacControlUserPaneDrawProc(wxInt16 part) = 0 ;
@@ -263,6 +264,12 @@ public :
return false ; 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 void Clear() ;
virtual bool CanUndo() const ; virtual bool CanUndo() const ;
@@ -540,6 +547,11 @@ void wxTextCtrl::MacEnabledStateChanged()
{ {
} }
void wxTextCtrl::MacCheckSpelling(bool check)
{
GetPeer()->CheckSpelling(check);
}
wxString wxTextCtrl::GetValue() const wxString wxTextCtrl::GetValue() const
{ {
return GetPeer()->GetStringValue() ; return GetPeer()->GetStringValue() ;

View File

@@ -344,6 +344,8 @@ the client area origin nor scrolling. ", "",
virtual void SelectAll(); virtual void SelectAll();
virtual void SetEditable(bool editable); virtual void SetEditable(bool editable);
virtual void MacCheckSpelling(bool check);
// generate the wxEVT_COMMAND_TEXT_UPDATED event, like SetValue() does // generate the wxEVT_COMMAND_TEXT_UPDATED event, like SetValue() does
void SendTextUpdatedEvent(); void SendTextUpdatedEvent();