]> git.saurik.com Git - wxWidgets.git/commitdiff
Make text control send text update events.
authorRobert Roebling <robert@roebling.de>
Sun, 7 Apr 2002 14:46:44 +0000 (14:46 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 7 Apr 2002 14:46:44 +0000 (14:46 +0000)
  Something else.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/x11/textctrl.cpp

index c79e3f74a700136c883aa5e87083f9046a766114..9a0718f33c28571edf9040472e3ad75ad32d305e 100644 (file)
@@ -258,7 +258,7 @@ wxString wxTextCtrl::GetValue() const
     for (size_t i = 0; i < m_lines.GetCount(); i++)
     {
         ret += m_lines[i].m_text;
-        if (i < m_lines.GetCount())
+        if (i+1 < m_lines.GetCount())
             ret += wxT('\n');
     }
     
@@ -1997,6 +1997,14 @@ void wxTextCtrl::OnChar( wxKeyEvent &event )
         }
         case WXK_RETURN:
         {
+            if (m_windowStyle & wxPROCESS_ENTER)
+            {
+                wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
+                event.SetEventObject(this);
+                event.SetString(GetValue());
+                if (GetEventHandler()->ProcessEvent(event)) return;
+            }
+            
             if (IsSingleLine())
             {
                 event.Skip();