Use CreateButtonSizer in wxAboutBox() to make OK button look native.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41801 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user