]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobox.cpp
Added SetBitmap, GetBitmap to wxWizard
[wxWidgets.git] / src / msw / radiobox.cpp
index 95f6f127c47762f878edb580a24af2b73e4e5ccf..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),
@@ -323,7 +323,7 @@ void wxRadioBox::SendNotificationEvent()
 
 unsigned int wxRadioBox::GetCount() const
 {
-    return m_radioButtons->GetCount();
+    return m_radioButtons ? m_radioButtons->GetCount() : 0u;
 }
 
 void wxRadioBox::SetString(unsigned int item, const wxString& label)
@@ -505,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;