From 0f8845156191e81adfbe094123d0ddeca8b3fb78 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 9 Apr 2005 11:43:28 +0000 Subject: [PATCH] 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 --- src/common/sizer.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 36c63f9e10..a91079626d 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -1868,10 +1868,31 @@ void wxStdDialogButtonSizer::Realize() if (m_buttonAffirmative) 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 - // do the same thing for GTK1 and Windows platforms - // and assume any platform not accounted for here will use - // Windows style + // GTK+1 and any other platform + // Add(0, 0, 0, wxLEFT, 5); // Not sure what this was for but it unbalances the dialog if (m_buttonHelp) Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonHelp->ConvertDialogToPixels(wxSize(4, 0)).x);