]> git.saurik.com Git - wxWidgets.git/commitdiff
Do not change background colour for parent widget; set best size to
authorMattia Barbon <mbarbon@cpan.org>
Sat, 1 Mar 2003 18:05:33 +0000 (18:05 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Sat, 1 Mar 2003 18:05:33 +0000 (18:05 +0000)
some arbitrary value if the text control is empty.

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

src/motif/textctrl.cpp

index 6512988d93bd2114513d2efe905a9522be082fb7..1f616b72011be77c762ea3d6461d25bb30214c94 100644 (file)
@@ -655,7 +655,8 @@ void wxTextCtrl::ChangeBackgroundColour()
         if (vsb)
             DoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
 
-        DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
+        // MBN: why change parent background?
+        // DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
     }
 }
 
@@ -728,12 +729,15 @@ wxSize wxDoGetSingleTextCtrlBestSize( Widget textWidget,
                    XmNhighlightThickness, &highlight,
                    XmNshadowThickness, &shadow,
                    NULL );
+
     if( !value )
         value = "|";
 
     int x, y;
     window->GetTextExtent( value, &x, &y );
 
+    if( x < 100 ) x = 100;
+
     return wxSize( x + 2 * xmargin + 2 * highlight + 2 * shadow,
                    // MBN: +2 necessary: Lesstif bug or mine?
                    y + 2 * ymargin + 2 * highlight + 2 * shadow + 2 );