]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobox.cpp
fix warnings about parameters shadowing member variables
[wxWidgets.git] / src / msw / radiobox.cpp
index af016c9a1599bd7593b79cf0e4d8f32ff5fdcaf0..408c5d8b65d51104152a662afd6be9538380d0c0 100644 (file)
@@ -170,7 +170,7 @@ bool wxRadioBox::Create(wxWindow *parent,
         long newId = NewControlId();
 
         HWND hwndBtn = ::CreateWindow(_T("BUTTON"),
-                                      choices[i],
+                                      choices[i].wx_str(),
                                       styleBtn,
                                       0, 0, 0, 0,   // will be set in SetSize()
                                       GetHwndOf(parent),
@@ -206,10 +206,6 @@ bool wxRadioBox::Create(wxWindow *parent,
     SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
 #endif
 
-    // Have to invalidate the best size as it may have been calculated
-    // before the number of buttons was known
-    InvalidateBestSize();
-
     SetMajorDim(majorDim == 0 ? n : majorDim, style);
     SetSelection(0);
     SetSize(pos.x, pos.y, size.x, size.y);
@@ -509,6 +505,13 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
 
 wxSize wxRadioBox::DoGetBestSize() const
 {
+    if ( !m_radioButtons )
+    {
+        // if we're not fully initialized yet, we can't meaningfully compute
+        // our best size, we'll do it later
+        return wxSize(1, 1);
+    }
+
     wxSize best = GetTotalButtonSize(GetMaxButtonSize());
     CacheBestSize(best);
     return best;