]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/textctrl.cpp
Applied #15375 to stop event-sending in generic wxSpinCtrl ctor (eco)
[wxWidgets.git] / src / x11 / textctrl.cpp
index c3aee9d8be5aba2798a2c1a43a244478db17f4ee..492d37e5dfdba6843598cbcc794a41e215d60cfc 100644 (file)
@@ -2,21 +2,26 @@
 // Name:        src/x11/textctrl.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/textctrl.h"
 
-#include "wx/utils.h"
-#include "wx/intl.h"
-#include "wx/log.h"
-#include "wx/settings.h"
-#include "wx/panel.h"
+#ifndef WX_PRECOMP
+    #include "wx/intl.h"
+    #include "wx/log.h"
+    #include "wx/utils.h"
+    #include "wx/panel.h"
+    #include "wx/dcclient.h"
+    #include "wx/settings.h"
+#endif
+
 #include "wx/clipbrd.h"
 #include "wx/tokenzr.h"
-#include "wx/dcclient.h"
 
 #include "wx/univ/inphand.h"
 #include "wx/univ/renderer.h"
@@ -125,9 +130,7 @@ WX_DEFINE_OBJARRAY(wxSourceLineArray);
 //  wxTextCtrl
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl,wxControl)
-
-BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
+BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase)
     EVT_PAINT(wxTextCtrl::OnPaint)
     EVT_ERASE_BACKGROUND(wxTextCtrl::OnEraseBackground)
     EVT_CHAR(wxTextCtrl::OnChar)
@@ -271,7 +274,7 @@ wxString wxTextCtrl::GetValue() const
     return ret;
 }
 
-void wxTextCtrl::SetValue(const wxString& value)
+void wxTextCtrl::DoSetValue(const wxString& value, int flags)
 {
     m_modified = false;
 
@@ -337,6 +340,9 @@ void wxTextCtrl::SetValue(const wxString& value)
     MyAdjustScrollbars();
 
     Refresh();
+
+    if ( flags & SetValue_SendEvent )
+        SendTextUpdatedEvent();
 }
 
 int wxTextCtrl::GetLineLength(long lineNo) const
@@ -1549,7 +1555,7 @@ void wxTextCtrl::DrawLine( wxDC &dc, int x, int y, const wxString &line2, int li
 
         size_t pos = 0;
         wxString token( GetNextToken( line, pos ) );
-        while (!token.IsNull())
+        while ( !token.empty() )
         {
             if (m_keywords.Index( token ) != wxNOT_FOUND)
             {
@@ -1887,12 +1893,12 @@ void wxTextCtrl::OnChar( wxKeyEvent &event )
         }
         case WXK_RETURN:
         {
-            if (m_windowStyle & wxPROCESS_ENTER)
+            if (m_windowStyle & wxTE_PROCESS_ENTER)
             {
-                wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
+                wxCommandEvent event(wxEVT_TEXT_ENTER, m_windowId);
                 event.SetEventObject(this);
                 event.SetString(GetValue());
-                if (GetEventHandler()->ProcessEvent(event)) return;
+                if (HandleWindowEvent(event)) return;
             }
 
             if (IsSingleLine())
@@ -2366,18 +2372,6 @@ wxSize wxTextCtrl::DoGetBestSize() const
     }
 }
 
-// ----------------------------------------------------------------------------
-// freeze/thaw
-// ----------------------------------------------------------------------------
-
-void wxTextCtrl::Freeze()
-{
-}
-
-void wxTextCtrl::Thaw()
-{
-}
-
 void wxTextCtrl::OnSetFocus( wxFocusEvent& event )
 {
     // To hide or show caret, as appropriate