]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/textctrl.cpp
wxMac: The get-url apple event is now supported, simply override
[wxWidgets.git] / src / univ / textctrl.cpp
index ae6e1d5d4547e50e7dd61c12881ab7dd8dbeae94..afba680e8db7d3ffc384074ab4595ca3fc113242 100644 (file)
@@ -650,6 +650,7 @@ void wxTextCtrl::Init()
 
     m_isModified = false;
     m_isEditable = true;
+    m_wrapLines = false;
 
     m_posLast =
     m_curPos =
@@ -695,9 +696,18 @@ bool wxTextCtrl::Create(wxWindow *parent,
         // create data object for normal multiline or for controls with line
         // wrap as needed
         if ( style & wxHSCROLL )
+        {
             m_data.mdata = new wxTextMultiLineData;
-        else
+        }
+        else // we must wrap lines if we don't have horizontal scrollbar
+        {
+            // NB: we can't rely on HasFlag(wxHSCROLL) as the flags can change
+            //     later and even wxWindow::Create() itself temporarily resets
+            //     wxHSCROLL in wxUniv, so remember that we have a wrapped data
+            //     and not just a multi line data in a separate variable
+            m_wrapLines = true;
             m_data.wdata = new wxTextWrappedData;
+        }
     }
     else
     {
@@ -740,7 +750,7 @@ bool wxTextCtrl::Create(wxWindow *parent,
 
     RecalcFontMetrics();
     SetValue(value);
-    SetBestSize(size);
+    SetInitialSize(size);
 
     m_isEditable = !(style & wxTE_READONLY);
 
@@ -3732,7 +3742,7 @@ void wxTextCtrl::RefreshTextRange(wxTextPos start, wxTextPos end)
         {
             // intermediate line or the last one but we need to refresh it
             // until the end anyhow - do it
-            posCount = wxSTRING_MAXLEN;
+            posCount = wxString::npos;
         }
         else // last line
         {