]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
compilation fix for yet another broken version of mingw (ENSESSION_LOGOFF not defined)
[wxWidgets.git] / src / msw / textctrl.cpp
index 4d90bd0d7220a6f5d61ed6ff997d8ce12b0bfb49..288f674d4275bc637d4da4a080588a53ea516b64 100644 (file)
@@ -5,8 +5,8 @@
 // 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
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -413,6 +413,7 @@ WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
             // always adjust the vertical scrollbar automatically if we have it
             msStyle |= WS_VSCROLL | ES_AUTOVSCROLL;
 
+#if wxUSE_RICHEDIT
             // we have to use this style for the rich edit controls because
             // without it the vertical scrollbar never appears at all in
             // richedit 3.0 because of our ECO_NOHIDESEL hack (search for it)
@@ -420,6 +421,7 @@ WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
             {
                 msStyle |= ES_DISABLENOSCROLL;
             }
+#endif // wxUSE_RICHEDIT
         }
 
         style |= wxTE_PROCESS_ENTER;
@@ -568,14 +570,16 @@ void wxTextCtrl::SetValue(const wxString& value)
     if ( (value.length() > 0x400) || (value != GetValue()) )
     {
         DoWriteText(value, FALSE /* not selection only */);
+    }
 
-        // mark the control as being not dirty - we changed its text, not the
-        // user
-        DiscardEdits();
+    // we should reset the modified flag even if the value didn't really change
 
-        // for compatibility, don't move the cursor when doing SetValue()
-        SetInsertionPoint(0);
-    }
+    // mark the control as being not dirty - we changed its text, not the
+    // user
+    DiscardEdits();
+
+    // for compatibility, don't move the cursor when doing SetValue()
+    SetInsertionPoint(0);
 }
 
 #if wxUSE_RICHEDIT && (!wxUSE_UNICODE || wxUSE_UNICODE_MSLU)