]> 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 ff7515af56758b1cf4b71677593cae22aee4ea6f..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);