]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/textctrl.cpp
added wxArtProvider technote
[wxWidgets.git] / 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();