]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/aboutdlgg.cpp
check that the bitmap is valid before getting its size to avoid asserts
[wxWidgets.git] / src / generic / aboutdlgg.cpp
index 8f72fe0e6d22110a869ac619d7796b17256b6408..21a6a057543264aeef4e441099f12db189645674 100644 (file)
@@ -151,12 +151,25 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info)
 
     wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
     sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border());
-    sizerTop->Add(new wxButton(this, wxID_OK), wxSizerFlags().Right().Border());
+
+    int defBorder = wxSizerFlags().Border().GetBorderInPixels();
+    wxSizer *buttonSizer = CreateButtonSizer( wxOK , false, defBorder );
+    if(buttonSizer->GetChildren().GetCount() > 0 )
+    {
+        sizerTop->Add( buttonSizer, 0, wxEXPAND | wxALL, defBorder );
+    }
+    else
+    {
+        sizerTop->AddSpacer( defBorder );
+        delete buttonSizer;
+    }
+
     SetSizerAndFit(sizerTop);
 
     CentreOnScreen();
 
-    FindWindow(wxID_OK)->SetFocus();
+    wxWindow *ok = FindWindow(wxID_OK);
+    if (ok) ok->SetFocus();
 
     return true;
 }