X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c13c9657a402c546d36d51628aec65903deb6605..81b41c03c6bcbffa9293a0e280729ffaaf9ef2c7:/src/motif/choice.cpp diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index ed99311e79..a3e57838b9 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(); @@ -219,7 +222,7 @@ void wxChoice::Delete(int n) void wxChoice::Clear() { m_stringList.Clear (); - int i; + size_t i; for (i = 0; i < m_noStrings; i++) { XtRemoveCallback((Widget) m_widgetArray[i], @@ -283,7 +286,7 @@ void wxChoice::SetSelection(int n) #if 0 Dimension selectionWidth, selectionHeight; #endif - wxXmString text( (char*)node->Data() ); + wxXmString text( node->GetData() ); // MBN: this seems silly, at best, and causes wxChoices to be clipped: // will remove "soon" #if 0 @@ -366,7 +369,7 @@ void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags) if (width > -1) { - int i; + size_t i; for (i = 0; i < m_noStrings; i++) XtVaSetValues ((Widget) m_widgetArray[i], XmNwidth, actualWidth, @@ -376,7 +379,7 @@ void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags) } if (height > -1) { - int i; + size_t i; for (i = 0; i < m_noStrings; i++) XtVaSetValues ((Widget) m_widgetArray[i], XmNheight, actualHeight, @@ -454,7 +457,7 @@ void wxChoice::ChangeBackgroundColour() DoChangeBackgroundColour(m_formWidget, m_backgroundColour); DoChangeBackgroundColour(m_buttonWidget, m_backgroundColour); DoChangeBackgroundColour(m_menuWidget, m_backgroundColour); - int i; + size_t i; for (i = 0; i < m_noStrings; i++) DoChangeBackgroundColour(m_widgetArray[i], m_backgroundColour); } @@ -464,7 +467,7 @@ void wxChoice::ChangeForegroundColour() DoChangeForegroundColour(m_formWidget, m_foregroundColour); DoChangeForegroundColour(m_buttonWidget, m_foregroundColour); DoChangeForegroundColour(m_menuWidget, m_foregroundColour); - int i; + size_t i; for (i = 0; i < m_noStrings; i++) DoChangeForegroundColour(m_widgetArray[i], m_foregroundColour); }