]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/textctrl.cpp
added wxTextCtrl::ChangeValue() which is the same as SetValue() but doesn't send...
[wxWidgets.git] / src / os2 / textctrl.cpp
index f5ac61433c7d0224fb1aea051d0b0f36bbcf0426..111a63165bd0edd45d4dcec0ddd621b70d2cecd4 100644 (file)
@@ -125,6 +125,7 @@ bool wxTextCtrl::Create(
 
     m_windowStyle = lStyle;
     m_bIsMLE = false;
+    m_bSkipUpdate = false;
 
     long                            lSstyle = WS_VISIBLE | WS_TABSTOP;
 
@@ -343,8 +344,9 @@ wxString wxTextCtrl::GetValue() const
     return sStr;
 } // end of wxTextCtrl::GetValue
 
-void wxTextCtrl::SetValue(
-  const wxString&                   rsValue
+void wxTextCtrl::DoSetValue(
+  const wxString&                   rsValue,
+  int flags
 )
 {
     //
@@ -355,6 +357,9 @@ void wxTextCtrl::SetValue(
     //
     if ((rsValue.length() > 0x400) || (rsValue != GetValue()))
     {
+        if ( flags & SetValue_SendEvent )
+            m_bSkipUpdate = true;
+
         ::WinSetWindowText(GetHwnd(), (PSZ)rsValue.c_str());
         AdjustSpaceLimit();
     }
@@ -1095,6 +1100,12 @@ bool wxTextCtrl::OS2Command(
 
         case EN_CHANGE:
             {
+                if (m_bSkipUpdate)
+                {
+                    m_bSkipUpdate = false;
+                    break;
+                }
+
                 wxCommandEvent      vEvent( wxEVT_COMMAND_TEXT_UPDATED
                                            ,m_windowId
                                           );