]> git.saurik.com Git - wxWidgets.git/commitdiff
If -1 is used for width/height, use best size.
authorMattia Barbon <mbarbon@cpan.org>
Sat, 11 Jan 2003 15:03:42 +0000 (15:03 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Sat, 11 Jan 2003 15:03:42 +0000 (15:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/motif/choice.cpp

index ed99311e799c0057d7843a8429e7660b90768019..bfe6a69b47c527efb9faffb9f023daa53a0f9496 100644 (file)
@@ -85,7 +85,6 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
     m_menuWidget = (WXWidget) XmCreatePulldownMenu ((Widget) m_formWidget,
                                                     "choiceMenu", NULL, 0);
 
-    //    int i;
     if (n > 0)
     {
         int i;
@@ -125,12 +124,16 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
 #endif
 #endif
 
+    wxSize bestSize = GetBestSize();
+    if( size.x > 0 ) bestSize.x = size.x;
+    if( size.y > 0 ) bestSize.y = size.y;
+
     XtVaSetValues((Widget) m_formWidget, XmNresizePolicy, XmRESIZE_NONE, NULL);
 
     ChangeFont(FALSE);
 
     AttachWidget (parent, m_buttonWidget, m_formWidget,
-                  pos.x, pos.y, size.x, size.y);
+                  pos.x, pos.y, bestSize.x, bestSize.y);
 
     ChangeBackgroundColour();