X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5fde6fcc9b551340a194ae4c726db5ab64b5c594..acc0ebd7a871124d4d6b36069340227e6c584f38:/src/mac/textctrl.cpp diff --git a/src/mac/textctrl.cpp b/src/mac/textctrl.cpp index 0a51bb757e..0724fe9da9 100644 --- a/src/mac/textctrl.cpp +++ b/src/mac/textctrl.cpp @@ -107,6 +107,15 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, MacPreControlCreate( parent , id , "" , pos , mySize ,style, validator , name , &bounds , title ) ; + if ( m_windowStyle & wxTE_MULTILINE ) + { + wxASSERT_MSG( !(m_windowStyle & wxTE_PROCESS_ENTER), + wxT("wxTE_PROCESS_ENTER style is ignored for multiline text controls (they always process it)") ); + + m_windowStyle |= wxTE_PROCESS_ENTER; + } + + m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , "\p" , true , 0 , 0 , 1, ( style & wxTE_PASSWORD ) ? kControlEditTextPasswordProc : kControlEditTextProc , (long) this ) ; MacPostControlCreate() ; @@ -194,7 +203,6 @@ void wxTextCtrl::SetValue(const wxString& st) UMADrawControl( m_macControl ) ; UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; - wxDC::MacInvalidateSetup() ; } } } @@ -283,7 +291,6 @@ void wxTextCtrl::Paste() UMADrawControl( m_macControl ) ; UMASetThemeWindowBackground( win->MacGetWindowData()->m_macWindow , win->MacGetWindowData()->m_macWindowBackgroundTheme , false ) ; - wxDC::MacInvalidateSetup() ; } } } @@ -396,7 +403,7 @@ void wxTextCtrl::Replace(long from, long to, const wxString& value) TESetSelect( from , to , teH ) ; TEDelete( teH ) ; TEInsert( value , value.Length() , teH ) ; -// MacInvalidateControl() ; + Refresh() ; } void wxTextCtrl::Remove(long from, long to) @@ -411,7 +418,7 @@ void wxTextCtrl::Remove(long from, long to) UMASetControlData( m_macControl , 0, kControlEditTextSelectionTag , sizeof( selection ) , (char*) &selection ) ; UMAGetControlData( m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ; TEDelete( teH ) ; -// MacInvalidateControl() ; + Refresh() ; } void wxTextCtrl::SetSelection(long from, long to) @@ -655,7 +662,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) keychar = short(ev->message & charCodeMask); keycode = short(ev->message & keyCodeMask) >> 8 ; UMAHandleControlKey( m_macControl , keycode , keychar , ev->modifiers ) ; - if ( keychar >= 0x20 || event.KeyCode() == WXK_RETURN) + if ( keychar >= 0x20 || event.KeyCode() == WXK_RETURN || event.KeyCode() == WXK_DELETE || event.KeyCode() == WXK_BACK) { wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); event.SetString( GetValue() ) ;