Lay buttons out on Windows according to conventions. Button spacing is

also reduced to a more reasonable size.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2005-04-09 11:43:28 +00:00
parent fbe2ca438b
commit 0f88451561

View File

@ -1868,10 +1868,31 @@ void wxStdDialogButtonSizer::Realize()
if (m_buttonAffirmative) if (m_buttonAffirmative)
Add((wxWindow*)m_buttonAffirmative, 0, wxALIGN_CENTRE | wxLEFT, 6); Add((wxWindow*)m_buttonAffirmative, 0, wxALIGN_CENTRE | wxLEFT, 6);
#elif defined(__WXMSW__)
// Windows
// right-justify buttons
Add(0, 0, 1, wxEXPAND, 0);
if (m_buttonAffirmative){
Add((wxWindow*)m_buttonAffirmative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonAffirmative->ConvertDialogToPixels(wxSize(2, 0)).x);
}
if (m_buttonNegative){
Add((wxWindow*)m_buttonNegative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonNegative->ConvertDialogToPixels(wxSize(2, 0)).x);
}
if (m_buttonCancel){
Add((wxWindow*)m_buttonCancel, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonCancel->ConvertDialogToPixels(wxSize(2, 0)).x);
}
if (m_buttonApply)
Add((wxWindow*)m_buttonApply, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonApply->ConvertDialogToPixels(wxSize(2, 0)).x);
if (m_buttonHelp)
Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonHelp->ConvertDialogToPixels(wxSize(2, 0)).x);
#else #else
// do the same thing for GTK1 and Windows platforms // GTK+1 and any other platform
// and assume any platform not accounted for here will use
// Windows style
// Add(0, 0, 0, wxLEFT, 5); // Not sure what this was for but it unbalances the dialog // Add(0, 0, 0, wxLEFT, 5); // Not sure what this was for but it unbalances the dialog
if (m_buttonHelp) if (m_buttonHelp)
Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonHelp->ConvertDialogToPixels(wxSize(4, 0)).x); Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonHelp->ConvertDialogToPixels(wxSize(4, 0)).x);