From a29ee706139a530a78df1f6f6200b076b5ebdb74 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sat, 11 Jan 2003 15:03:42 +0000 Subject: [PATCH] If -1 is used for width/height, use best size. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/motif/choice.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index ed99311e79..bfe6a69b47 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -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(); -- 2.45.2