// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
#include <stdlib.h>
#include <sys/types.h>
-#if wxUSE_RICHEDIT && (!defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__))
+#if wxUSE_RICHEDIT
+
+// old mingw32 has richedit stuff directly in windows.h and doesn't have
+// richedit.h at all
+#if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__)
#include <richedit.h>
#endif
// Watcom C++ doesn't define this
#ifndef SCF_ALL
-#define SCF_ALL 0x0004
+ #define SCF_ALL 0x0004
#endif
+#endif // wxUSE_RICHEDIT
+
// ----------------------------------------------------------------------------
// private functions
// ----------------------------------------------------------------------------
m_suppressNextUpdate = TRUE;
}
- if ( !::SendMessage(GetHwnd(), EM_STREAMIN,
- SF_TEXT |
- SF_UNICODE |
- (selectionOnly ? SFF_SELECTION : 0),
- (LPARAM)&eds) || eds.dwError )
+ ::SendMessage(GetHwnd(), EM_STREAMIN,
+ SF_TEXT |
+ SF_UNICODE |
+ (selectionOnly ? SFF_SELECTION : 0),
+ (LPARAM)&eds);
+
+ if ( eds.dwError )
{
wxLogLastError(_T("EM_STREAMIN"));
}
void wxTextCtrl::SetInsertionPointEnd()
{
+ // we must not do anything if the caret is already there because calling
+ // SetInsertionPoint() thaws the controls if Freeze() had been called even
+ // if it doesn't actually move the caret anywhere and so the simple fact of
+ // doing it results in horrible flicker when appending big amounts of text
+ // to the control in a few chunks (see DoAddText() test in the text sample)
+ if ( GetInsertionPoint() == GetLastPosition() )
+ return;
+
long pos;
#if wxUSE_RICHEDIT
void wxTextCtrl::OnChar(wxKeyEvent& event)
{
- switch ( event.KeyCode() )
+ switch ( event.GetKeyCode() )
{
case WXK_RETURN:
if ( !(m_windowStyle & wxTE_MULTILINE) )