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
This commit is contained in:
Mattia Barbon
2003-01-11 15:03:42 +00:00
parent 07157c53d0
commit a29ee70613

View File

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