]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
!__WX_DC_BLIT_FIXED__ case
[wxWidgets.git] / src / msw / textctrl.cpp
index a71654a1ecf4c42e3334deab5fa793d7410b8dad..4f698250278bad841bc09d9d5a6dffdfb5f79868 100644 (file)
@@ -662,6 +662,15 @@ void wxTextCtrl::SetWindowStyleFlag(long style)
 // set/get the controls text
 // ----------------------------------------------------------------------------
 
+bool wxTextCtrl::IsEmpty() const
+{
+    // this is an optimization for multiline controls containing a lot of text
+    if ( IsMultiLine() && GetNumberOfLines() != 1 )
+        return false;
+
+    return wxTextCtrlBase::IsEmpty();
+}
+
 wxString wxTextCtrl::GetValue() const
 {
     // range 0..-1 is special for GetRange() and means to retrieve all text
@@ -793,7 +802,7 @@ void wxTextCtrl::DoSetValue(const wxString& value, int flags)
     // edit controls mostly)
     if ( (value.length() > 0x400) || (value != GetValue()) )
     {
-        DoWriteText(value, flags);
+        DoWriteText(value, flags /* doesn't include SelectionOnly here */);
 
         // mark the control as being not dirty - we changed its text, not the
         // user
@@ -1436,7 +1445,7 @@ void wxTextCtrl::Replace(long from, long to, const wxString& value)
     // Set selection and remove it
     DoSetSelection(from, to, false /* don't scroll caret into view */);
 
-    DoWriteText(value, SetValue_SelectionOnly);
+    DoWriteText(value);
 }
 
 void wxTextCtrl::Remove(long from, long to)